@kumix/ui 0.4.2 → 0.4.3
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 +1 -3
- package/dist/{account-avatar-DILzuuvz.js → account-avatar--0_0u0WW.js} +4 -6
- package/dist/{account-avatar-DILzuuvz.js.map → account-avatar--0_0u0WW.js.map} +1 -1
- package/dist/{cascader-types-zhnUQ4sP.d.ts → cascader-types-Bh_kJ3Qw.d.ts} +1 -3
- package/dist/cascader-types-Bh_kJ3Qw.d.ts.map +1 -0
- package/dist/components/agents/agent-activity/activity-row.d.ts +1 -3
- package/dist/components/agents/agent-activity/activity-row.d.ts.map +1 -1
- package/dist/components/agents/agent-activity/activity-row.js +18 -19
- package/dist/components/agents/agent-activity/activity-row.js.map +1 -1
- package/dist/components/agents/agent-activity/index.d.ts +1 -3
- package/dist/components/agents/agent-activity/index.d.ts.map +1 -1
- package/dist/components/agents/agent-activity/index.js +4 -5
- package/dist/components/agents/agent-activity/index.js.map +1 -1
- package/dist/components/agents/agent-code.d.ts +0 -2
- package/dist/components/agents/agent-code.d.ts.map +1 -1
- package/dist/components/agents/agent-code.js +2 -3
- package/dist/components/agents/agent-code.js.map +1 -1
- package/dist/components/agents/agent-disclosure.d.ts +0 -2
- package/dist/components/agents/agent-disclosure.d.ts.map +1 -1
- package/dist/components/agents/agent-disclosure.js +1 -2
- package/dist/components/agents/ai-sidebar.d.ts +0 -2
- package/dist/components/agents/ai-sidebar.d.ts.map +1 -1
- package/dist/components/agents/ai-sidebar.js +8 -9
- package/dist/components/agents/ai-sidebar.js.map +1 -1
- package/dist/components/agents/approval-card/index.d.ts +0 -4
- package/dist/components/agents/approval-card/index.d.ts.map +1 -1
- package/dist/components/agents/approval-card/index.js +12 -13
- package/dist/components/agents/approval-card/index.js.map +1 -1
- package/dist/components/agents/chat-app.d.ts +0 -2
- package/dist/components/agents/chat-app.d.ts.map +1 -1
- package/dist/components/agents/chat-app.js +2 -3
- package/dist/components/agents/chat-app.js.map +1 -1
- package/dist/components/agents/citations.d.ts +0 -2
- package/dist/components/agents/citations.d.ts.map +1 -1
- package/dist/components/agents/citations.js +10 -11
- package/dist/components/agents/citations.js.map +1 -1
- package/dist/components/agents/code-block.d.ts +0 -2
- package/dist/components/agents/code-block.d.ts.map +1 -1
- package/dist/components/agents/code-block.js +10 -11
- package/dist/components/agents/code-block.js.map +1 -1
- package/dist/components/agents/file-diff.d.ts +0 -2
- package/dist/components/agents/file-diff.d.ts.map +1 -1
- package/dist/components/agents/file-diff.js +12 -13
- package/dist/components/agents/file-diff.js.map +1 -1
- package/dist/components/agents/image-generation.d.ts +0 -2
- package/dist/components/agents/image-generation.d.ts.map +1 -1
- package/dist/components/agents/image-generation.js +8 -9
- package/dist/components/agents/image-generation.js.map +1 -1
- package/dist/components/agents/loading-states/agent-progress.d.ts +0 -2
- package/dist/components/agents/loading-states/agent-progress.d.ts.map +1 -1
- package/dist/components/agents/loading-states/agent-progress.js +3 -4
- package/dist/components/agents/loading-states/agent-progress.js.map +1 -1
- package/dist/components/agents/loading-states/reasoning-text.d.ts +0 -2
- package/dist/components/agents/loading-states/reasoning-text.d.ts.map +1 -1
- package/dist/components/agents/loading-states/reasoning-text.js +2 -3
- package/dist/components/agents/loading-states/reasoning-text.js.map +1 -1
- package/dist/components/agents/loading-states/thinking-shimmer.d.ts +0 -2
- package/dist/components/agents/loading-states/thinking-shimmer.d.ts.map +1 -1
- package/dist/components/agents/loading-states/thinking-shimmer.js +1 -2
- package/dist/components/agents/message-bubble.d.ts +0 -2
- package/dist/components/agents/message-bubble.d.ts.map +1 -1
- package/dist/components/agents/message-bubble.js +4 -5
- package/dist/components/agents/message-bubble.js.map +1 -1
- package/dist/components/agents/message-context.d.ts +0 -2
- package/dist/components/agents/message-context.d.ts.map +1 -1
- package/dist/components/agents/message-context.js +1 -2
- package/dist/components/agents/message-scroller.d.ts +0 -2
- package/dist/components/agents/message-scroller.d.ts.map +1 -1
- package/dist/components/agents/message-scroller.js +2 -3
- package/dist/components/agents/message-scroller.js.map +1 -1
- package/dist/components/agents/message.d.ts +0 -2
- package/dist/components/agents/message.d.ts.map +1 -1
- package/dist/components/agents/message.js +5 -6
- package/dist/components/agents/message.js.map +1 -1
- package/dist/components/agents/prompt-input.d.ts +0 -2
- package/dist/components/agents/prompt-input.d.ts.map +1 -1
- package/dist/components/agents/prompt-input.js +13 -14
- package/dist/components/agents/prompt-input.js.map +1 -1
- package/dist/components/agents/streaming-response.d.ts +0 -2
- package/dist/components/agents/streaming-response.d.ts.map +1 -1
- package/dist/components/agents/streaming-response.js +5 -6
- package/dist/components/agents/streaming-response.js.map +1 -1
- package/dist/components/agents/todo-list.d.ts +0 -2
- package/dist/components/agents/todo-list.d.ts.map +1 -1
- package/dist/components/agents/todo-list.js +10 -11
- package/dist/components/agents/todo-list.js.map +1 -1
- package/dist/components/agents/tool-approval.d.ts +0 -2
- package/dist/components/agents/tool-approval.d.ts.map +1 -1
- package/dist/components/agents/tool-approval.js +15 -16
- package/dist/components/agents/tool-approval.js.map +1 -1
- package/dist/components/agents/tool-result.d.ts +0 -2
- package/dist/components/agents/tool-result.d.ts.map +1 -1
- package/dist/components/agents/tool-result.js +12 -13
- package/dist/components/agents/tool-result.js.map +1 -1
- package/dist/components/agents/voice-orb.d.ts +0 -2
- package/dist/components/agents/voice-orb.d.ts.map +1 -1
- package/dist/components/agents/voice-orb.js +3 -5
- package/dist/components/agents/voice-orb.js.map +1 -1
- package/dist/components/charts/bump-chart/context.d.ts +1 -1
- package/dist/components/charts/bump-chart/context.js +1 -1
- package/dist/components/charts/bump-chart/legend.d.ts +0 -2
- package/dist/components/charts/bump-chart/legend.d.ts.map +1 -1
- package/dist/components/charts/bump-chart/legend.js +4 -5
- package/dist/components/charts/bump-chart/legend.js.map +1 -1
- package/dist/components/charts/bump-chart/plot.d.ts +0 -2
- package/dist/components/charts/bump-chart/plot.d.ts.map +1 -1
- package/dist/components/charts/bump-chart/plot.js +1 -1
- package/dist/components/charts/bump-chart/point.d.ts +1 -3
- package/dist/components/charts/bump-chart/point.d.ts.map +1 -1
- package/dist/components/charts/bump-chart/point.js +8 -9
- package/dist/components/charts/bump-chart/point.js.map +1 -1
- package/dist/components/charts/bump-chart/series.d.ts +2 -4
- package/dist/components/charts/bump-chart/series.d.ts.map +1 -1
- package/dist/components/charts/bump-chart/series.js +3 -4
- package/dist/components/charts/bump-chart/series.js.map +1 -1
- package/dist/components/charts/bump-chart.d.ts +1 -3
- package/dist/components/charts/bump-chart.d.ts.map +1 -1
- package/dist/components/charts/bump-chart.js +3 -4
- package/dist/components/charts/candlestick-chart/context.d.ts +0 -2
- package/dist/components/charts/candlestick-chart/context.d.ts.map +1 -1
- package/dist/components/charts/candlestick-chart/context.js +1 -2
- package/dist/components/charts/candlestick-chart/legend.d.ts +0 -2
- package/dist/components/charts/candlestick-chart/legend.d.ts.map +1 -1
- package/dist/components/charts/candlestick-chart/legend.js +1 -2
- package/dist/components/charts/candlestick-chart/plot.d.ts +0 -2
- package/dist/components/charts/candlestick-chart/plot.d.ts.map +1 -1
- package/dist/components/charts/candlestick-chart/plot.js +5 -6
- package/dist/components/charts/candlestick-chart/plot.js.map +1 -1
- package/dist/components/charts/candlestick-chart.d.ts +0 -2
- package/dist/components/charts/candlestick-chart.d.ts.map +1 -1
- package/dist/components/charts/candlestick-chart.js +1 -2
- package/dist/components/charts/composition-chart/context.d.ts +1 -1
- package/dist/components/charts/composition-chart/context.js +1 -1
- package/dist/components/charts/composition-chart/legend.d.ts +0 -2
- package/dist/components/charts/composition-chart/legend.d.ts.map +1 -1
- package/dist/components/charts/composition-chart/legend.js +5 -6
- package/dist/components/charts/composition-chart/legend.js.map +1 -1
- package/dist/components/charts/composition-chart/plot.d.ts +0 -2
- package/dist/components/charts/composition-chart/plot.d.ts.map +1 -1
- package/dist/components/charts/composition-chart/plot.js +7 -8
- package/dist/components/charts/composition-chart/plot.js.map +1 -1
- package/dist/components/charts/composition-chart/tooltip-content.d.ts +0 -2
- package/dist/components/charts/composition-chart/tooltip-content.d.ts.map +1 -1
- package/dist/components/charts/composition-chart/tooltip-content.js +6 -7
- package/dist/components/charts/composition-chart/tooltip-content.js.map +1 -1
- package/dist/components/charts/composition-chart.d.ts +1 -3
- package/dist/components/charts/composition-chart.d.ts.map +1 -1
- package/dist/components/charts/composition-chart.js +2 -3
- package/dist/components/charts/donut-chart/center.d.ts +1 -3
- package/dist/components/charts/donut-chart/center.d.ts.map +1 -1
- package/dist/components/charts/donut-chart/center.js +4 -5
- package/dist/components/charts/donut-chart/center.js.map +1 -1
- package/dist/components/charts/donut-chart/context.d.ts +1 -3
- package/dist/components/charts/donut-chart/context.d.ts.map +1 -1
- package/dist/components/charts/donut-chart/context.js +1 -1
- package/dist/components/charts/donut-chart/legend.d.ts +1 -3
- package/dist/components/charts/donut-chart/legend.d.ts.map +1 -1
- package/dist/components/charts/donut-chart/legend.js +7 -8
- package/dist/components/charts/donut-chart/legend.js.map +1 -1
- package/dist/components/charts/donut-chart/plot.d.ts +0 -2
- package/dist/components/charts/donut-chart/plot.d.ts.map +1 -1
- package/dist/components/charts/donut-chart/plot.js +2 -3
- package/dist/components/charts/donut-chart.d.ts +1 -3
- package/dist/components/charts/donut-chart.d.ts.map +1 -1
- package/dist/components/charts/donut-chart.js +2 -3
- package/dist/components/charts/funnel-chart.d.ts +0 -4
- package/dist/components/charts/funnel-chart.d.ts.map +1 -1
- package/dist/components/charts/funnel-chart.js +9 -11
- package/dist/components/charts/funnel-chart.js.map +1 -1
- package/dist/components/charts/heat-calendar/grid.d.ts +0 -2
- package/dist/components/charts/heat-calendar/grid.d.ts.map +1 -1
- package/dist/components/charts/heat-calendar/grid.js +4 -5
- package/dist/components/charts/heat-calendar/grid.js.map +1 -1
- package/dist/components/charts/heat-calendar/legend.d.ts +0 -2
- package/dist/components/charts/heat-calendar/legend.d.ts.map +1 -1
- package/dist/components/charts/heat-calendar/legend.js +4 -5
- package/dist/components/charts/heat-calendar/legend.js.map +1 -1
- package/dist/components/charts/heat-calendar/tooltip.d.ts +1 -1
- package/dist/components/charts/heat-calendar/tooltip.js +3 -4
- package/dist/components/charts/heat-calendar.d.ts +1 -3
- package/dist/components/charts/heat-calendar.d.ts.map +1 -1
- package/dist/components/charts/heat-calendar.js +2 -3
- package/dist/components/charts/liquidity-heatmap.d.ts +0 -4
- package/dist/components/charts/liquidity-heatmap.d.ts.map +1 -1
- package/dist/components/charts/liquidity-heatmap.js +8 -10
- package/dist/components/charts/liquidity-heatmap.js.map +1 -1
- package/dist/components/charts/order-book/depth-row.d.ts +1 -3
- package/dist/components/charts/order-book/depth-row.d.ts.map +1 -1
- package/dist/components/charts/order-book/depth-row.js +4 -5
- package/dist/components/charts/order-book/depth-row.js.map +1 -1
- package/dist/components/charts/order-book.d.ts +1 -3
- package/dist/components/charts/order-book.d.ts.map +1 -1
- package/dist/components/charts/order-book.js +10 -12
- package/dist/components/charts/order-book.js.map +1 -1
- package/dist/components/charts/price-target-fan/header.d.ts +0 -2
- package/dist/components/charts/price-target-fan/header.d.ts.map +1 -1
- package/dist/components/charts/price-target-fan/header.js +4 -5
- package/dist/components/charts/price-target-fan/header.js.map +1 -1
- package/dist/components/charts/price-target-fan/plot.d.ts +0 -2
- package/dist/components/charts/price-target-fan/plot.d.ts.map +1 -1
- package/dist/components/charts/price-target-fan/plot.js +2 -3
- package/dist/components/charts/price-target-fan/series.d.ts +0 -2
- package/dist/components/charts/price-target-fan/series.d.ts.map +1 -1
- package/dist/components/charts/price-target-fan/series.js +2 -3
- package/dist/components/charts/price-target-fan/tooltip.d.ts +1 -1
- package/dist/components/charts/price-target-fan/tooltip.js +8 -9
- package/dist/components/charts/price-target-fan/tooltip.js.map +1 -1
- package/dist/components/charts/price-target-fan.d.ts +1 -3
- package/dist/components/charts/price-target-fan.d.ts.map +1 -1
- package/dist/components/charts/price-target-fan.js +2 -3
- package/dist/components/charts/returns-calendar/grid.d.ts +0 -2
- package/dist/components/charts/returns-calendar/grid.d.ts.map +1 -1
- package/dist/components/charts/returns-calendar/grid.js +6 -7
- package/dist/components/charts/returns-calendar/grid.js.map +1 -1
- package/dist/components/charts/returns-calendar/tooltip.d.ts +1 -1
- package/dist/components/charts/returns-calendar/tooltip.js +3 -4
- package/dist/components/charts/returns-calendar.d.ts +1 -5
- package/dist/components/charts/returns-calendar.d.ts.map +1 -1
- package/dist/components/charts/returns-calendar.js +2 -3
- package/dist/components/charts/status-bar/legend.d.ts +0 -2
- package/dist/components/charts/status-bar/legend.d.ts.map +1 -1
- package/dist/components/charts/status-bar/legend.js +3 -4
- package/dist/components/charts/status-bar/legend.js.map +1 -1
- package/dist/components/charts/status-bar/plot.d.ts +0 -2
- package/dist/components/charts/status-bar/plot.d.ts.map +1 -1
- package/dist/components/charts/status-bar/plot.js +6 -7
- package/dist/components/charts/status-bar/plot.js.map +1 -1
- package/dist/components/charts/status-bar/tooltip.d.ts +1 -1
- package/dist/components/charts/status-bar/tooltip.js +3 -4
- package/dist/components/charts/status-bar.d.ts +1 -3
- package/dist/components/charts/status-bar.d.ts.map +1 -1
- package/dist/components/charts/status-bar.js +2 -3
- package/dist/components/charts/treemap/legend.d.ts +0 -2
- package/dist/components/charts/treemap/legend.d.ts.map +1 -1
- package/dist/components/charts/treemap/legend.js +2 -3
- package/dist/components/charts/treemap/plot.d.ts +1 -3
- package/dist/components/charts/treemap/plot.d.ts.map +1 -1
- package/dist/components/charts/treemap/plot.js +4 -5
- package/dist/components/charts/treemap/plot.js.map +1 -1
- package/dist/components/charts/treemap/tile.d.ts +1 -3
- package/dist/components/charts/treemap/tile.d.ts.map +1 -1
- package/dist/components/charts/treemap/tile.js +4 -5
- package/dist/components/charts/treemap/tile.js.map +1 -1
- package/dist/components/charts/treemap/tooltip.d.ts +1 -3
- package/dist/components/charts/treemap/tooltip.d.ts.map +1 -1
- package/dist/components/charts/treemap/tooltip.js +3 -4
- package/dist/components/charts/treemap.d.ts +1 -5
- package/dist/components/charts/treemap.d.ts.map +1 -1
- package/dist/components/charts/treemap.js +2 -3
- package/dist/components/charts/volume-profile/plot.d.ts +0 -2
- package/dist/components/charts/volume-profile/plot.d.ts.map +1 -1
- package/dist/components/charts/volume-profile/plot.js +9 -10
- package/dist/components/charts/volume-profile/plot.js.map +1 -1
- package/dist/components/charts/volume-profile/summary.d.ts +0 -2
- package/dist/components/charts/volume-profile/summary.d.ts.map +1 -1
- package/dist/components/charts/volume-profile/summary.js +8 -9
- package/dist/components/charts/volume-profile/summary.js.map +1 -1
- package/dist/components/charts/volume-profile/tooltip.d.ts +1 -1
- package/dist/components/charts/volume-profile/tooltip.js +4 -5
- package/dist/components/charts/volume-profile/tooltip.js.map +1 -1
- package/dist/components/charts/volume-profile.d.ts +1 -5
- package/dist/components/charts/volume-profile.d.ts.map +1 -1
- package/dist/components/charts/volume-profile.js +2 -3
- package/dist/components/custom/confirm-dialog.d.ts +0 -2
- package/dist/components/custom/confirm-dialog.d.ts.map +1 -1
- package/dist/components/custom/confirm-dialog.js +7 -8
- package/dist/components/custom/confirm-dialog.js.map +1 -1
- package/dist/components/custom/toast.d.ts +0 -2
- package/dist/components/custom/toast.d.ts.map +1 -1
- package/dist/components/custom/toast.js +1 -2
- package/dist/components/motion/action-swap-blur.d.ts +0 -2
- package/dist/components/motion/action-swap-blur.d.ts.map +1 -1
- package/dist/components/motion/action-swap-blur.js +1 -2
- package/dist/components/motion/action-swap-cascade.d.ts +0 -2
- package/dist/components/motion/action-swap-cascade.d.ts.map +1 -1
- package/dist/components/motion/action-swap-cascade.js +1 -2
- package/dist/components/motion/action-swap-roll.d.ts +0 -2
- package/dist/components/motion/action-swap-roll.d.ts.map +1 -1
- package/dist/components/motion/action-swap-roll.js +1 -2
- package/dist/components/motion/action-swap.d.ts +0 -2
- package/dist/components/motion/action-swap.d.ts.map +1 -1
- package/dist/components/motion/action-swap.js +3 -4
- package/dist/components/motion/action-swap.js.map +1 -1
- package/dist/components/motion/adaptive-stepper.d.ts +0 -2
- package/dist/components/motion/adaptive-stepper.d.ts.map +1 -1
- package/dist/components/motion/adaptive-stepper.js +4 -6
- package/dist/components/motion/adaptive-stepper.js.map +1 -1
- package/dist/components/motion/alert.d.ts +0 -2
- package/dist/components/motion/alert.d.ts.map +1 -1
- package/dist/components/motion/alert.js +5 -6
- package/dist/components/motion/alert.js.map +1 -1
- package/dist/components/motion/animated-badge.d.ts +0 -2
- package/dist/components/motion/animated-badge.d.ts.map +1 -1
- package/dist/components/motion/animated-badge.js +2 -3
- package/dist/components/motion/animated-badge.js.map +1 -1
- package/dist/components/motion/animated-number.d.ts +0 -2
- package/dist/components/motion/animated-number.d.ts.map +1 -1
- package/dist/components/motion/animated-number.js +1 -2
- package/dist/components/motion/animated-sidebar.d.ts +0 -2
- package/dist/components/motion/animated-sidebar.d.ts.map +1 -1
- package/dist/components/motion/animated-sidebar.js +16 -17
- package/dist/components/motion/animated-sidebar.js.map +1 -1
- package/dist/components/motion/animated-toast-stack.d.ts +0 -2
- package/dist/components/motion/animated-toast-stack.d.ts.map +1 -1
- package/dist/components/motion/animated-toast-stack.js +7 -8
- package/dist/components/motion/animated-toast-stack.js.map +1 -1
- package/dist/components/motion/arc-picker.d.ts +0 -2
- package/dist/components/motion/arc-picker.d.ts.map +1 -1
- package/dist/components/motion/arc-picker.js +5 -6
- package/dist/components/motion/arc-picker.js.map +1 -1
- package/dist/components/motion/aspect-ratio.d.ts +0 -2
- package/dist/components/motion/aspect-ratio.d.ts.map +1 -1
- package/dist/components/motion/aspect-ratio.js +1 -2
- package/dist/components/motion/attachment-upload.d.ts +0 -2
- package/dist/components/motion/attachment-upload.d.ts.map +1 -1
- package/dist/components/motion/attachment-upload.js +29 -30
- package/dist/components/motion/attachment-upload.js.map +1 -1
- package/dist/components/motion/availability-scheduler/copy-menu.d.ts +1 -3
- package/dist/components/motion/availability-scheduler/copy-menu.d.ts.map +1 -1
- package/dist/components/motion/availability-scheduler/copy-menu.js +1 -1
- package/dist/components/motion/availability-scheduler/day-row.d.ts +1 -3
- package/dist/components/motion/availability-scheduler/day-row.d.ts.map +1 -1
- package/dist/components/motion/availability-scheduler/day-row.js +5 -6
- package/dist/components/motion/availability-scheduler/day-row.js.map +1 -1
- package/dist/components/motion/availability-scheduler/icon-button.d.ts +0 -2
- package/dist/components/motion/availability-scheduler/icon-button.d.ts.map +1 -1
- package/dist/components/motion/availability-scheduler/icon-button.js +2 -3
- package/dist/components/motion/availability-scheduler/icon-button.js.map +1 -1
- package/dist/components/motion/availability-scheduler/index.d.ts +1 -3
- package/dist/components/motion/availability-scheduler/index.d.ts.map +1 -1
- package/dist/components/motion/availability-scheduler/index.js +3 -4
- package/dist/components/motion/availability-scheduler/index.js.map +1 -1
- package/dist/components/motion/availability-scheduler/time-select.d.ts +1 -3
- package/dist/components/motion/availability-scheduler/time-select.d.ts.map +1 -1
- package/dist/components/motion/availability-scheduler/time-select.js +1 -2
- package/dist/components/motion/bloom-menu.d.ts +0 -2
- package/dist/components/motion/bloom-menu.d.ts.map +1 -1
- package/dist/components/motion/bloom-menu.js +8 -9
- package/dist/components/motion/bloom-menu.js.map +1 -1
- package/dist/components/motion/bottom-sheet.d.ts +0 -2
- package/dist/components/motion/bottom-sheet.d.ts.map +1 -1
- package/dist/components/motion/bottom-sheet.js +7 -8
- package/dist/components/motion/bottom-sheet.js.map +1 -1
- package/dist/components/motion/bounce-sidebar.d.ts +0 -2
- package/dist/components/motion/bounce-sidebar.d.ts.map +1 -1
- package/dist/components/motion/bounce-sidebar.js +3 -4
- package/dist/components/motion/bounce-sidebar.js.map +1 -1
- package/dist/components/motion/bouncy-accordion.d.ts +0 -2
- package/dist/components/motion/bouncy-accordion.d.ts.map +1 -1
- package/dist/components/motion/bouncy-accordion.js +7 -8
- package/dist/components/motion/bouncy-accordion.js.map +1 -1
- package/dist/components/motion/breadcrumb.d.ts +0 -2
- package/dist/components/motion/breadcrumb.d.ts.map +1 -1
- package/dist/components/motion/breadcrumb.js +7 -8
- package/dist/components/motion/breadcrumb.js.map +1 -1
- package/dist/components/motion/button/base.d.ts +0 -2
- package/dist/components/motion/button/base.d.ts.map +1 -1
- package/dist/components/motion/button/base.js +3 -4
- package/dist/components/motion/button/base.js.map +1 -1
- package/dist/components/motion/button/magnetic.d.ts +0 -2
- package/dist/components/motion/button/magnetic.d.ts.map +1 -1
- package/dist/components/motion/button/magnetic.js +1 -2
- package/dist/components/motion/button/metallic.d.ts +0 -2
- package/dist/components/motion/button/metallic.d.ts.map +1 -1
- package/dist/components/motion/button/metallic.js +3 -4
- package/dist/components/motion/button/metallic.js.map +1 -1
- package/dist/components/motion/button/stateful.d.ts +0 -2
- package/dist/components/motion/button/stateful.d.ts.map +1 -1
- package/dist/components/motion/button/stateful.js +2 -3
- package/dist/components/motion/button/stateful.js.map +1 -1
- package/dist/components/motion/card-folder.d.ts +0 -2
- package/dist/components/motion/card-folder.d.ts.map +1 -1
- package/dist/components/motion/card-folder.js +14 -15
- package/dist/components/motion/card-folder.js.map +1 -1
- package/dist/components/motion/card.d.ts +0 -2
- package/dist/components/motion/card.d.ts.map +1 -1
- package/dist/components/motion/card.js +3 -4
- package/dist/components/motion/card.js.map +1 -1
- package/dist/components/motion/center-morph-modal.d.ts +0 -2
- package/dist/components/motion/center-morph-modal.d.ts.map +1 -1
- package/dist/components/motion/center-morph-modal.js +6 -7
- package/dist/components/motion/center-morph-modal.js.map +1 -1
- package/dist/components/motion/checkbox.d.ts +0 -2
- package/dist/components/motion/checkbox.d.ts.map +1 -1
- package/dist/components/motion/checkbox.js +3 -4
- package/dist/components/motion/checkbox.js.map +1 -1
- package/dist/components/motion/chromatic-text-reveal.d.ts +0 -2
- package/dist/components/motion/chromatic-text-reveal.d.ts.map +1 -1
- package/dist/components/motion/chromatic-text-reveal.js +2 -3
- package/dist/components/motion/chromatic-text-reveal.js.map +1 -1
- package/dist/components/motion/collapsible.d.ts +0 -2
- package/dist/components/motion/collapsible.d.ts.map +1 -1
- package/dist/components/motion/collapsible.js +3 -4
- package/dist/components/motion/collapsible.js.map +1 -1
- package/dist/components/motion/color-picker.d.ts +0 -2
- package/dist/components/motion/color-picker.d.ts.map +1 -1
- package/dist/components/motion/color-picker.js +13 -14
- package/dist/components/motion/color-picker.js.map +1 -1
- package/dist/components/motion/color-selector.d.ts +0 -2
- package/dist/components/motion/color-selector.d.ts.map +1 -1
- package/dist/components/motion/color-selector.js +3 -4
- package/dist/components/motion/color-selector.js.map +1 -1
- package/dist/components/motion/combobox/content.d.ts +0 -2
- package/dist/components/motion/combobox/content.d.ts.map +1 -1
- package/dist/components/motion/combobox/content.js +3 -4
- package/dist/components/motion/combobox/content.js.map +1 -1
- package/dist/components/motion/combobox/context.d.ts +0 -2
- package/dist/components/motion/combobox/context.d.ts.map +1 -1
- package/dist/components/motion/combobox/context.js +2 -3
- package/dist/components/motion/combobox/list.d.ts +0 -2
- package/dist/components/motion/combobox/list.d.ts.map +1 -1
- package/dist/components/motion/combobox/list.js +8 -9
- package/dist/components/motion/combobox/list.js.map +1 -1
- package/dist/components/motion/combobox/trigger.d.ts +0 -2
- package/dist/components/motion/combobox/trigger.d.ts.map +1 -1
- package/dist/components/motion/combobox/trigger.js +5 -6
- package/dist/components/motion/combobox/trigger.js.map +1 -1
- package/dist/components/motion/command-palette.d.ts +0 -2
- package/dist/components/motion/command-palette.d.ts.map +1 -1
- package/dist/components/motion/command-palette.js +14 -15
- package/dist/components/motion/command-palette.js.map +1 -1
- package/dist/components/motion/context-menu.d.ts +0 -2
- package/dist/components/motion/context-menu.d.ts.map +1 -1
- package/dist/components/motion/context-menu.js +8 -9
- package/dist/components/motion/context-menu.js.map +1 -1
- package/dist/components/motion/cylinder-carousel.d.ts +0 -2
- package/dist/components/motion/cylinder-carousel.d.ts.map +1 -1
- package/dist/components/motion/cylinder-carousel.js +2 -3
- package/dist/components/motion/cylinder-carousel.js.map +1 -1
- package/dist/components/motion/date-range-picker.d.ts +0 -4
- package/dist/components/motion/date-range-picker.d.ts.map +1 -1
- package/dist/components/motion/date-range-picker.js +22 -26
- package/dist/components/motion/date-range-picker.js.map +1 -1
- package/dist/components/motion/digit-swap.d.ts +0 -2
- package/dist/components/motion/digit-swap.d.ts.map +1 -1
- package/dist/components/motion/digit-swap.js +1 -2
- package/dist/components/motion/dock.d.ts +0 -2
- package/dist/components/motion/dock.d.ts.map +1 -1
- package/dist/components/motion/dock.js +6 -7
- package/dist/components/motion/dock.js.map +1 -1
- package/dist/components/motion/drawer.d.ts +0 -2
- package/dist/components/motion/drawer.d.ts.map +1 -1
- package/dist/components/motion/drawer.js +3 -4
- package/dist/components/motion/drawer.js.map +1 -1
- package/dist/components/motion/dynamic-island.d.ts +0 -2
- package/dist/components/motion/dynamic-island.d.ts.map +1 -1
- package/dist/components/motion/dynamic-island.js +2 -3
- package/dist/components/motion/dynamic-island.js.map +1 -1
- package/dist/components/motion/expandable-action-bar.d.ts +0 -2
- package/dist/components/motion/expandable-action-bar.d.ts.map +1 -1
- package/dist/components/motion/expandable-action-bar.js +6 -7
- package/dist/components/motion/expandable-action-bar.js.map +1 -1
- package/dist/components/motion/expandable-control.d.ts +0 -2
- package/dist/components/motion/expandable-control.d.ts.map +1 -1
- package/dist/components/motion/expandable-control.js +6 -7
- package/dist/components/motion/expandable-control.js.map +1 -1
- package/dist/components/motion/expandable-tabs.d.ts +0 -2
- package/dist/components/motion/expandable-tabs.d.ts.map +1 -1
- package/dist/components/motion/expandable-tabs.js +5 -6
- package/dist/components/motion/expandable-tabs.js.map +1 -1
- package/dist/components/motion/expanding-arrow-button.d.ts +0 -2
- package/dist/components/motion/expanding-arrow-button.d.ts.map +1 -1
- package/dist/components/motion/expanding-arrow-button.js +3 -4
- package/dist/components/motion/expanding-arrow-button.js.map +1 -1
- package/dist/components/motion/feedback-widget.d.ts +0 -2
- package/dist/components/motion/feedback-widget.d.ts.map +1 -1
- package/dist/components/motion/feedback-widget.js +15 -16
- package/dist/components/motion/feedback-widget.js.map +1 -1
- package/dist/components/motion/file-tree.d.ts +0 -2
- package/dist/components/motion/file-tree.d.ts.map +1 -1
- package/dist/components/motion/file-tree.js +4 -5
- package/dist/components/motion/file-tree.js.map +1 -1
- package/dist/components/motion/file-upload.d.ts +0 -2
- package/dist/components/motion/file-upload.d.ts.map +1 -1
- package/dist/components/motion/file-upload.js +13 -14
- package/dist/components/motion/file-upload.js.map +1 -1
- package/dist/components/motion/hold-action-button.d.ts +0 -2
- package/dist/components/motion/hold-action-button.d.ts.map +1 -1
- package/dist/components/motion/hold-action-button.js +3 -4
- package/dist/components/motion/hold-action-button.js.map +1 -1
- package/dist/components/motion/infinite-masonry.d.ts +0 -2
- package/dist/components/motion/infinite-masonry.d.ts.map +1 -1
- package/dist/components/motion/infinite-masonry.js +16 -17
- package/dist/components/motion/infinite-masonry.js.map +1 -1
- package/dist/components/motion/input.d.ts +0 -2
- package/dist/components/motion/input.d.ts.map +1 -1
- package/dist/components/motion/input.js +7 -8
- package/dist/components/motion/input.js.map +1 -1
- package/dist/components/motion/knockout-bracket.d.ts +0 -2
- package/dist/components/motion/knockout-bracket.d.ts.map +1 -1
- package/dist/components/motion/knockout-bracket.js +17 -18
- package/dist/components/motion/knockout-bracket.js.map +1 -1
- package/dist/components/motion/knockout-wheel.d.ts +0 -2
- package/dist/components/motion/knockout-wheel.d.ts.map +1 -1
- package/dist/components/motion/knockout-wheel.js +7 -8
- package/dist/components/motion/knockout-wheel.js.map +1 -1
- package/dist/components/motion/liquid.d.ts +0 -2
- package/dist/components/motion/liquid.d.ts.map +1 -1
- package/dist/components/motion/liquid.js +1 -2
- package/dist/components/motion/loader.d.ts +0 -2
- package/dist/components/motion/loader.d.ts.map +1 -1
- package/dist/components/motion/loader.js +5 -6
- package/dist/components/motion/loader.js.map +1 -1
- package/dist/components/motion/magnetic.d.ts +0 -2
- package/dist/components/motion/magnetic.d.ts.map +1 -1
- package/dist/components/motion/magnetic.js +1 -2
- package/dist/components/motion/marquee.d.ts +0 -2
- package/dist/components/motion/marquee.d.ts.map +1 -1
- package/dist/components/motion/marquee.js +1 -2
- package/dist/components/motion/morphing-lightbox.d.ts +0 -2
- package/dist/components/motion/morphing-lightbox.d.ts.map +1 -1
- package/dist/components/motion/morphing-lightbox.js +5 -6
- package/dist/components/motion/morphing-lightbox.js.map +1 -1
- package/dist/components/motion/morphing-modal.d.ts +0 -2
- package/dist/components/motion/morphing-modal.d.ts.map +1 -1
- package/dist/components/motion/morphing-modal.js +4 -5
- package/dist/components/motion/morphing-modal.js.map +1 -1
- package/dist/components/motion/morphing-search-chips.d.ts +0 -2
- package/dist/components/motion/morphing-search-chips.d.ts.map +1 -1
- package/dist/components/motion/morphing-search-chips.js +17 -18
- package/dist/components/motion/morphing-search-chips.js.map +1 -1
- package/dist/components/motion/morphing-search.d.ts +0 -2
- package/dist/components/motion/morphing-search.d.ts.map +1 -1
- package/dist/components/motion/morphing-search.js +17 -18
- package/dist/components/motion/morphing-search.js.map +1 -1
- package/dist/components/motion/morphing-tabs.d.ts +0 -2
- package/dist/components/motion/morphing-tabs.d.ts.map +1 -1
- package/dist/components/motion/morphing-tabs.js +6 -7
- package/dist/components/motion/morphing-tabs.js.map +1 -1
- package/dist/components/motion/multi-select/content.d.ts +0 -2
- package/dist/components/motion/multi-select/content.d.ts.map +1 -1
- package/dist/components/motion/multi-select/content.js +3 -4
- package/dist/components/motion/multi-select/content.js.map +1 -1
- package/dist/components/motion/multi-select/context.d.ts +0 -2
- package/dist/components/motion/multi-select/context.d.ts.map +1 -1
- package/dist/components/motion/multi-select/context.js +2 -3
- package/dist/components/motion/multi-select/list.d.ts +0 -2
- package/dist/components/motion/multi-select/list.d.ts.map +1 -1
- package/dist/components/motion/multi-select/list.js +8 -9
- package/dist/components/motion/multi-select/list.js.map +1 -1
- package/dist/components/motion/multi-select/trigger.d.ts +0 -2
- package/dist/components/motion/multi-select/trigger.d.ts.map +1 -1
- package/dist/components/motion/multi-select/trigger.js +7 -8
- package/dist/components/motion/multi-select/trigger.js.map +1 -1
- package/dist/components/motion/not-found/glitch.d.ts +0 -2
- package/dist/components/motion/not-found/glitch.d.ts.map +1 -1
- package/dist/components/motion/not-found/glitch.js +4 -5
- package/dist/components/motion/not-found/glitch.js.map +1 -1
- package/dist/components/motion/not-found/magnetic.d.ts +0 -2
- package/dist/components/motion/not-found/magnetic.d.ts.map +1 -1
- package/dist/components/motion/not-found/magnetic.js +4 -5
- package/dist/components/motion/not-found/magnetic.js.map +1 -1
- package/dist/components/motion/not-found/shared.d.ts +0 -2
- package/dist/components/motion/not-found/shared.d.ts.map +1 -1
- package/dist/components/motion/not-found/shared.js +3 -4
- package/dist/components/motion/not-found/shared.js.map +1 -1
- package/dist/components/motion/not-found/spotlight.d.ts +0 -2
- package/dist/components/motion/not-found/spotlight.d.ts.map +1 -1
- package/dist/components/motion/not-found/spotlight.js +6 -7
- package/dist/components/motion/not-found/spotlight.js.map +1 -1
- package/dist/components/motion/not-found/stacked.d.ts +0 -2
- package/dist/components/motion/not-found/stacked.d.ts.map +1 -1
- package/dist/components/motion/not-found/stacked.js +6 -7
- package/dist/components/motion/not-found/stacked.js.map +1 -1
- package/dist/components/motion/not-found/terminal.d.ts +0 -2
- package/dist/components/motion/not-found/terminal.d.ts.map +1 -1
- package/dist/components/motion/not-found/terminal.js +6 -7
- package/dist/components/motion/not-found/terminal.js.map +1 -1
- package/dist/components/motion/notification-stack.d.ts +0 -2
- package/dist/components/motion/notification-stack.d.ts.map +1 -1
- package/dist/components/motion/notification-stack.js +8 -9
- package/dist/components/motion/notification-stack.js.map +1 -1
- package/dist/components/motion/number-ticker.d.ts +0 -2
- package/dist/components/motion/number-ticker.d.ts.map +1 -1
- package/dist/components/motion/number-ticker.js +1 -2
- package/dist/components/motion/otp-input.d.ts +0 -2
- package/dist/components/motion/otp-input.d.ts.map +1 -1
- package/dist/components/motion/otp-input.js +4 -5
- package/dist/components/motion/otp-input.js.map +1 -1
- package/dist/components/motion/overflow-actions.d.ts +0 -2
- package/dist/components/motion/overflow-actions.d.ts.map +1 -1
- package/dist/components/motion/overflow-actions.js +4 -5
- package/dist/components/motion/overflow-actions.js.map +1 -1
- package/dist/components/motion/parallax.d.ts +0 -2
- package/dist/components/motion/parallax.d.ts.map +1 -1
- package/dist/components/motion/parallax.js +1 -2
- package/dist/components/motion/popover-morph.d.ts +0 -2
- package/dist/components/motion/popover-morph.d.ts.map +1 -1
- package/dist/components/motion/popover-morph.js +3 -4
- package/dist/components/motion/popover-morph.js.map +1 -1
- package/dist/components/motion/popover.d.ts +0 -2
- package/dist/components/motion/popover.d.ts.map +1 -1
- package/dist/components/motion/popover.js +5 -6
- package/dist/components/motion/popover.js.map +1 -1
- package/dist/components/motion/prediction-market-card.d.ts +0 -2
- package/dist/components/motion/prediction-market-card.d.ts.map +1 -1
- package/dist/components/motion/prediction-market-card.js +14 -15
- package/dist/components/motion/prediction-market-card.js.map +1 -1
- package/dist/components/motion/prediction-market.d.ts +0 -2
- package/dist/components/motion/prediction-market.d.ts.map +1 -1
- package/dist/components/motion/prediction-market.js +18 -19
- package/dist/components/motion/prediction-market.js.map +1 -1
- package/dist/components/motion/preview-rail.d.ts +0 -2
- package/dist/components/motion/preview-rail.d.ts.map +1 -1
- package/dist/components/motion/preview-rail.js +5 -6
- package/dist/components/motion/preview-rail.js.map +1 -1
- package/dist/components/motion/project-folder.d.ts +0 -2
- package/dist/components/motion/project-folder.d.ts.map +1 -1
- package/dist/components/motion/project-folder.js +15 -16
- package/dist/components/motion/project-folder.js.map +1 -1
- package/dist/components/motion/pull-to-refresh.d.ts +0 -2
- package/dist/components/motion/pull-to-refresh.d.ts.map +1 -1
- package/dist/components/motion/pull-to-refresh.js +3 -4
- package/dist/components/motion/pull-to-refresh.js.map +1 -1
- package/dist/components/motion/radio.d.ts +0 -2
- package/dist/components/motion/radio.d.ts.map +1 -1
- package/dist/components/motion/radio.js +4 -5
- package/dist/components/motion/radio.js.map +1 -1
- package/dist/components/motion/range-slider-bubble.d.ts +0 -2
- package/dist/components/motion/range-slider-bubble.d.ts.map +1 -1
- package/dist/components/motion/range-slider-bubble.js +7 -8
- package/dist/components/motion/range-slider-bubble.js.map +1 -1
- package/dist/components/motion/range-slider-fluid.d.ts +0 -2
- package/dist/components/motion/range-slider-fluid.d.ts.map +1 -1
- package/dist/components/motion/range-slider-fluid.js +6 -7
- package/dist/components/motion/range-slider-fluid.js.map +1 -1
- package/dist/components/motion/range-slider-inline.d.ts +0 -2
- package/dist/components/motion/range-slider-inline.d.ts.map +1 -1
- package/dist/components/motion/range-slider-inline.js +9 -10
- package/dist/components/motion/range-slider-inline.js.map +1 -1
- package/dist/components/motion/range-slider-ruler.d.ts +0 -2
- package/dist/components/motion/range-slider-ruler.d.ts.map +1 -1
- package/dist/components/motion/range-slider-ruler.js +7 -8
- package/dist/components/motion/range-slider-ruler.js.map +1 -1
- package/dist/components/motion/range-slider-wave.d.ts +0 -2
- package/dist/components/motion/range-slider-wave.d.ts.map +1 -1
- package/dist/components/motion/range-slider-wave.js +2 -3
- package/dist/components/motion/range-slider-wave.js.map +1 -1
- package/dist/components/motion/range-slider.d.ts +0 -2
- package/dist/components/motion/range-slider.d.ts.map +1 -1
- package/dist/components/motion/range-slider.js +5 -6
- package/dist/components/motion/range-slider.js.map +1 -1
- package/dist/components/motion/scroll-progress.d.ts +0 -2
- package/dist/components/motion/scroll-progress.d.ts.map +1 -1
- package/dist/components/motion/scroll-progress.js +2 -3
- package/dist/components/motion/scroll-progress.js.map +1 -1
- package/dist/components/motion/scroll-reveal.d.ts +0 -2
- package/dist/components/motion/scroll-reveal.d.ts.map +1 -1
- package/dist/components/motion/scroll-reveal.js +1 -2
- package/dist/components/motion/scroll-to.d.ts +0 -2
- package/dist/components/motion/scroll-to.d.ts.map +1 -1
- package/dist/components/motion/scroll-to.js +1 -2
- package/dist/components/motion/select-morph.d.ts +0 -2
- package/dist/components/motion/select-morph.d.ts.map +1 -1
- package/dist/components/motion/select-morph.js +6 -7
- package/dist/components/motion/select-morph.js.map +1 -1
- package/dist/components/motion/select.d.ts +0 -2
- package/dist/components/motion/select.d.ts.map +1 -1
- package/dist/components/motion/select.js +4 -5
- package/dist/components/motion/select.js.map +1 -1
- package/dist/components/motion/shader-background.d.ts +0 -2
- package/dist/components/motion/shader-background.d.ts.map +1 -1
- package/dist/components/motion/shader-background.js +1 -2
- package/dist/components/motion/shared-layout-bg.d.ts +0 -2
- package/dist/components/motion/shared-layout-bg.d.ts.map +1 -1
- package/dist/components/motion/shared-layout-bg.js +2 -3
- package/dist/components/motion/shared-layout-bg.js.map +1 -1
- package/dist/components/motion/signup-form.d.ts +0 -2
- package/dist/components/motion/signup-form.d.ts.map +1 -1
- package/dist/components/motion/signup-form.js +8 -9
- package/dist/components/motion/signup-form.js.map +1 -1
- package/dist/components/motion/slide-action-button.d.ts +0 -2
- package/dist/components/motion/slide-action-button.d.ts.map +1 -1
- package/dist/components/motion/slide-action-button.js +6 -7
- package/dist/components/motion/slide-action-button.js.map +1 -1
- package/dist/components/motion/smooth-scroll.d.ts +0 -2
- package/dist/components/motion/smooth-scroll.d.ts.map +1 -1
- package/dist/components/motion/smooth-scroll.js +1 -2
- package/dist/components/motion/sortable-list.d.ts +0 -2
- package/dist/components/motion/sortable-list.d.ts.map +1 -1
- package/dist/components/motion/sortable-list.js +4 -5
- package/dist/components/motion/sortable-list.js.map +1 -1
- package/dist/components/motion/swap/controls.d.ts +1 -3
- package/dist/components/motion/swap/controls.d.ts.map +1 -1
- package/dist/components/motion/swap/controls.js +9 -10
- package/dist/components/motion/swap/controls.js.map +1 -1
- package/dist/components/motion/swap/field.d.ts +1 -3
- package/dist/components/motion/swap/field.d.ts.map +1 -1
- package/dist/components/motion/swap/field.js +12 -13
- package/dist/components/motion/swap/field.js.map +1 -1
- package/dist/components/motion/swap/quote-row.d.ts +1 -3
- package/dist/components/motion/swap/quote-row.d.ts.map +1 -1
- package/dist/components/motion/swap/quote-row.js +8 -9
- package/dist/components/motion/swap/quote-row.js.map +1 -1
- package/dist/components/motion/swap/token-badges.d.ts +1 -3
- package/dist/components/motion/swap/token-badges.d.ts.map +1 -1
- package/dist/components/motion/swap/token-badges.js +5 -6
- package/dist/components/motion/swap/token-badges.js.map +1 -1
- package/dist/components/motion/swap/token-picker.d.ts +1 -3
- package/dist/components/motion/swap/token-picker.d.ts.map +1 -1
- package/dist/components/motion/swap/token-picker.js +18 -19
- package/dist/components/motion/swap/token-picker.js.map +1 -1
- package/dist/components/motion/swap.d.ts +2 -4
- package/dist/components/motion/swap.d.ts.map +1 -1
- package/dist/components/motion/swap.js +7 -9
- package/dist/components/motion/swap.js.map +1 -1
- package/dist/components/motion/swipeable-list.d.ts +0 -2
- package/dist/components/motion/swipeable-list.d.ts.map +1 -1
- package/dist/components/motion/swipeable-list.js +9 -10
- package/dist/components/motion/swipeable-list.js.map +1 -1
- package/dist/components/motion/switch.d.ts +0 -2
- package/dist/components/motion/switch.d.ts.map +1 -1
- package/dist/components/motion/switch.js +4 -5
- package/dist/components/motion/switch.js.map +1 -1
- package/dist/components/motion/table/editable-cell.d.ts +0 -2
- package/dist/components/motion/table/editable-cell.d.ts.map +1 -1
- package/dist/components/motion/table/editable-cell.js +2 -3
- package/dist/components/motion/table/editable-cell.js.map +1 -1
- package/dist/components/motion/table/index.d.ts +1 -3
- package/dist/components/motion/table/index.d.ts.map +1 -1
- package/dist/components/motion/table/index.js +9 -14
- package/dist/components/motion/table/index.js.map +1 -1
- package/dist/components/motion/table/row-handle.d.ts +0 -2
- package/dist/components/motion/table/row-handle.d.ts.map +1 -1
- package/dist/components/motion/table/row-handle.js +2 -3
- package/dist/components/motion/table/skeleton-rows.d.ts +1 -3
- package/dist/components/motion/table/skeleton-rows.d.ts.map +1 -1
- package/dist/components/motion/table/skeleton-rows.js +3 -4
- package/dist/components/motion/table/skeleton-rows.js.map +1 -1
- package/dist/components/motion/table/table-header.d.ts +1 -3
- package/dist/components/motion/table/table-header.d.ts.map +1 -1
- package/dist/components/motion/table/table-header.js +10 -11
- package/dist/components/motion/table/table-header.js.map +1 -1
- package/dist/components/motion/table/table-menu.d.ts +0 -2
- package/dist/components/motion/table/table-menu.d.ts.map +1 -1
- package/dist/components/motion/table/table-menu.js +2 -3
- package/dist/components/motion/table/table-menu.js.map +1 -1
- package/dist/components/motion/tabs.d.ts +0 -2
- package/dist/components/motion/tabs.d.ts.map +1 -1
- package/dist/components/motion/tabs.js +12 -13
- package/dist/components/motion/tabs.js.map +1 -1
- package/dist/components/motion/text-cascade.d.ts +0 -2
- package/dist/components/motion/text-cascade.d.ts.map +1 -1
- package/dist/components/motion/text-cascade.js +1 -2
- package/dist/components/motion/text-reveal.d.ts +0 -2
- package/dist/components/motion/text-reveal.d.ts.map +1 -1
- package/dist/components/motion/text-reveal.js +1 -2
- package/dist/components/motion/text-scramble.d.ts +0 -2
- package/dist/components/motion/text-scramble.d.ts.map +1 -1
- package/dist/components/motion/text-scramble.js +1 -2
- package/dist/components/motion/text-shimmer.d.ts +0 -2
- package/dist/components/motion/text-shimmer.d.ts.map +1 -1
- package/dist/components/motion/text-shimmer.js +1 -2
- package/dist/components/motion/theme-toggle.d.ts +0 -2
- package/dist/components/motion/theme-toggle.d.ts.map +1 -1
- package/dist/components/motion/theme-toggle.js +1 -2
- package/dist/components/motion/tilt-card.d.ts +0 -2
- package/dist/components/motion/tilt-card.d.ts.map +1 -1
- package/dist/components/motion/tilt-card.js +1 -2
- package/dist/components/motion/timeline.d.ts +37 -0
- package/dist/components/motion/timeline.d.ts.map +1 -0
- package/dist/components/motion/timeline.js +483 -0
- package/dist/components/motion/timeline.js.map +1 -0
- package/dist/components/motion/tooltip/positioner.d.ts +1 -3
- package/dist/components/motion/tooltip/positioner.d.ts.map +1 -1
- package/dist/components/motion/tooltip/positioner.js +1 -1
- package/dist/components/motion/tooltip-surface.d.ts +0 -2
- package/dist/components/motion/tooltip-surface.d.ts.map +1 -1
- package/dist/components/motion/tooltip-surface.js +2 -3
- package/dist/components/motion/tooltip-surface.js.map +1 -1
- package/dist/components/motion/tooltip.d.ts +1 -3
- package/dist/components/motion/tooltip.d.ts.map +1 -1
- package/dist/components/motion/tooltip.js +1 -1
- package/dist/components/motion/wallet-card/account-avatar.d.ts +1 -3
- package/dist/components/motion/wallet-card/account-avatar.d.ts.map +1 -1
- package/dist/components/motion/wallet-card/account-avatar.js +1 -1
- package/dist/components/motion/wallet-card/account-switcher.d.ts +1 -3
- package/dist/components/motion/wallet-card/account-switcher.d.ts.map +1 -1
- package/dist/components/motion/wallet-card/account-switcher.js +10 -11
- package/dist/components/motion/wallet-card/account-switcher.js.map +1 -1
- package/dist/components/motion/wallet-card/actions.d.ts +0 -2
- package/dist/components/motion/wallet-card/actions.d.ts.map +1 -1
- package/dist/components/motion/wallet-card/actions.js +3 -4
- package/dist/components/motion/wallet-card/actions.js.map +1 -1
- package/dist/components/motion/wallet-card/balance-delta.d.ts +0 -2
- package/dist/components/motion/wallet-card/balance-delta.d.ts.map +1 -1
- package/dist/components/motion/wallet-card/balance-delta.js +2 -3
- package/dist/components/motion/wallet-card/balance-delta.js.map +1 -1
- package/dist/components/motion/wallet-card/copy-button.d.ts +0 -2
- package/dist/components/motion/wallet-card/copy-button.d.ts.map +1 -1
- package/dist/components/motion/wallet-card/copy-button.js +2 -3
- package/dist/components/motion/wallet-card/copy-button.js.map +1 -1
- package/dist/components/motion/wallet-card/index.d.ts +1 -3
- package/dist/components/motion/wallet-card/index.d.ts.map +1 -1
- package/dist/components/motion/wallet-card/index.js +6 -7
- package/dist/components/motion/wallet-card/index.js.map +1 -1
- package/dist/components/motion/wallet-card/search-bar.d.ts +0 -2
- package/dist/components/motion/wallet-card/search-bar.d.ts.map +1 -1
- package/dist/components/motion/wallet-card/search-bar.js +9 -10
- package/dist/components/motion/wallet-card/search-bar.js.map +1 -1
- package/dist/components/motion/wheel-picker.d.ts +0 -2
- package/dist/components/motion/wheel-picker.d.ts.map +1 -1
- package/dist/components/motion/wheel-picker.js +11 -12
- package/dist/components/motion/wheel-picker.js.map +1 -1
- package/dist/components/reui/alert.d.ts +0 -2
- package/dist/components/reui/alert.d.ts.map +1 -1
- package/dist/components/reui/alert.js +2 -3
- package/dist/components/reui/alert.js.map +1 -1
- package/dist/components/reui/autocomplete.d.ts +0 -2
- package/dist/components/reui/autocomplete.d.ts.map +1 -1
- package/dist/components/reui/autocomplete.js +11 -12
- package/dist/components/reui/autocomplete.js.map +1 -1
- package/dist/components/reui/badge.d.ts +0 -2
- package/dist/components/reui/badge.d.ts.map +1 -1
- package/dist/components/reui/badge.js +5 -6
- package/dist/components/reui/badge.js.map +1 -1
- package/dist/components/reui/cascader/cascader-async.d.ts +1 -3
- package/dist/components/reui/cascader/cascader-async.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-async.js +1 -2
- package/dist/components/reui/cascader/cascader-columns.d.ts +0 -2
- package/dist/components/reui/cascader/cascader-columns.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-columns.js +3 -4
- package/dist/components/reui/cascader/cascader-columns.js.map +1 -1
- package/dist/components/reui/cascader/cascader-context.d.ts +1 -3
- package/dist/components/reui/cascader/cascader-context.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-context.js +1 -2
- package/dist/components/reui/cascader/cascader-footer.d.ts +0 -2
- package/dist/components/reui/cascader/cascader-footer.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-footer.js +6 -7
- package/dist/components/reui/cascader/cascader-footer.js.map +1 -1
- package/dist/components/reui/cascader/cascader-i18n.d.ts +1 -3
- package/dist/components/reui/cascader/cascader-i18n.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-i18n.js +1 -2
- package/dist/components/reui/cascader/cascader-item.d.ts +1 -3
- package/dist/components/reui/cascader/cascader-item.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-item.js +10 -11
- package/dist/components/reui/cascader/cascader-item.js.map +1 -1
- package/dist/components/reui/cascader/cascader-lib.d.ts +1 -3
- package/dist/components/reui/cascader/cascader-lib.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-lib.js +1 -2
- package/dist/components/reui/cascader/cascader-nav.d.ts +1 -3
- package/dist/components/reui/cascader/cascader-nav.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-nav.js +10 -11
- package/dist/components/reui/cascader/cascader-nav.js.map +1 -1
- package/dist/components/reui/cascader/cascader-types.d.ts +1 -1
- package/dist/components/reui/cascader/cascader-virtual.d.ts +0 -2
- package/dist/components/reui/cascader/cascader-virtual.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-virtual.js +1 -2
- package/dist/components/reui/cascader/cascader.d.ts +1 -3
- package/dist/components/reui/cascader/cascader.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader.js +5 -8
- package/dist/components/reui/cascader/cascader.js.map +1 -1
- package/dist/components/reui/code-block/code-block-highlight.d.ts +0 -2
- package/dist/components/reui/code-block/code-block-highlight.d.ts.map +1 -1
- package/dist/components/reui/code-block/code-block-highlight.js +1 -2
- package/dist/components/reui/code-block/code-block.d.ts +0 -2
- package/dist/components/reui/code-block/code-block.d.ts.map +1 -1
- package/dist/components/reui/code-block/code-block.js +13 -14
- package/dist/components/reui/code-block/code-block.js.map +1 -1
- package/dist/components/reui/color-picker.d.ts +0 -2
- package/dist/components/reui/color-picker.d.ts.map +1 -1
- package/dist/components/reui/color-picker.js +5 -6
- package/dist/components/reui/color-picker.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-cell-selection.d.ts +0 -2
- package/dist/components/reui/data-grid/data-grid-cell-selection.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-cell-selection.js +3 -4
- package/dist/components/reui/data-grid/data-grid-cell-selection.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-filter.d.ts +0 -2
- 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 +7 -8
- 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 +0 -2
- 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 +7 -8
- 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 +0 -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 +1 -2
- package/dist/components/reui/data-grid/data-grid-i18n.d.ts +1 -1
- package/dist/components/reui/data-grid/data-grid-i18n.js +1 -2
- package/dist/components/reui/data-grid/data-grid-pagination.d.ts +0 -2
- 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 +0 -2
- 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 +2 -3
- 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 +0 -2
- 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 +4 -5
- 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 +0 -2
- 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 +3 -3
- 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 +0 -2
- 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 +2 -3
- 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 +0 -2
- package/dist/components/reui/data-grid/data-grid-table.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table.js +20 -21
- package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid.d.ts +1 -3
- package/dist/components/reui/data-grid/data-grid.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid.js +2 -3
- package/dist/components/reui/data-grid/data-grid.js.map +1 -1
- package/dist/components/reui/date-selector.d.ts +0 -2
- package/dist/components/reui/date-selector.d.ts.map +1 -1
- package/dist/components/reui/date-selector.js +4 -5
- package/dist/components/reui/date-selector.js.map +1 -1
- package/dist/components/reui/emoji-picker.d.ts +0 -2
- package/dist/components/reui/emoji-picker.d.ts.map +1 -1
- package/dist/components/reui/emoji-picker.js +6 -7
- package/dist/components/reui/emoji-picker.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-agenda-view.d.ts +0 -2
- package/dist/components/reui/event-calendar/event-calendar-agenda-view.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-agenda-view.js +5 -6
- package/dist/components/reui/event-calendar/event-calendar-agenda-view.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-content.d.ts +0 -2
- package/dist/components/reui/event-calendar/event-calendar-content.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-content.js +1 -2
- package/dist/components/reui/event-calendar/event-calendar-dnd.d.ts +0 -2
- package/dist/components/reui/event-calendar/event-calendar-dnd.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-dnd.js +4 -5
- package/dist/components/reui/event-calendar/event-calendar-dnd.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-event.d.ts +0 -2
- package/dist/components/reui/event-calendar/event-calendar-event.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-event.js +7 -8
- package/dist/components/reui/event-calendar/event-calendar-event.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-i18n.d.ts +0 -2
- package/dist/components/reui/event-calendar/event-calendar-i18n.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-i18n.js +1 -2
- package/dist/components/reui/event-calendar/event-calendar-lib.d.ts +3 -2
- package/dist/components/reui/event-calendar/event-calendar-lib.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-lib.js +13 -7
- package/dist/components/reui/event-calendar/event-calendar-lib.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-month-view.d.ts +0 -2
- package/dist/components/reui/event-calendar/event-calendar-month-view.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-month-view.js +10 -11
- package/dist/components/reui/event-calendar/event-calendar-month-view.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-nav.d.ts +0 -2
- package/dist/components/reui/event-calendar/event-calendar-nav.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-nav.js +5 -6
- package/dist/components/reui/event-calendar/event-calendar-nav.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-recurrence.d.ts +0 -2
- package/dist/components/reui/event-calendar/event-calendar-recurrence.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-recurrence.js +1 -2
- package/dist/components/reui/event-calendar/event-calendar-resource-view.d.ts +0 -2
- package/dist/components/reui/event-calendar/event-calendar-resource-view.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-resource-view.js +4 -5
- package/dist/components/reui/event-calendar/event-calendar-resource-view.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-time-grid.d.ts +0 -2
- package/dist/components/reui/event-calendar/event-calendar-time-grid.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-time-grid.js +9 -10
- package/dist/components/reui/event-calendar/event-calendar-time-grid.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-types.d.ts +0 -2
- package/dist/components/reui/event-calendar/event-calendar-types.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar.d.ts +0 -2
- package/dist/components/reui/event-calendar/event-calendar.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar.js +1 -2
- package/dist/components/reui/file-type.d.ts +0 -2
- package/dist/components/reui/file-type.d.ts.map +1 -1
- package/dist/components/reui/file-type.js +7 -8
- package/dist/components/reui/file-type.js.map +1 -1
- package/dist/components/reui/filters/filters-advanced.d.ts +0 -2
- package/dist/components/reui/filters/filters-advanced.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-advanced.js +15 -16
- package/dist/components/reui/filters/filters-advanced.js.map +1 -1
- package/dist/components/reui/filters/filters-builder.d.ts +1 -3
- package/dist/components/reui/filters/filters-builder.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-builder.js +1 -2
- package/dist/components/reui/filters/filters-chip.d.ts +0 -2
- package/dist/components/reui/filters/filters-chip.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-chip.js +6 -7
- package/dist/components/reui/filters/filters-chip.js.map +1 -1
- package/dist/components/reui/filters/filters-context.d.ts +1 -3
- package/dist/components/reui/filters/filters-context.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-context.js +1 -2
- package/dist/components/reui/filters/filters-date.d.ts +0 -2
- package/dist/components/reui/filters/filters-date.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-date.js +1 -2
- package/dist/components/reui/filters/filters-dnd.d.ts +0 -2
- package/dist/components/reui/filters/filters-dnd.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-dnd.js +1 -2
- package/dist/components/reui/filters/filters-draft.d.ts +1 -1
- package/dist/components/reui/filters/filters-draft.js +1 -2
- package/dist/components/reui/filters/filters-editors.d.ts +0 -2
- package/dist/components/reui/filters/filters-editors.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-editors.js +5 -6
- package/dist/components/reui/filters/filters-editors.js.map +1 -1
- package/dist/components/reui/filters/filters-i18n.d.ts +0 -2
- package/dist/components/reui/filters/filters-i18n.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-i18n.js +1 -2
- package/dist/components/reui/filters/filters-lib.d.ts +1 -3
- package/dist/components/reui/filters/filters-lib.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-lib.js +1 -2
- package/dist/components/reui/filters/filters-operators.d.ts +0 -2
- package/dist/components/reui/filters/filters-operators.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-operators.js +1 -2
- package/dist/components/reui/filters/filters-query.d.ts +0 -2
- package/dist/components/reui/filters/filters-query.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-query.js +1 -2
- package/dist/components/reui/filters/filters-types.d.ts +0 -2
- package/dist/components/reui/filters/filters-types.d.ts.map +1 -1
- package/dist/components/reui/filters/filters.d.ts +0 -2
- package/dist/components/reui/filters/filters.d.ts.map +1 -1
- package/dist/components/reui/filters/filters.js +1 -2
- package/dist/components/reui/frame.d.ts +0 -2
- package/dist/components/reui/frame.d.ts.map +1 -1
- package/dist/components/reui/frame.js +5 -6
- package/dist/components/reui/frame.js.map +1 -1
- package/dist/components/reui/gantt/gantt-bar.d.ts +0 -2
- package/dist/components/reui/gantt/gantt-bar.d.ts.map +1 -1
- package/dist/components/reui/gantt/gantt-bar.js +9 -10
- package/dist/components/reui/gantt/gantt-bar.js.map +1 -1
- package/dist/components/reui/gantt/gantt-dnd.d.ts +0 -2
- package/dist/components/reui/gantt/gantt-dnd.d.ts.map +1 -1
- package/dist/components/reui/gantt/gantt-dnd.js +1 -2
- package/dist/components/reui/gantt/gantt-i18n.d.ts +0 -2
- package/dist/components/reui/gantt/gantt-i18n.d.ts.map +1 -1
- package/dist/components/reui/gantt/gantt-i18n.js +1 -2
- package/dist/components/reui/gantt/gantt-lib.d.ts +0 -2
- package/dist/components/reui/gantt/gantt-lib.d.ts.map +1 -1
- package/dist/components/reui/gantt/gantt-lib.js +1 -2
- package/dist/components/reui/gantt/gantt-nav.d.ts +0 -2
- package/dist/components/reui/gantt/gantt-nav.d.ts.map +1 -1
- package/dist/components/reui/gantt/gantt-nav.js +4 -5
- package/dist/components/reui/gantt/gantt-nav.js.map +1 -1
- package/dist/components/reui/gantt/gantt-recurrence.d.ts +0 -2
- package/dist/components/reui/gantt/gantt-recurrence.d.ts.map +1 -1
- package/dist/components/reui/gantt/gantt-recurrence.js +1 -2
- package/dist/components/reui/gantt/gantt-types.d.ts +0 -2
- package/dist/components/reui/gantt/gantt-types.d.ts.map +1 -1
- package/dist/components/reui/gantt/gantt-view.d.ts +0 -2
- package/dist/components/reui/gantt/gantt-view.d.ts.map +1 -1
- package/dist/components/reui/gantt/gantt-view.js +48 -49
- package/dist/components/reui/gantt/gantt-view.js.map +1 -1
- package/dist/components/reui/gantt/gantt.d.ts +0 -2
- package/dist/components/reui/gantt/gantt.d.ts.map +1 -1
- package/dist/components/reui/gantt/gantt.js +2 -3
- package/dist/components/reui/gantt/gantt.js.map +1 -1
- package/dist/components/reui/icon-stack.d.ts +0 -2
- package/dist/components/reui/icon-stack.d.ts.map +1 -1
- package/dist/components/reui/icon-stack.js +3 -4
- package/dist/components/reui/icon-stack.js.map +1 -1
- package/dist/components/reui/icon-tile.d.ts +0 -2
- package/dist/components/reui/icon-tile.d.ts.map +1 -1
- package/dist/components/reui/icon-tile.js +7 -8
- package/dist/components/reui/icon-tile.js.map +1 -1
- package/dist/components/reui/kanban.d.ts +0 -2
- package/dist/components/reui/kanban.d.ts.map +1 -1
- package/dist/components/reui/kanban.js +2 -3
- package/dist/components/reui/kanban.js.map +1 -1
- package/dist/components/reui/number-field.d.ts +0 -2
- package/dist/components/reui/number-field.d.ts.map +1 -1
- package/dist/components/reui/number-field.js +3 -4
- package/dist/components/reui/number-field.js.map +1 -1
- package/dist/components/reui/phone-input.d.ts +0 -2
- package/dist/components/reui/phone-input.d.ts.map +1 -1
- package/dist/components/reui/phone-input.js +3 -4
- package/dist/components/reui/phone-input.js.map +1 -1
- package/dist/components/reui/rating.d.ts +0 -2
- package/dist/components/reui/rating.d.ts.map +1 -1
- package/dist/components/reui/rating.js +2 -3
- package/dist/components/reui/rating.js.map +1 -1
- package/dist/components/reui/scrollspy.d.ts +0 -2
- package/dist/components/reui/scrollspy.d.ts.map +1 -1
- package/dist/components/reui/scrollspy.js +1 -2
- package/dist/components/reui/signature-pad.d.ts +0 -2
- package/dist/components/reui/signature-pad.d.ts.map +1 -1
- package/dist/components/reui/signature-pad.js +4 -5
- package/dist/components/reui/signature-pad.js.map +1 -1
- package/dist/components/reui/sortable.d.ts +0 -2
- package/dist/components/reui/sortable.d.ts.map +1 -1
- package/dist/components/reui/sortable.js +1 -2
- package/dist/components/reui/stepper.d.ts +0 -2
- package/dist/components/reui/stepper.d.ts.map +1 -1
- package/dist/components/reui/stepper.js +6 -7
- package/dist/components/reui/stepper.js.map +1 -1
- package/dist/components/reui/time-picker.d.ts +0 -2
- package/dist/components/reui/time-picker.d.ts.map +1 -1
- package/dist/components/reui/time-picker.js +3 -4
- package/dist/components/reui/time-picker.js.map +1 -1
- package/dist/components/reui/timeline.d.ts +0 -2
- package/dist/components/reui/timeline.d.ts.map +1 -1
- package/dist/components/reui/timeline.js +6 -7
- package/dist/components/reui/timeline.js.map +1 -1
- package/dist/components/reui/tree.d.ts +0 -2
- package/dist/components/reui/tree.d.ts.map +1 -1
- package/dist/components/reui/tree.js +7 -8
- package/dist/components/reui/tree.js.map +1 -1
- package/dist/components/ui/accordion.d.ts +0 -2
- package/dist/components/ui/accordion.d.ts.map +1 -1
- package/dist/components/ui/accordion.js +4 -5
- package/dist/components/ui/accordion.js.map +1 -1
- package/dist/components/ui/alert-dialog.d.ts +0 -2
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.js +7 -8
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/alert.d.ts +0 -2
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/alert.js +4 -5
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/aspect-ratio.d.ts +0 -2
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -1
- package/dist/components/ui/aspect-ratio.js +1 -2
- package/dist/components/ui/attachment.d.ts +1 -3
- package/dist/components/ui/attachment.d.ts.map +1 -1
- package/dist/components/ui/attachment.js +10 -11
- package/dist/components/ui/attachment.js.map +1 -1
- package/dist/components/ui/avatar.d.ts +0 -2
- package/dist/components/ui/avatar.d.ts.map +1 -1
- package/dist/components/ui/avatar.js +6 -7
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/badge.d.ts +0 -2
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.js +2 -3
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb.d.ts +0 -2
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb.js +4 -5
- package/dist/components/ui/breadcrumb.js.map +1 -1
- package/dist/components/ui/bubble.d.ts +0 -2
- package/dist/components/ui/bubble.d.ts.map +1 -1
- package/dist/components/ui/bubble.js +6 -7
- package/dist/components/ui/bubble.js.map +1 -1
- package/dist/components/ui/button-group.d.ts +1 -3
- package/dist/components/ui/button-group.d.ts.map +1 -1
- package/dist/components/ui/button-group.js +3 -4
- package/dist/components/ui/button-group.js.map +1 -1
- package/dist/components/ui/button.d.ts +0 -2
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +7 -8
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.d.ts +0 -2
- package/dist/components/ui/calendar.d.ts.map +1 -1
- package/dist/components/ui/calendar.js +14 -15
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/card.d.ts +0 -2
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/card.js +4 -5
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/carousel.d.ts +0 -2
- package/dist/components/ui/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel.js +1 -2
- package/dist/components/ui/chart.d.ts +0 -2
- package/dist/components/ui/chart.d.ts.map +1 -1
- package/dist/components/ui/chart.js +6 -7
- package/dist/components/ui/chart.js.map +1 -1
- package/dist/components/ui/checkbox.d.ts +0 -2
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox.js +2 -3
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/code-block.d.ts +0 -2
- package/dist/components/ui/code-block.d.ts.map +1 -1
- package/dist/components/ui/code-block.js +11 -12
- package/dist/components/ui/code-block.js.map +1 -1
- package/dist/components/ui/collapsible.d.ts +0 -2
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/collapsible.js +1 -2
- package/dist/components/ui/combobox.d.ts +0 -2
- package/dist/components/ui/combobox.d.ts.map +1 -1
- package/dist/components/ui/combobox.js +9 -10
- package/dist/components/ui/combobox.js.map +1 -1
- package/dist/components/ui/command.d.ts +0 -2
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +8 -9
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/context-menu.d.ts +0 -2
- package/dist/components/ui/context-menu.d.ts.map +1 -1
- package/dist/components/ui/context-menu.js +9 -10
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/dialog.d.ts +0 -2
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +6 -7
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/drawer.d.ts +0 -2
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/drawer.js +7 -8
- package/dist/components/ui/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +0 -2
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +10 -11
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/empty.d.ts +0 -2
- package/dist/components/ui/empty.d.ts.map +1 -1
- package/dist/components/ui/empty.js +6 -7
- package/dist/components/ui/empty.js.map +1 -1
- package/dist/components/ui/field.d.ts +1 -3
- package/dist/components/ui/field.d.ts.map +1 -1
- package/dist/components/ui/field.js +8 -9
- package/dist/components/ui/field.js.map +1 -1
- package/dist/components/ui/hover-card.d.ts +0 -2
- package/dist/components/ui/hover-card.d.ts.map +1 -1
- package/dist/components/ui/hover-card.js +2 -3
- package/dist/components/ui/hover-card.js.map +1 -1
- package/dist/components/ui/input-group.d.ts +1 -3
- package/dist/components/ui/input-group.d.ts.map +1 -1
- package/dist/components/ui/input-group.js +4 -5
- package/dist/components/ui/input-group.js.map +1 -1
- package/dist/components/ui/input-otp.d.ts +0 -2
- package/dist/components/ui/input-otp.d.ts.map +1 -1
- package/dist/components/ui/input-otp.js +4 -5
- package/dist/components/ui/input-otp.js.map +1 -1
- package/dist/components/ui/input.d.ts +0 -2
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/input.js +2 -3
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/item.d.ts +0 -2
- package/dist/components/ui/item.d.ts.map +1 -1
- package/dist/components/ui/item.js +6 -7
- package/dist/components/ui/item.js.map +1 -1
- package/dist/components/ui/kbd.d.ts +0 -2
- package/dist/components/ui/kbd.d.ts.map +1 -1
- package/dist/components/ui/kbd.js +2 -3
- package/dist/components/ui/kbd.js.map +1 -1
- package/dist/components/ui/label.d.ts +0 -2
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/label.js +2 -3
- package/dist/components/ui/label.js.map +1 -1
- package/dist/components/ui/marker.d.ts +0 -2
- package/dist/components/ui/marker.d.ts.map +1 -1
- package/dist/components/ui/marker.js +4 -5
- package/dist/components/ui/marker.js.map +1 -1
- package/dist/components/ui/menubar.d.ts +0 -2
- package/dist/components/ui/menubar.d.ts.map +1 -1
- package/dist/components/ui/menubar.js +11 -12
- package/dist/components/ui/menubar.js.map +1 -1
- package/dist/components/ui/message-scroller.d.ts +0 -2
- package/dist/components/ui/message-scroller.d.ts.map +1 -1
- package/dist/components/ui/message-scroller.js +3 -4
- package/dist/components/ui/message-scroller.js.map +1 -1
- package/dist/components/ui/message.d.ts +0 -2
- package/dist/components/ui/message.d.ts.map +1 -1
- package/dist/components/ui/message.js +5 -6
- package/dist/components/ui/message.js.map +1 -1
- package/dist/components/ui/native-select.d.ts +0 -2
- package/dist/components/ui/native-select.d.ts.map +1 -1
- package/dist/components/ui/native-select.js +3 -4
- package/dist/components/ui/native-select.js.map +1 -1
- package/dist/components/ui/navigation-menu.d.ts +0 -2
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu.js +7 -8
- package/dist/components/ui/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination.d.ts +0 -2
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/pagination.js +1 -2
- package/dist/components/ui/popover.d.ts +0 -2
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +2 -3
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.d.ts +0 -2
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/progress.js +5 -6
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/questionnaire.d.ts +0 -2
- package/dist/components/ui/questionnaire.d.ts.map +1 -1
- package/dist/components/ui/questionnaire.js +10 -11
- package/dist/components/ui/questionnaire.js.map +1 -1
- package/dist/components/ui/radio-group.d.ts +0 -2
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group.js +3 -4
- package/dist/components/ui/radio-group.js.map +1 -1
- package/dist/components/ui/resizable.d.ts +0 -2
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable.js +3 -4
- package/dist/components/ui/resizable.js.map +1 -1
- package/dist/components/ui/scroll-area.d.ts +0 -2
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js +4 -5
- package/dist/components/ui/scroll-area.js.map +1 -1
- package/dist/components/ui/select.d.ts +0 -2
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +9 -10
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/separator.d.ts +0 -2
- package/dist/components/ui/separator.d.ts.map +1 -1
- package/dist/components/ui/separator.js +2 -3
- package/dist/components/ui/separator.js.map +1 -1
- package/dist/components/ui/sheet.d.ts +0 -2
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet.js +3 -4
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/components/ui/sidebar.d.ts +0 -2
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/sidebar.js +19 -20
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/skeleton.d.ts +0 -2
- package/dist/components/ui/skeleton.d.ts.map +1 -1
- package/dist/components/ui/skeleton.js +2 -3
- package/dist/components/ui/skeleton.js.map +1 -1
- package/dist/components/ui/slider.d.ts +0 -2
- package/dist/components/ui/slider.d.ts.map +1 -1
- package/dist/components/ui/slider.js +6 -7
- package/dist/components/ui/slider.js.map +1 -1
- package/dist/components/ui/spinner.d.ts +0 -2
- package/dist/components/ui/spinner.d.ts.map +1 -1
- package/dist/components/ui/spinner.js +1 -2
- package/dist/components/ui/switch.d.ts +0 -2
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/switch.js +3 -4
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/table.d.ts +0 -2
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +6 -7
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tabs.d.ts +0 -2
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/tabs.js +3 -4
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/components/ui/textarea.d.ts +0 -2
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea.js +2 -3
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/components/ui/toast.d.ts +0 -2
- package/dist/components/ui/toast.d.ts.map +1 -1
- package/dist/components/ui/toast.js +5 -6
- package/dist/components/ui/toast.js.map +1 -1
- package/dist/components/ui/toggle-group.d.ts +0 -2
- package/dist/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/components/ui/toggle-group.js +2 -3
- package/dist/components/ui/toggle-group.js.map +1 -1
- package/dist/components/ui/toggle.d.ts +0 -2
- package/dist/components/ui/toggle.d.ts.map +1 -1
- package/dist/components/ui/toggle.js +3 -4
- package/dist/components/ui/toggle.js.map +1 -1
- package/dist/components/ui/tooltip.d.ts +0 -2
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +3 -4
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/components/ui/trace.d.ts +0 -2
- package/dist/components/ui/trace.d.ts.map +1 -1
- package/dist/components/ui/trace.js +7 -8
- package/dist/components/ui/trace.js.map +1 -1
- package/dist/{constants-CsKm9sSk.js → constants-evLzfUhL.js} +2 -3
- package/dist/{constants-CsKm9sSk.js.map → constants-evLzfUhL.js.map} +1 -1
- package/dist/{context-tTdLKYNf.js → context-3i2_6ly8.js} +2 -4
- package/dist/{context-tTdLKYNf.js.map → context-3i2_6ly8.js.map} +1 -1
- package/dist/{context-3_vY1jbv.js → context-C5TW-k6u.js} +3 -5
- package/dist/{context-3_vY1jbv.js.map → context-C5TW-k6u.js.map} +1 -1
- package/dist/{context-BE60udRT.js → context-CXlD0FcC.js} +2 -3
- package/dist/{context-BE60udRT.js.map → context-CXlD0FcC.js.map} +1 -1
- package/dist/{context-Rl5VCYA8.js → context-ChsuSih6.js} +3 -5
- package/dist/{context-Rl5VCYA8.js.map → context-ChsuSih6.js.map} +1 -1
- package/dist/{context-BYXeJQnz.d.ts → context-D-juVNr2.d.ts} +1 -5
- package/dist/context-D-juVNr2.d.ts.map +1 -0
- package/dist/{context-BqjZ1Z_w.js → context-DUx44mGi.js} +3 -5
- package/dist/{context-BqjZ1Z_w.js.map → context-DUx44mGi.js.map} +1 -1
- package/dist/{context-Bc6VC1HA.js → context-DWXNECDe.js} +3 -5
- package/dist/{context-Bc6VC1HA.js.map → context-DWXNECDe.js.map} +1 -1
- package/dist/{context-sD8DQga-.js → context-DdnKlMjE.js} +3 -5
- package/dist/{context-sD8DQga-.js.map → context-DdnKlMjE.js.map} +1 -1
- package/dist/{context-Cn-00gfW.js → context-Dk6C9IvC.js} +3 -5
- package/dist/{context-Cn-00gfW.js.map → context-Dk6C9IvC.js.map} +1 -1
- package/dist/{context-CZfRKkcZ.js → context-i6Dwvi3T.js} +3 -5
- package/dist/{context-CZfRKkcZ.js.map → context-i6Dwvi3T.js.map} +1 -1
- package/dist/{context-Cnlo53sV.d.ts → context-mjP5wifG.d.ts} +1 -5
- package/dist/context-mjP5wifG.d.ts.map +1 -0
- package/dist/{copy-menu-DOg9Jh-U.js → copy-menu-CKW3jM1J.js} +9 -11
- package/dist/{copy-menu-DOg9Jh-U.js.map → copy-menu-CKW3jM1J.js.map} +1 -1
- package/dist/{data-grid-i18n-TQR2PZlU.d.ts → data-grid-i18n-BySPLTBy.d.ts} +1 -3
- package/dist/data-grid-i18n-BySPLTBy.d.ts.map +1 -0
- package/dist/{ease-B82HVmio.d.ts → ease-CHhXKlG3.d.ts} +1 -3
- package/dist/ease-CHhXKlG3.d.ts.map +1 -0
- package/dist/{filters-draft-DEAl3TO-.d.ts → filters-draft-COwwppZX.d.ts} +1 -3
- package/dist/filters-draft-COwwppZX.d.ts.map +1 -0
- package/dist/hooks/use-body-classes.d.ts +0 -2
- package/dist/hooks/use-body-classes.d.ts.map +1 -1
- package/dist/hooks/use-body-classes.js +1 -2
- package/dist/hooks/use-copy-to-clipboard.d.ts +0 -2
- package/dist/hooks/use-copy-to-clipboard.d.ts.map +1 -1
- package/dist/hooks/use-copy-to-clipboard.js +1 -2
- package/dist/hooks/use-dismiss.d.ts +0 -2
- package/dist/hooks/use-dismiss.d.ts.map +1 -1
- package/dist/hooks/use-dismiss.js +1 -2
- package/dist/hooks/use-favicon.d.ts +0 -2
- package/dist/hooks/use-favicon.d.ts.map +1 -1
- package/dist/hooks/use-favicon.js +1 -2
- package/dist/hooks/use-file-upload.d.ts +0 -2
- package/dist/hooks/use-file-upload.d.ts.map +1 -1
- package/dist/hooks/use-file-upload.js +2 -3
- package/dist/hooks/use-file-upload.js.map +1 -1
- package/dist/hooks/use-focus-trap.d.ts +0 -2
- package/dist/hooks/use-focus-trap.d.ts.map +1 -1
- package/dist/hooks/use-focus-trap.js +1 -2
- package/dist/hooks/use-highlighted-code.d.ts +0 -2
- package/dist/hooks/use-highlighted-code.d.ts.map +1 -1
- package/dist/hooks/use-highlighted-code.js +2 -4
- package/dist/hooks/use-highlighted-code.js.map +1 -1
- package/dist/hooks/use-hover-capable.d.ts +0 -2
- package/dist/hooks/use-hover-capable.d.ts.map +1 -1
- package/dist/hooks/use-hover-capable.js +1 -2
- package/dist/hooks/use-hover-gesture.d.ts +0 -2
- package/dist/hooks/use-hover-gesture.d.ts.map +1 -1
- package/dist/hooks/use-hover-gesture.js +1 -2
- package/dist/hooks/use-hydrated.d.ts +0 -2
- package/dist/hooks/use-hydrated.d.ts.map +1 -1
- package/dist/hooks/use-hydrated.js +1 -2
- package/dist/hooks/use-intersection-observer.d.ts +0 -2
- package/dist/hooks/use-intersection-observer.d.ts.map +1 -1
- package/dist/hooks/use-intersection-observer.js +1 -2
- package/dist/hooks/use-is-mac.d.ts +0 -2
- package/dist/hooks/use-is-mac.d.ts.map +1 -1
- package/dist/hooks/use-is-mac.js +1 -2
- package/dist/hooks/use-listbox.d.ts +0 -2
- package/dist/hooks/use-listbox.d.ts.map +1 -1
- package/dist/hooks/use-listbox.js +1 -2
- package/dist/hooks/use-media-query.d.ts +0 -2
- package/dist/hooks/use-media-query.d.ts.map +1 -1
- package/dist/hooks/use-media-query.js +1 -2
- package/dist/hooks/use-meta-color.d.ts +0 -2
- package/dist/hooks/use-meta-color.d.ts.map +1 -1
- package/dist/hooks/use-meta-color.js +1 -2
- package/dist/hooks/use-mobile.d.ts +0 -2
- package/dist/hooks/use-mobile.d.ts.map +1 -1
- package/dist/hooks/use-mobile.js +1 -2
- package/dist/hooks/use-modal-scope.d.ts +0 -2
- package/dist/hooks/use-modal-scope.d.ts.map +1 -1
- package/dist/hooks/use-modal-scope.js +1 -2
- package/dist/hooks/use-mutation-observer.d.ts +0 -2
- package/dist/hooks/use-mutation-observer.d.ts.map +1 -1
- package/dist/hooks/use-mutation-observer.js +1 -2
- package/dist/hooks/use-on-open.d.ts +0 -2
- package/dist/hooks/use-on-open.d.ts.map +1 -1
- package/dist/hooks/use-on-open.js +1 -2
- package/dist/hooks/use-row-cursor.d.ts +0 -2
- package/dist/hooks/use-row-cursor.d.ts.map +1 -1
- package/dist/hooks/use-row-cursor.js +2 -3
- package/dist/hooks/use-row-cursor.js.map +1 -1
- package/dist/hooks/use-scroll-position.d.ts +0 -2
- package/dist/hooks/use-scroll-position.d.ts.map +1 -1
- package/dist/hooks/use-scroll-position.js +1 -2
- package/dist/hooks/use-slider-input.d.ts +0 -2
- package/dist/hooks/use-slider-input.d.ts.map +1 -1
- package/dist/hooks/use-slider-input.js +1 -2
- package/dist/hooks/use-slider.d.ts +0 -2
- package/dist/hooks/use-slider.d.ts.map +1 -1
- package/dist/hooks/use-slider.js +1 -2
- package/dist/hooks/use-tap-gesture.d.ts +0 -2
- package/dist/hooks/use-tap-gesture.d.ts.map +1 -1
- package/dist/hooks/use-tap-gesture.js +1 -2
- package/dist/hooks/use-touch-capable.d.ts +0 -2
- package/dist/hooks/use-touch-capable.d.ts.map +1 -1
- package/dist/hooks/use-touch-capable.js +1 -2
- package/dist/hooks/use-viewport.d.ts +0 -2
- package/dist/hooks/use-viewport.d.ts.map +1 -1
- package/dist/hooks/use-viewport.js +1 -2
- package/dist/lib/command-search.d.ts +0 -2
- package/dist/lib/command-search.d.ts.map +1 -1
- package/dist/lib/command-search.js +1 -2
- package/dist/lib/ease.d.ts +1 -1
- package/dist/lib/ease.js +1 -2
- package/dist/lib/favicon.d.ts +0 -2
- package/dist/lib/favicon.d.ts.map +1 -1
- package/dist/lib/favicon.js +1 -2
- package/dist/lib/text-shimmer.d.ts +0 -2
- package/dist/lib/text-shimmer.d.ts.map +1 -1
- package/dist/lib/text-shimmer.js +1 -2
- package/dist/lib/tick-sound.d.ts +0 -2
- package/dist/lib/tick-sound.d.ts.map +1 -1
- package/dist/lib/tick-sound.js +1 -2
- package/dist/lib/touch.d.ts +0 -2
- package/dist/lib/touch.d.ts.map +1 -1
- package/dist/lib/touch.js +1 -2
- package/dist/{model-DlbIqCZg.d.ts → model-BFZGhrnQ.d.ts} +1 -3
- package/dist/model-BFZGhrnQ.d.ts.map +1 -0
- package/dist/{model-NSIg2p7a.d.ts → model-DuAc65oe.d.ts} +1 -3
- package/dist/model-DuAc65oe.d.ts.map +1 -0
- package/dist/{model-_mRyI6V9.d.ts → model-mS4UXPwk.d.ts} +1 -3
- package/dist/model-mS4UXPwk.d.ts.map +1 -0
- package/dist/{plot-CdFTbMI_.js → plot-DAKl-Lu1.js} +6 -8
- package/dist/{plot-CdFTbMI_.js.map → plot-DAKl-Lu1.js.map} +1 -1
- package/dist/{popover-position-BUqYCq8X.js → popover-position-BaDNBZ-D.js} +2 -3
- package/dist/{popover-position-BUqYCq8X.js.map → popover-position-BaDNBZ-D.js.map} +1 -1
- package/dist/{positioner-3r3cfkqT.js → positioner-MidjIUUT.js} +3 -5
- package/dist/{positioner-3r3cfkqT.js.map → positioner-MidjIUUT.js.map} +1 -1
- package/dist/{presence-gate-BekdC4Bo.js → presence-gate-DC7yL1Ls.js} +2 -3
- package/dist/{presence-gate-BekdC4Bo.js.map → presence-gate-DC7yL1Ls.js.map} +1 -1
- package/dist/{tooltip-DQ4DXgeu.d.ts → tooltip-BVRmgnbZ.d.ts} +1 -7
- package/dist/tooltip-BVRmgnbZ.d.ts.map +1 -0
- package/dist/{tooltip-C6qUs7px.d.ts → tooltip-CMVyNolz.d.ts} +1 -5
- package/dist/tooltip-CMVyNolz.d.ts.map +1 -0
- package/dist/{tooltip-C01qUgsW.d.ts → tooltip-CNEYdIX3.d.ts} +1 -7
- package/dist/tooltip-CNEYdIX3.d.ts.map +1 -0
- package/dist/{tooltip-BqxVD6D-.d.ts → tooltip-Cq46pSJ2.d.ts} +1 -5
- package/dist/tooltip-Cq46pSJ2.d.ts.map +1 -0
- package/dist/{tooltip-Bam5KeYe.js → tooltip-CuHpilPN.js} +5 -7
- package/dist/{tooltip-Bam5KeYe.js.map → tooltip-CuHpilPN.js.map} +1 -1
- package/dist/{tooltip-BarafYiU.d.ts → tooltip-w0KptZat.d.ts} +1 -5
- package/dist/tooltip-w0KptZat.d.ts.map +1 -0
- package/dist/{types-B_6p3LXz.d.ts → types-B0d0d7PF.d.ts} +1 -3
- package/dist/types-B0d0d7PF.d.ts.map +1 -0
- package/dist/{types-Bah5NY44.d.ts → types-BB61jXS_.d.ts} +1 -3
- package/dist/types-BB61jXS_.d.ts.map +1 -0
- package/dist/{types-smkWN_7x.d.ts → types-BSMELKE5.d.ts} +1 -3
- package/dist/types-BSMELKE5.d.ts.map +1 -0
- package/dist/{types-kSZH1k8K.d.ts → types-D9hKqIzm.d.ts} +1 -3
- package/dist/types-D9hKqIzm.d.ts.map +1 -0
- package/dist/{types-D6e3gWOA.d.ts → types-qTGsGdN1.d.ts} +1 -3
- package/dist/types-qTGsGdN1.d.ts.map +1 -0
- package/dist/{use-active-option-CmX6Z-4S.js → use-active-option-DerS-wGL.js} +2 -3
- package/dist/{use-active-option-CmX6Z-4S.js.map → use-active-option-DerS-wGL.js.map} +1 -1
- package/dist/{use-geometry-CH0foIo7.d.ts → use-geometry-C84j2gUk.d.ts} +1 -3
- package/dist/use-geometry-C84j2gUk.d.ts.map +1 -0
- package/dist/{use-position-DOi1gVL0.d.ts → use-position-CWSE4wCz.d.ts} +1 -3
- package/dist/use-position-CWSE4wCz.d.ts.map +1 -0
- package/dist/{utils-B3YXTsDI.js → utils-DMrlhG6M.js} +2 -3
- package/dist/{utils-B3YXTsDI.js.map → utils-DMrlhG6M.js.map} +1 -1
- package/dist/{utils-DQ7OpbYQ.js → utils-ZRfJ78Df.js} +1 -2
- package/dist/{utils-DQ7OpbYQ.js.map → utils-ZRfJ78Df.js.map} +1 -1
- package/package.json +5 -5
- package/dist/cascader-types-zhnUQ4sP.d.ts.map +0 -1
- package/dist/context-BYXeJQnz.d.ts.map +0 -1
- package/dist/context-Cnlo53sV.d.ts.map +0 -1
- package/dist/data-grid-i18n-TQR2PZlU.d.ts.map +0 -1
- package/dist/ease-B82HVmio.d.ts.map +0 -1
- package/dist/filters-draft-DEAl3TO-.d.ts.map +0 -1
- package/dist/model-DlbIqCZg.d.ts.map +0 -1
- package/dist/model-NSIg2p7a.d.ts.map +0 -1
- package/dist/model-_mRyI6V9.d.ts.map +0 -1
- package/dist/tooltip-BarafYiU.d.ts.map +0 -1
- package/dist/tooltip-BqxVD6D-.d.ts.map +0 -1
- package/dist/tooltip-C01qUgsW.d.ts.map +0 -1
- package/dist/tooltip-C6qUs7px.d.ts.map +0 -1
- package/dist/tooltip-DQ4DXgeu.d.ts.map +0 -1
- package/dist/types-B_6p3LXz.d.ts.map +0 -1
- package/dist/types-Bah5NY44.d.ts.map +0 -1
- package/dist/types-D6e3gWOA.d.ts.map +0 -1
- package/dist/types-kSZH1k8K.d.ts.map +0 -1
- package/dist/types-smkWN_7x.d.ts.map +0 -1
- package/dist/use-geometry-CH0foIo7.d.ts.map +0 -1
- package/dist/use-position-DOi1gVL0.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-folder.js","names":[],"sources":["../../../src/components/motion/project-folder.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, useCallback, useEffect, useId, useRef, useState } from \"react\";\nimport { X } from \"lucide-react\";\nimport {\n AnimatePresence,\n LayoutGroup,\n motion,\n type Transition,\n useReducedMotion,\n} from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport { cn } from \"@kumix/utils\";\nimport { useHoverCapable } from \"../../hooks/use-hover-capable\";\nimport { SPRING_LAYOUT, SPRING_PRESS } from \"../../lib/ease\";\n\nexport type ProjectFolderPreview = {\n id: string;\n content: ReactNode;\n};\n\nexport interface ProjectFolderProps {\n title: string;\n description?: string;\n previews?: ProjectFolderPreview[];\n count?: number;\n itemLabel?: string;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n expanded?: boolean;\n defaultExpanded?: boolean;\n onExpandedChange?: (expanded: boolean) => void;\n onClick?: () => void;\n disabled?: boolean;\n ariaLabel?: string;\n className?: string;\n}\n\nconst MAX_PREVIEWS = 5;\nconst FOCUSABLE_SELECTOR = [\n \"a[href]\",\n \"button:not([disabled])\",\n \"input:not([disabled])\",\n \"select:not([disabled])\",\n \"textarea:not([disabled])\",\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(\",\");\n\nfunction getPreviewTransform(index: number, count: number) {\n const offset = index - (count - 1) / 2;\n const distance = Math.abs(offset);\n const centerLift = Math.max(0, 2 - distance) * 8;\n\n return {\n x: offset * 44,\n y: 8 - centerLift,\n rotate: offset * 6,\n scale: distance === 0 ? 1.04 : distance === 1 ? 0.95 : 0.88,\n opacity: distance === 0 ? 1 : distance === 1 ? 0.78 : 0.58,\n zIndex: 10 - distance,\n };\n}\n\nexport function ProjectFolder({\n title,\n description = \"Updated recently\",\n previews = [],\n count = previews.length,\n itemLabel = \"file\",\n open,\n defaultOpen = false,\n onOpenChange,\n expanded,\n defaultExpanded = false,\n onExpandedChange,\n onClick,\n disabled = false,\n ariaLabel,\n className,\n}: ProjectFolderProps) {\n const reduce = useReducedMotion();\n const canHover = useHoverCapable();\n const layoutGroupId = useId();\n const dialogTitleId = `${layoutGroupId}-title`;\n const hoveredRef = useRef(false);\n const focusedRef = useRef(false);\n const restoringFocusRef = useRef(false);\n const folderButtonRef = useRef<HTMLButtonElement>(null);\n const closeButtonRef = useRef<HTMLButtonElement>(null);\n const dialogRef = useRef<HTMLDivElement>(null);\n const [mounted, setMounted] = useState(false);\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const [internalExpanded, setInternalExpanded] = useState(defaultExpanded);\n const [isClosing, setIsClosing] = useState(false);\n const openControlled = open !== undefined;\n const expandedControlled = expanded !== undefined;\n const isExpanded = expanded ?? internalExpanded;\n const isOpen = (open ?? internalOpen) || isExpanded;\n const previewItems = previews.slice(0, MAX_PREVIEWS);\n const transition: Transition = reduce ? { duration: 0 } : SPRING_LAYOUT;\n const countText = `${count} ${itemLabel}${count === 1 ? \"\" : \"s\"}`;\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (disabled) return;\n if (!openControlled) setInternalOpen(next);\n onOpenChange?.(next);\n },\n [disabled, onOpenChange, openControlled],\n );\n\n const setExpanded = useCallback(\n (next: boolean) => {\n if (disabled || previewItems.length === 0) return;\n if (!expandedControlled) setInternalExpanded(next);\n onExpandedChange?.(next);\n },\n [disabled, expandedControlled, onExpandedChange, previewItems.length],\n );\n\n const finishClose = useCallback(() => {\n setIsClosing(false);\n restoringFocusRef.current = true;\n requestAnimationFrame(() => folderButtonRef.current?.focus());\n }, []);\n\n const closeOverlay = useCallback(() => {\n setIsClosing(true);\n setOpen(false);\n setExpanded(false);\n }, [setExpanded, setOpen]);\n\n useEffect(() => setMounted(true), []);\n\n useEffect(() => {\n if (reduce && isClosing) finishClose();\n }, [finishClose, isClosing, reduce]);\n\n useEffect(() => {\n if (!isExpanded) return;\n\n const previousOverflow = document.body.style.overflow;\n const focusFrame = requestAnimationFrame(() => closeButtonRef.current?.focus());\n\n document.body.style.overflow = \"hidden\";\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n closeOverlay();\n return;\n }\n if (event.key !== \"Tab\" || !dialogRef.current) return;\n\n const focusable = Array.from(\n dialogRef.current.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR),\n ).filter((element) => element.tabIndex >= 0);\n const first = focusable[0];\n const last = focusable.at(-1);\n if (!first || !last) return;\n\n if (event.shiftKey && document.activeElement === first) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && document.activeElement === last) {\n event.preventDefault();\n first.focus();\n }\n };\n\n document.addEventListener(\"keydown\", handleKeyDown);\n return () => {\n cancelAnimationFrame(focusFrame);\n document.body.style.overflow = previousOverflow;\n document.removeEventListener(\"keydown\", handleKeyDown);\n };\n }, [closeOverlay, isExpanded]);\n\n const handleFolderClick = () => {\n setIsClosing(false);\n setExpanded(true);\n setOpen(true);\n onClick?.();\n };\n\n // The chrome is two siblings: a backdrop spanning the viewport edges that\n // paints the scrim, and a transparent dialog inset off every edge that lays\n // out and scrolls the panel. The backdrop cannot nest inside that scroll box —\n // WebKit resolves a `position: fixed` descendant of an accelerated overflow\n // scroller against the scroller, not the viewport, so the insets would go\n // unscrimmed on a phone. The scroll box takes no pointer events and the panel\n // takes them back, so gutter presses still close the overlay. Accepted: the\n // 2rem inset sits outside the scroll box, so it stays put rather than\n // scrolling away with the content.\n //\n const overlay =\n isExpanded || isClosing ? (\n <>\n <AnimatePresence initial={false}>\n {isExpanded ? (\n <motion.button\n key=\"project-files-backdrop\"\n type=\"button\"\n tabIndex={-1}\n aria-label=\"Close file overlay\"\n onClick={closeOverlay}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={reduce ? { duration: 0 } : { duration: 0.18 }}\n className={cn(\n \"fixed inset-0 z-50 cursor-default bg-background/80 backdrop-blur-xl\",\n isClosing && \"pointer-events-none\",\n )}\n />\n ) : null}\n </AnimatePresence>\n\n <div\n ref={dialogRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={dialogTitleId}\n aria-hidden={isExpanded ? undefined : \"true\"}\n className=\"pointer-events-none fixed inset-x-6 inset-y-8 z-50 flex items-start justify-center overflow-y-auto sm:items-center\"\n >\n {/* 61rem, not `max-w-5xl`: the cap is on a padding-free box, so it has to\n be the 64rem border box less the 3rem the gutters take. */}\n <div\n className={cn(\n \"pointer-events-auto relative z-10 w-full max-w-[61rem]\",\n isClosing && \"pointer-events-none\",\n )}\n >\n <AnimatePresence initial={false}>\n {isExpanded ? (\n <motion.div\n key=\"project-files-header\"\n initial={{ opacity: 0, y: reduce ? 0 : 8 }}\n animate={{ opacity: 1, y: 0 }}\n exit={{ opacity: 0, y: reduce ? 0 : -8 }}\n transition={reduce ? { duration: 0 } : { duration: 0.18 }}\n className=\"mb-6 flex items-center justify-between gap-4\"\n >\n <div>\n <h2 id={dialogTitleId} className=\"font-medium text-foreground text-xl\">\n {title}\n </h2>\n <p className=\"mt-1 text-muted-foreground text-sm\">{countText}</p>\n </div>\n <button\n ref={closeButtonRef}\n type=\"button\"\n onClick={closeOverlay}\n aria-label={`Close ${title}`}\n className=\"flex size-10 items-center justify-center rounded-full border border-foreground/10 bg-background/50 text-muted-foreground backdrop-blur-xl transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <X className=\"size-4\" aria-hidden=\"true\" />\n </button>\n </motion.div>\n ) : null}\n </AnimatePresence>\n\n <div className=\"grid grid-cols-2 place-items-center gap-3 sm:grid-cols-3 lg:grid-cols-5\">\n {isExpanded\n ? previewItems.map((preview) => (\n <motion.div\n key={preview.id}\n layoutId={`file-${preview.id}`}\n transition={transition}\n className=\"aspect-3/4 w-full max-w-40 overflow-hidden rounded-xl border border-foreground/10 bg-background/50 backdrop-blur-xl\"\n >\n {preview.content}\n </motion.div>\n ))\n : null}\n </div>\n </div>\n </div>\n </>\n ) : null;\n\n return (\n <LayoutGroup id={layoutGroupId}>\n <motion.button\n ref={folderButtonRef}\n type=\"button\"\n disabled={disabled}\n aria-label={ariaLabel}\n aria-haspopup=\"dialog\"\n aria-expanded={isExpanded}\n data-open={isOpen ? \"true\" : \"false\"}\n data-expanded={isExpanded ? \"true\" : \"false\"}\n tabIndex={isExpanded ? -1 : undefined}\n onPointerEnter={() => {\n if (!canHover) return;\n hoveredRef.current = true;\n setOpen(true);\n }}\n onPointerLeave={() => {\n if (!canHover) return;\n hoveredRef.current = false;\n if (!isExpanded && !isClosing) setOpen(focusedRef.current);\n }}\n onFocus={() => {\n if (restoringFocusRef.current) {\n restoringFocusRef.current = false;\n focusedRef.current = false;\n return;\n }\n focusedRef.current = true;\n setOpen(true);\n }}\n onBlur={() => {\n focusedRef.current = false;\n if (!isExpanded && !isClosing) setOpen(hoveredRef.current);\n }}\n onClick={handleFolderClick}\n whileTap={reduce || disabled ? undefined : { scale: 0.98 }}\n transition={reduce ? { duration: 0 } : SPRING_PRESS}\n className={cn(\n \"perspective-[1200px] relative block h-56 w-72 select-none rounded-2xl text-left outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-4 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n >\n <motion.span\n aria-hidden=\"true\"\n animate={{ rotateX: isOpen && !reduce ? 15 : 0 }}\n transition={transition}\n className=\"absolute inset-0 origin-[center_bottom] rounded-2xl border border-foreground/10 bg-background/25 backdrop-blur-xl\"\n />\n\n <span aria-hidden=\"true\" className=\"pointer-events-none absolute inset-0\">\n <span className=\"absolute top-0 left-1/2 block h-0 w-0\">\n <AnimatePresence initial={false}>\n {!isExpanded\n ? previewItems.map((preview, index) => {\n const opened = getPreviewTransform(index, previewItems.length);\n return (\n <motion.span\n key={preview.id}\n layoutId={`file-${preview.id}`}\n initial={false}\n animate={\n isOpen && !reduce\n ? {\n x: opened.x * 1.4,\n y: opened.y - 8,\n rotate: opened.rotate * 1.3,\n scale: opened.scale * 1.02,\n opacity: Math.min(1, opened.opacity + 0.18),\n }\n : {\n x: opened.x,\n y: opened.y,\n rotate: opened.rotate,\n scale: opened.scale,\n opacity: opened.opacity,\n }\n }\n transition={transition}\n onLayoutAnimationComplete={() => {\n if (isClosing && index === 0) finishClose();\n }}\n className=\"absolute top-0 left-0 -ml-12 block h-40 w-24 overflow-hidden rounded-lg border border-foreground/10 bg-background/45 backdrop-blur-lg\"\n style={{ zIndex: opened.zIndex }}\n >\n {preview.content}\n </motion.span>\n );\n })\n : null}\n </AnimatePresence>\n </span>\n </span>\n\n <motion.span\n initial={false}\n animate={{ rotateX: isOpen && !reduce ? -25 : 0 }}\n transition={transition}\n className=\"backface-hidden absolute inset-x-0 bottom-0 z-20 origin-[center_bottom] overflow-hidden rounded-2xl border border-foreground/10 bg-background/60 backdrop-blur-2xl\"\n >\n <span className=\"flex h-16 items-center px-4\">\n <span className=\"line-clamp-2 font-medium text-foreground text-xl leading-tight\">\n {title}\n </span>\n </span>\n <span className=\"flex h-12 items-center justify-between gap-3 border-foreground/10 border-t px-4\">\n <span className=\"shrink-0 font-medium text-foreground/70 text-sm\">{countText}</span>\n <span className=\"truncate text-muted-foreground text-sm\">{description}</span>\n </span>\n </motion.span>\n </motion.button>\n\n {mounted ? createPortal(overlay, document.body) : null}\n </LayoutGroup>\n );\n}\n"],"mappings":";;;;;;;;;;AAwCA,MAAM,eAAe;AACrB,MAAM,qBAAqB;CACzB;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,CAAC,KAAK,GAAG;AAEV,SAAS,oBAAoB,OAAe,OAAe;CACzD,MAAM,SAAS,SAAS,QAAQ,KAAK;CACrC,MAAM,WAAW,KAAK,IAAI,MAAM;CAChC,MAAM,aAAa,KAAK,IAAI,GAAG,IAAI,QAAQ,IAAI;CAE/C,OAAO;EACL,GAAG,SAAS;EACZ,GAAG,IAAI;EACP,QAAQ,SAAS;EACjB,OAAO,aAAa,IAAI,OAAO,aAAa,IAAI,MAAO;EACvD,SAAS,aAAa,IAAI,IAAI,aAAa,IAAI,MAAO;EACtD,QAAQ,KAAK;CACf;AACF;AAEA,SAAgB,cAAc,EAC5B,OACA,cAAc,oBACd,WAAW,CAAC,GACZ,QAAQ,SAAS,QACjB,YAAY,QACZ,MACA,cAAc,OACd,cACA,UACA,kBAAkB,OAClB,kBACA,SACA,WAAW,OACX,WACA,aACqB;CACrB,MAAM,SAAS,iBAAiB;CAChC,MAAM,WAAW,gBAAgB;CACjC,MAAM,gBAAgB,MAAM;CAC5B,MAAM,gBAAgB,GAAG,cAAc;CACvC,MA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OAAO,MAAR;SAEE,UAAU,QAAQ,QAAQ;SAC1B,SAAS;SACT,SACE,UAAU,CAAC,SACP;UACE,GAAG,OAAO,IAAI;UACd,GAAG,OAAO,IAAI;UACd,QAAQ,OAAO,SAAS;UACxB,OAAO,OAAO,QAAQ;UACtB,SAAS,KAAK,IAAI,GAAG,OAAO,UAAU,GAAI;SAC5C,IACA;UACE,GAAG,OAAO;UACV,GAAG,OAAO;UACV,QAAQ,OAAO;UACf,OAAO,OAAO;UACd,SAAS,OAAO;SAClB;SAEM;SACZ,iCAAiC;UAC/B,IAAI,aAAa,UAAU,GAAG,YAAY;SAC5C;SACA,WAAU;SACV,OAAO,EAAE,QAAQ,OAAO,OAAO;SAE9B,UAAA,QAAQ;QACE,GA5BN,QAAQ,EA4BF;OAEjB,CAAC,IACD;MACW,CAAA;KACb,CAAA;IACF,CAAA;IAEN,qBAAC,OAAO,MAAR;KACE,SAAS;KACT,SAAS,EAAE,SAAS,UAAU,CAAC,SAAS,MAAM,EAAE;KACpC;KACZ,WAAU;KAJZ,UAAA,CAME,oBAAC,QAAD;MAAM,WAAU;MACd,UAAA,oBAAC,QAAD;OAAM,WAAU;OACb,UAAA;MACG,CAAA;KACF,CAAA,GACN,qBAAC,QAAD;MAAM,WAAU;MAAhB,UAAA,CACE,oBAAC,QAAD;OAAM,WAAU;OAAmD,UAAA;MAAgB,CAAA,GACnF,oBAAC,QAAD;OAAM,WAAU;OAA0C,UAAA;MAAkB,CAAA,CACxE;KACK,CAAA,CAAA;;GACA;EAEd,CAAA,GAAA,UAAU,aAAa,SAAS,SAAS,IAAI,IAAI,IACvC;;AAEjB"}
|
|
1
|
+
{"version":3,"file":"project-folder.js","names":[],"sources":["../../../src/components/motion/project-folder.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, useCallback, useEffect, useId, useRef, useState } from \"react\";\nimport { X } from \"lucide-react\";\nimport {\n AnimatePresence,\n LayoutGroup,\n motion,\n type Transition,\n useReducedMotion,\n} from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport { cn } from \"@kumix/utils\";\nimport { useHoverCapable } from \"../../hooks/use-hover-capable\";\nimport { SPRING_LAYOUT, SPRING_PRESS } from \"../../lib/ease\";\n\nexport type ProjectFolderPreview = {\n id: string;\n content: ReactNode;\n};\n\nexport interface ProjectFolderProps {\n title: string;\n description?: string;\n previews?: ProjectFolderPreview[];\n count?: number;\n itemLabel?: string;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n expanded?: boolean;\n defaultExpanded?: boolean;\n onExpandedChange?: (expanded: boolean) => void;\n onClick?: () => void;\n disabled?: boolean;\n ariaLabel?: string;\n className?: string;\n}\n\nconst MAX_PREVIEWS = 5;\nconst FOCUSABLE_SELECTOR = [\n \"a[href]\",\n \"button:not([disabled])\",\n \"input:not([disabled])\",\n \"select:not([disabled])\",\n \"textarea:not([disabled])\",\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(\",\");\n\nfunction getPreviewTransform(index: number, count: number) {\n const offset = index - (count - 1) / 2;\n const distance = Math.abs(offset);\n const centerLift = Math.max(0, 2 - distance) * 8;\n\n return {\n x: offset * 44,\n y: 8 - centerLift,\n rotate: offset * 6,\n scale: distance === 0 ? 1.04 : distance === 1 ? 0.95 : 0.88,\n opacity: distance === 0 ? 1 : distance === 1 ? 0.78 : 0.58,\n zIndex: 10 - distance,\n };\n}\n\nexport function ProjectFolder({\n title,\n description = \"Updated recently\",\n previews = [],\n count = previews.length,\n itemLabel = \"file\",\n open,\n defaultOpen = false,\n onOpenChange,\n expanded,\n defaultExpanded = false,\n onExpandedChange,\n onClick,\n disabled = false,\n ariaLabel,\n className,\n}: ProjectFolderProps) {\n const reduce = useReducedMotion();\n const canHover = useHoverCapable();\n const layoutGroupId = useId();\n const dialogTitleId = `${layoutGroupId}-title`;\n const hoveredRef = useRef(false);\n const focusedRef = useRef(false);\n const restoringFocusRef = useRef(false);\n const folderButtonRef = useRef<HTMLButtonElement>(null);\n const closeButtonRef = useRef<HTMLButtonElement>(null);\n const dialogRef = useRef<HTMLDivElement>(null);\n const [mounted, setMounted] = useState(false);\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const [internalExpanded, setInternalExpanded] = useState(defaultExpanded);\n const [isClosing, setIsClosing] = useState(false);\n const openControlled = open !== undefined;\n const expandedControlled = expanded !== undefined;\n const isExpanded = expanded ?? internalExpanded;\n const isOpen = (open ?? internalOpen) || isExpanded;\n const previewItems = previews.slice(0, MAX_PREVIEWS);\n const transition: Transition = reduce ? { duration: 0 } : SPRING_LAYOUT;\n const countText = `${count} ${itemLabel}${count === 1 ? \"\" : \"s\"}`;\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (disabled) return;\n if (!openControlled) setInternalOpen(next);\n onOpenChange?.(next);\n },\n [disabled, onOpenChange, openControlled],\n );\n\n const setExpanded = useCallback(\n (next: boolean) => {\n if (disabled || previewItems.length === 0) return;\n if (!expandedControlled) setInternalExpanded(next);\n onExpandedChange?.(next);\n },\n [disabled, expandedControlled, onExpandedChange, previewItems.length],\n );\n\n const finishClose = useCallback(() => {\n setIsClosing(false);\n restoringFocusRef.current = true;\n requestAnimationFrame(() => folderButtonRef.current?.focus());\n }, []);\n\n const closeOverlay = useCallback(() => {\n setIsClosing(true);\n setOpen(false);\n setExpanded(false);\n }, [setExpanded, setOpen]);\n\n useEffect(() => setMounted(true), []);\n\n useEffect(() => {\n if (reduce && isClosing) finishClose();\n }, [finishClose, isClosing, reduce]);\n\n useEffect(() => {\n if (!isExpanded) return;\n\n const previousOverflow = document.body.style.overflow;\n const focusFrame = requestAnimationFrame(() => closeButtonRef.current?.focus());\n\n document.body.style.overflow = \"hidden\";\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n closeOverlay();\n return;\n }\n if (event.key !== \"Tab\" || !dialogRef.current) return;\n\n const focusable = Array.from(\n dialogRef.current.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR),\n ).filter((element) => element.tabIndex >= 0);\n const first = focusable[0];\n const last = focusable.at(-1);\n if (!first || !last) return;\n\n if (event.shiftKey && document.activeElement === first) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && document.activeElement === last) {\n event.preventDefault();\n first.focus();\n }\n };\n\n document.addEventListener(\"keydown\", handleKeyDown);\n return () => {\n cancelAnimationFrame(focusFrame);\n document.body.style.overflow = previousOverflow;\n document.removeEventListener(\"keydown\", handleKeyDown);\n };\n }, [closeOverlay, isExpanded]);\n\n const handleFolderClick = () => {\n setIsClosing(false);\n setExpanded(true);\n setOpen(true);\n onClick?.();\n };\n\n // The chrome is two siblings: a backdrop spanning the viewport edges that\n // paints the scrim, and a transparent dialog inset off every edge that lays\n // out and scrolls the panel. The backdrop cannot nest inside that scroll box —\n // WebKit resolves a `position: fixed` descendant of an accelerated overflow\n // scroller against the scroller, not the viewport, so the insets would go\n // unscrimmed on a phone. The scroll box takes no pointer events and the panel\n // takes them back, so gutter presses still close the overlay. Accepted: the\n // 2rem inset sits outside the scroll box, so it stays put rather than\n // scrolling away with the content.\n //\n const overlay =\n isExpanded || isClosing ? (\n <>\n <AnimatePresence initial={false}>\n {isExpanded ? (\n <motion.button\n key=\"project-files-backdrop\"\n type=\"button\"\n tabIndex={-1}\n aria-label=\"Close file overlay\"\n onClick={closeOverlay}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={reduce ? { duration: 0 } : { duration: 0.18 }}\n className={cn(\n \"bg-background/80 fixed inset-0 z-50 cursor-default backdrop-blur-xl\",\n isClosing && \"pointer-events-none\",\n )}\n />\n ) : null}\n </AnimatePresence>\n\n <div\n ref={dialogRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={dialogTitleId}\n aria-hidden={isExpanded ? undefined : \"true\"}\n className=\"pointer-events-none fixed inset-x-6 inset-y-8 z-50 flex items-start justify-center overflow-y-auto sm:items-center\"\n >\n {/* 61rem, not `max-w-5xl`: the cap is on a padding-free box, so it has to\n be the 64rem border box less the 3rem the gutters take. */}\n <div\n className={cn(\n \"pointer-events-auto relative z-10 w-full max-w-[61rem]\",\n isClosing && \"pointer-events-none\",\n )}\n >\n <AnimatePresence initial={false}>\n {isExpanded ? (\n <motion.div\n key=\"project-files-header\"\n initial={{ opacity: 0, y: reduce ? 0 : 8 }}\n animate={{ opacity: 1, y: 0 }}\n exit={{ opacity: 0, y: reduce ? 0 : -8 }}\n transition={reduce ? { duration: 0 } : { duration: 0.18 }}\n className=\"mb-6 flex items-center justify-between gap-4\"\n >\n <div>\n <h2 id={dialogTitleId} className=\"text-foreground text-xl font-medium\">\n {title}\n </h2>\n <p className=\"text-muted-foreground mt-1 text-sm\">{countText}</p>\n </div>\n <button\n ref={closeButtonRef}\n type=\"button\"\n onClick={closeOverlay}\n aria-label={`Close ${title}`}\n className=\"border-foreground/10 bg-background/50 text-muted-foreground hover:text-foreground focus-visible:ring-ring flex size-10 items-center justify-center rounded-full border backdrop-blur-xl transition-colors focus-visible:ring-2 focus-visible:outline-none\"\n >\n <X className=\"size-4\" aria-hidden=\"true\" />\n </button>\n </motion.div>\n ) : null}\n </AnimatePresence>\n\n <div className=\"grid grid-cols-2 place-items-center gap-3 sm:grid-cols-3 lg:grid-cols-5\">\n {isExpanded\n ? previewItems.map((preview) => (\n <motion.div\n key={preview.id}\n layoutId={`file-${preview.id}`}\n transition={transition}\n className=\"border-foreground/10 bg-background/50 aspect-3/4 w-full max-w-40 overflow-hidden rounded-xl border backdrop-blur-xl\"\n >\n {preview.content}\n </motion.div>\n ))\n : null}\n </div>\n </div>\n </div>\n </>\n ) : null;\n\n return (\n <LayoutGroup id={layoutGroupId}>\n <motion.button\n ref={folderButtonRef}\n type=\"button\"\n disabled={disabled}\n aria-label={ariaLabel}\n aria-haspopup=\"dialog\"\n aria-expanded={isExpanded}\n data-open={isOpen ? \"true\" : \"false\"}\n data-expanded={isExpanded ? \"true\" : \"false\"}\n tabIndex={isExpanded ? -1 : undefined}\n onPointerEnter={() => {\n if (!canHover) return;\n hoveredRef.current = true;\n setOpen(true);\n }}\n onPointerLeave={() => {\n if (!canHover) return;\n hoveredRef.current = false;\n if (!isExpanded && !isClosing) setOpen(focusedRef.current);\n }}\n onFocus={() => {\n if (restoringFocusRef.current) {\n restoringFocusRef.current = false;\n focusedRef.current = false;\n return;\n }\n focusedRef.current = true;\n setOpen(true);\n }}\n onBlur={() => {\n focusedRef.current = false;\n if (!isExpanded && !isClosing) setOpen(hoveredRef.current);\n }}\n onClick={handleFolderClick}\n whileTap={reduce || disabled ? undefined : { scale: 0.98 }}\n transition={reduce ? { duration: 0 } : SPRING_PRESS}\n className={cn(\n \"focus-visible:ring-ring focus-visible:ring-offset-background relative block h-56 w-72 rounded-2xl text-left outline-none select-none perspective-[1200px] focus-visible:ring-2 focus-visible:ring-offset-4 disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n >\n <motion.span\n aria-hidden=\"true\"\n animate={{ rotateX: isOpen && !reduce ? 15 : 0 }}\n transition={transition}\n className=\"border-foreground/10 bg-background/25 absolute inset-0 origin-[center_bottom] rounded-2xl border backdrop-blur-xl\"\n />\n\n <span aria-hidden=\"true\" className=\"pointer-events-none absolute inset-0\">\n <span className=\"absolute top-0 left-1/2 block h-0 w-0\">\n <AnimatePresence initial={false}>\n {!isExpanded\n ? previewItems.map((preview, index) => {\n const opened = getPreviewTransform(index, previewItems.length);\n return (\n <motion.span\n key={preview.id}\n layoutId={`file-${preview.id}`}\n initial={false}\n animate={\n isOpen && !reduce\n ? {\n x: opened.x * 1.4,\n y: opened.y - 8,\n rotate: opened.rotate * 1.3,\n scale: opened.scale * 1.02,\n opacity: Math.min(1, opened.opacity + 0.18),\n }\n : {\n x: opened.x,\n y: opened.y,\n rotate: opened.rotate,\n scale: opened.scale,\n opacity: opened.opacity,\n }\n }\n transition={transition}\n onLayoutAnimationComplete={() => {\n if (isClosing && index === 0) finishClose();\n }}\n className=\"border-foreground/10 bg-background/45 absolute top-0 left-0 -ml-12 block h-40 w-24 overflow-hidden rounded-lg border backdrop-blur-lg\"\n style={{ zIndex: opened.zIndex }}\n >\n {preview.content}\n </motion.span>\n );\n })\n : null}\n </AnimatePresence>\n </span>\n </span>\n\n <motion.span\n initial={false}\n animate={{ rotateX: isOpen && !reduce ? -25 : 0 }}\n transition={transition}\n className=\"border-foreground/10 bg-background/60 absolute inset-x-0 bottom-0 z-20 origin-[center_bottom] overflow-hidden rounded-2xl border backdrop-blur-2xl backface-hidden\"\n >\n <span className=\"flex h-16 items-center px-4\">\n <span className=\"text-foreground line-clamp-2 text-xl leading-tight font-medium\">\n {title}\n </span>\n </span>\n <span className=\"border-foreground/10 flex h-12 items-center justify-between gap-3 border-t px-4\">\n <span className=\"text-foreground/70 shrink-0 text-sm font-medium\">{countText}</span>\n <span className=\"text-muted-foreground truncate text-sm\">{description}</span>\n </span>\n </motion.span>\n </motion.button>\n\n {mounted ? createPortal(overlay, document.body) : null}\n </LayoutGroup>\n );\n}\n"],"mappings":";;;;;;;;;;AAwCA,MAAM,eAAe;AACrB,MAAM,qBAAqB;CACzB;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,CAAC,KAAK,GAAG;AAEV,SAAS,oBAAoB,OAAe,OAAe;CACzD,MAAM,SAAS,SAAS,QAAQ,KAAK;CACrC,MAAM,WAAW,KAAK,IAAI,MAAM;CAChC,MAAM,aAAa,KAAK,IAAI,GAAG,IAAI,QAAQ,IAAI;CAE/C,OAAO;EACL,GAAG,SAAS;EACZ,GAAG,IAAI;EACP,QAAQ,SAAS;EACjB,OAAO,aAAa,IAAI,OAAO,aAAa,IAAI,MAAO;EACvD,SAAS,aAAa,IAAI,IAAI,aAAa,IAAI,MAAO;EACtD,QAAQ,KAAK;CACf;AACF;AAEA,SAAgB,cAAc,EAC5B,OACA,cAAc,oBACd,WAAW,CAAC,GACZ,QAAQ,SAAS,QACjB,YAAY,QACZ,MACA,cAAc,OACd,cACA,UACA,kBAAkB,OAClB,kBACA,SACA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/pull-to-refresh.d.ts
|
|
3
2
|
export type PullToRefreshStatus = "idle" | "pulling" | "ready" | "refreshing";
|
|
4
3
|
export interface PullToRefreshProps {
|
|
5
4
|
/** Runs after the user pulls beyond the threshold and releases. */
|
|
@@ -23,5 +22,4 @@ export interface PullToRefreshProps {
|
|
|
23
22
|
indicatorClassName?: string;
|
|
24
23
|
}
|
|
25
24
|
export declare function PullToRefresh({ onRefresh, children, refreshing, disabled, threshold, maxPull, holdDistance, pullingLabel, releaseLabel, refreshingLabel, ariaLabel, className, contentClassName, indicatorClassName }: PullToRefreshProps): import("react").JSX.Element;
|
|
26
|
-
//#endregion
|
|
27
25
|
//# sourceMappingURL=pull-to-refresh.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pull-to-refresh.d.ts","names":[],"sources":["../../../src/components/motion/pull-to-refresh.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"pull-to-refresh.d.ts","names":[],"sources":["../../../src/components/motion/pull-to-refresh.tsx"],"mappings":";YAwBY;iBAEK;;EAEf,wBAAwB;EACxB,UAAU;;EAEV;EACA;;EAEA;;EAEA;;EAEA;EACA,eAAe;EACf,eAAe;EACf,kBAAkB;EAClB;EACA;EACA;EACA;;wBAsJc,gBACd,WACA,UACA,YACA,UACA,WACA,SACA,cACA,cACA,cACA,iBACA,WACA,WACA,kBACA,sBACC,qCAAkB,IAAA"}
|
|
@@ -5,7 +5,7 @@ import { useCallback, useEffect, useRef, useState } from "react";
|
|
|
5
5
|
import { cn } from "@kumix/utils";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { AnimatePresence, animate, motion, useMotionValue, useReducedMotion, useTransform } from "motion/react";
|
|
8
|
-
|
|
8
|
+
// src/components/motion/pull-to-refresh.tsx
|
|
9
9
|
const EMPTY_GESTURE = {
|
|
10
10
|
active: false,
|
|
11
11
|
startX: 0,
|
|
@@ -340,7 +340,7 @@ function PullToRefresh({ onRefresh, children, refreshing = false, disabled = fal
|
|
|
340
340
|
onPointerCancel: (event) => {
|
|
341
341
|
if (gestureRef.current.pointerId === event.pointerId) finishPull();
|
|
342
342
|
},
|
|
343
|
-
className: cn("relative w-full overflow-y-auto overscroll-contain
|
|
343
|
+
className: cn("bg-background relative w-full overflow-y-auto overscroll-contain", TOUCH_GESTURE_CONTENT_CLASS, status === "pulling" || status === "ready" ? "cursor-grabbing select-none" : "cursor-grab", (disabled || isRefreshing) && "cursor-default", className),
|
|
344
344
|
children: [/* @__PURE__ */ jsxs(motion.div, {
|
|
345
345
|
"aria-live": "polite",
|
|
346
346
|
"aria-atomic": "true",
|
|
@@ -348,7 +348,7 @@ function PullToRefresh({ onRefresh, children, refreshing = false, disabled = fal
|
|
|
348
348
|
opacity: indicatorOpacity,
|
|
349
349
|
scale: indicatorScale
|
|
350
350
|
},
|
|
351
|
-
className: cn("pointer-events-none absolute inset-x-0 top-0 z-20 flex h-[4.25rem] flex-col items-center justify-center gap-0.5 bg-linear-to-b
|
|
351
|
+
className: cn("from-background via-background/95 text-muted-foreground pointer-events-none absolute inset-x-0 top-0 z-20 flex h-[4.25rem] flex-col items-center justify-center gap-0.5 bg-linear-to-b to-transparent text-[11px] font-medium", indicatorClassName),
|
|
352
352
|
children: [/* @__PURE__ */ jsx(RefreshBuddy, {
|
|
353
353
|
progress,
|
|
354
354
|
status,
|
|
@@ -384,7 +384,6 @@ function PullToRefresh({ onRefresh, children, refreshing = false, disabled = fal
|
|
|
384
384
|
})]
|
|
385
385
|
});
|
|
386
386
|
}
|
|
387
|
-
//#endregion
|
|
388
387
|
export { PullToRefresh };
|
|
389
388
|
|
|
390
389
|
//# sourceMappingURL=pull-to-refresh.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pull-to-refresh.js","names":[],"sources":["../../../src/components/motion/pull-to-refresh.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ReactNode,\n type PointerEvent as ReactPointerEvent,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport {\n AnimatePresence,\n animate,\n type MotionValue,\n motion,\n useMotionValue,\n useReducedMotion,\n useTransform,\n} from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_IN_OUT, EASE_OUT, SPRING_PANEL, SPRING_SWAP } from \"../../lib/ease\";\nimport { capturePointer, TOUCH_GESTURE_CONTENT_CLASS } from \"../../lib/touch\";\n\nexport type PullToRefreshStatus = \"idle\" | \"pulling\" | \"ready\" | \"refreshing\";\n\nexport interface PullToRefreshProps {\n /** Runs after the user pulls beyond the threshold and releases. */\n onRefresh: () => void | Promise<void>;\n children: ReactNode;\n /** Keeps the indicator active while an externally managed refresh runs. */\n refreshing?: boolean;\n disabled?: boolean;\n /** Resisted pull distance in pixels required to refresh. */\n threshold?: number;\n /** Maximum resisted pull distance in pixels. */\n maxPull?: number;\n /** Content offset in pixels while refreshing. */\n holdDistance?: number;\n pullingLabel?: ReactNode;\n releaseLabel?: ReactNode;\n refreshingLabel?: ReactNode;\n ariaLabel?: string;\n className?: string;\n contentClassName?: string;\n indicatorClassName?: string;\n}\n\ntype Gesture = {\n active: boolean;\n startX: number;\n startY: number;\n pointerId: number | null;\n};\n\nconst EMPTY_GESTURE: Gesture = {\n active: false,\n startX: 0,\n startY: 0,\n pointerId: null,\n};\n\n// This character needs a compact repeating rhythm rather than a settling\n// spring: a small orbit and blink that read as activity without feeling busy.\nconst CHARACTER_LOOP = {\n duration: 0.9,\n ease: EASE_IN_OUT,\n repeat: Number.POSITIVE_INFINITY,\n} as const;\nconst CALM_PULSE = {\n duration: 1.2,\n ease: EASE_IN_OUT,\n repeat: Number.POSITIVE_INFINITY,\n} as const;\nconst LABEL_SWAP = { duration: 0.16, ease: EASE_OUT } as const;\n\nfunction resistedDistance(distance: number, maxPull: number) {\n return maxPull * (1 - Math.exp(-Math.max(0, distance) / maxPull));\n}\n\nfunction RefreshBuddy({\n progress,\n status,\n reduce,\n}: {\n progress: MotionValue<number>;\n status: PullToRefreshStatus;\n reduce: boolean;\n}) {\n const lift = useTransform(progress, [0, 1], [-7, 0]);\n const tilt = useTransform(progress, [0, 1], [-10, 0]);\n const stretch = useTransform(progress, [0, 0.55, 1], [0.68, 1.1, 0.92]);\n const ready = status === \"ready\";\n const refreshing = status === \"refreshing\";\n\n return (\n <motion.span\n style={reduce ? undefined : { y: lift, rotate: tilt, scaleY: stretch }}\n className=\"block h-9 w-9 origin-bottom\"\n >\n <motion.svg\n aria-hidden=\"true\"\n viewBox=\"0 0 36 36\"\n style={{ opacity: 1 }}\n className=\"h-full w-full overflow-visible\"\n animate={\n refreshing\n ? reduce\n ? { opacity: [0.55, 1, 0.55] }\n : { y: [0, -2, 0], rotate: [-3, 3, -3] }\n : reduce\n ? { opacity: 1 }\n : { y: 0, rotate: 0, scale: ready ? 1.08 : 1 }\n }\n transition={refreshing ? (reduce ? CALM_PULSE : CHARACTER_LOOP) : SPRING_SWAP}\n >\n <motion.g\n style={{ transformOrigin: \"18px 18px\" }}\n animate={\n refreshing && !reduce\n ? { rotate: [0, 360] }\n : reduce\n ? undefined\n : { rotate: ready ? 0 : -35 }\n }\n transition={refreshing ? (reduce ? CALM_PULSE : CHARACTER_LOOP) : SPRING_SWAP}\n className={cn(\n \"transition-opacity duration-150\",\n ready || refreshing ? \"opacity-100\" : \"opacity-0\",\n )}\n >\n <path\n d=\"M18 2.5a15.5 15.5 0 0 1 12.7 6.6\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n className=\"text-muted-foreground\"\n />\n <circle cx=\"31.3\" cy=\"10.2\" r=\"2.2\" className=\"fill-foreground\" />\n </motion.g>\n\n <rect x=\"7\" y=\"7\" width=\"22\" height=\"22\" rx=\"9\" className=\"fill-foreground\" />\n\n <motion.g\n style={{ opacity: 1, transformOrigin: \"18px 16px\" }}\n animate={\n refreshing && !reduce\n ? { scaleY: [1, 1, 0.15, 1, 1] }\n : reduce\n ? { opacity: 1 }\n : { scaleY: ready ? 1.18 : 1 }\n }\n transition={refreshing && !reduce ? CHARACTER_LOOP : SPRING_SWAP}\n >\n <circle cx=\"14.2\" cy=\"16\" r=\"1.45\" className=\"fill-background\" />\n <circle cx=\"21.8\" cy=\"16\" r=\"1.45\" className=\"fill-background\" />\n </motion.g>\n\n <path\n d=\"M14.5 21h7\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n className={cn(\n \"text-background transition-opacity duration-150\",\n ready || refreshing ? \"opacity-0\" : \"opacity-100\",\n )}\n />\n <path\n d=\"M14 20.5c1 2.4 7 2.4 8 0\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n className={cn(\n \"text-background transition-opacity duration-150\",\n ready ? \"opacity-100\" : \"opacity-0\",\n )}\n />\n <circle\n cx=\"18\"\n cy=\"21\"\n r=\"1.6\"\n className={cn(\n \"fill-background transition-opacity duration-150\",\n refreshing ? \"opacity-100\" : \"opacity-0\",\n )}\n />\n </motion.svg>\n </motion.span>\n );\n}\n\nexport function PullToRefresh({\n onRefresh,\n children,\n refreshing = false,\n disabled = false,\n threshold = 76,\n maxPull = 132,\n holdDistance = 68,\n pullingLabel = \"Pull to refresh\",\n releaseLabel = \"Release to refresh\",\n refreshingLabel = \"Refreshing\",\n ariaLabel = \"Refreshable content\",\n className,\n contentClassName,\n indicatorClassName,\n}: PullToRefreshProps) {\n const rootRef = useRef<HTMLElement>(null);\n const gestureRef = useRef<Gesture>({ ...EMPTY_GESTURE });\n const animationRef = useRef<{ stop: () => void } | null>(null);\n const statusRef = useRef<PullToRefreshStatus>(\"idle\");\n const disabledRef = useRef(disabled);\n const externalRefreshingRef = useRef(refreshing);\n const refreshingRef = useRef(refreshing);\n const [status, setStatusState] = useState<PullToRefreshStatus>(\"idle\");\n const [internalRefreshing, setInternalRefreshing] = useState(false);\n const reduce = useReducedMotion();\n const pullThreshold = Math.max(24, threshold);\n const pullLimit = Math.max(maxPull, pullThreshold + 24);\n const restingDistance = Math.min(Math.max(0, holdDistance), pullThreshold);\n const y = useMotionValue(0);\n const progress = useTransform(y, [0, pullThreshold], [0, 1]);\n const indicatorOpacity = useTransform(y, [0, 10, pullThreshold], [0, 0.45, 1]);\n const indicatorScale = useTransform(y, [0, pullThreshold], [0.86, 1]);\n const isRefreshing = refreshing || internalRefreshing;\n\n disabledRef.current = disabled;\n externalRefreshingRef.current = refreshing;\n refreshingRef.current = isRefreshing;\n\n const setStatus = useCallback((next: PullToRefreshStatus) => {\n if (statusRef.current === next) return;\n statusRef.current = next;\n setStatusState(next);\n }, []);\n\n const settle = useCallback(\n (target: number) => {\n animationRef.current?.stop();\n\n if (reduce) {\n y.set(target);\n return;\n }\n\n animationRef.current = animate(y, target, SPRING_PANEL);\n },\n [reduce, y],\n );\n\n const updatePull = useCallback(\n (distance: number) => {\n if (disabledRef.current || refreshingRef.current) return;\n animationRef.current?.stop();\n\n const next = resistedDistance(distance, pullLimit);\n y.set(next);\n setStatus(next >= pullThreshold ? \"ready\" : \"pulling\");\n },\n [pullLimit, pullThreshold, setStatus, y],\n );\n\n const runRefresh = useCallback(async () => {\n if (disabledRef.current || refreshingRef.current) return;\n\n setInternalRefreshing(true);\n setStatus(\"refreshing\");\n settle(restingDistance);\n\n try {\n await onRefresh();\n } finally {\n setInternalRefreshing(false);\n\n // A synchronous refresh can resolve before React commits the temporary\n // internal state, so release here instead of relying only on the effect.\n if (!externalRefreshingRef.current) {\n setStatus(\"idle\");\n settle(0);\n }\n }\n }, [onRefresh, restingDistance, setStatus, settle]);\n\n const finishPull = useCallback(() => {\n const shouldRefresh =\n y.get() >= pullThreshold && !disabledRef.current && !refreshingRef.current;\n\n gestureRef.current = { ...EMPTY_GESTURE };\n\n if (shouldRefresh) {\n void runRefresh();\n return;\n }\n\n setStatus(\"idle\");\n settle(0);\n }, [pullThreshold, runRefresh, setStatus, settle, y]);\n\n useEffect(() => {\n if (isRefreshing) {\n setStatus(\"refreshing\");\n settle(restingDistance);\n return;\n }\n\n if (statusRef.current === \"refreshing\") {\n setStatus(\"idle\");\n settle(0);\n }\n }, [isRefreshing, restingDistance, setStatus, settle]);\n\n useEffect(() => {\n const root = rootRef.current;\n if (!root) return;\n\n const onTouchStart = (event: TouchEvent) => {\n if (\n event.touches.length !== 1 ||\n root.scrollTop > 0 ||\n disabledRef.current ||\n refreshingRef.current\n ) {\n return;\n }\n\n const touch = event.touches[0];\n gestureRef.current = {\n active: true,\n startX: touch.clientX,\n startY: touch.clientY,\n pointerId: null,\n };\n };\n\n const onTouchMove = (event: TouchEvent) => {\n const gesture = gestureRef.current;\n const touch = event.touches[0];\n if (!gesture.active || !touch) return;\n\n const deltaX = touch.clientX - gesture.startX;\n const deltaY = touch.clientY - gesture.startY;\n\n if (root.scrollTop > 0 || deltaY < 0) {\n gestureRef.current = { ...EMPTY_GESTURE };\n return;\n }\n\n if (Math.abs(deltaX) > deltaY) return;\n\n event.preventDefault();\n updatePull(deltaY);\n };\n\n const onTouchEnd = () => {\n if (gestureRef.current.active) finishPull();\n };\n\n root.addEventListener(\"touchstart\", onTouchStart, { passive: true });\n root.addEventListener(\"touchmove\", onTouchMove, { passive: false });\n root.addEventListener(\"touchend\", onTouchEnd);\n root.addEventListener(\"touchcancel\", onTouchEnd);\n\n return () => {\n root.removeEventListener(\"touchstart\", onTouchStart);\n root.removeEventListener(\"touchmove\", onTouchMove);\n root.removeEventListener(\"touchend\", onTouchEnd);\n root.removeEventListener(\"touchcancel\", onTouchEnd);\n };\n }, [finishPull, updatePull]);\n\n useEffect(() => {\n return () => animationRef.current?.stop();\n }, []);\n\n const startPointerPull = (event: ReactPointerEvent<HTMLElement>) => {\n // Everything but touch: a finger is driven by the native listeners above,\n // which can `preventDefault` the page scroll a passive React handler\n // cannot. A pen fires no touch events at all, so this is its only route.\n if (\n event.pointerType === \"touch\" ||\n event.button !== 0 ||\n event.currentTarget.scrollTop > 0 ||\n disabled ||\n isRefreshing\n ) {\n return;\n }\n\n capturePointer(event.currentTarget, event.pointerId);\n gestureRef.current = {\n active: true,\n startX: event.clientX,\n startY: event.clientY,\n pointerId: event.pointerId,\n };\n };\n\n const movePointerPull = (event: ReactPointerEvent<HTMLElement>) => {\n const gesture = gestureRef.current;\n if (!gesture.active || gesture.pointerId !== event.pointerId) return;\n\n const deltaX = event.clientX - gesture.startX;\n const deltaY = event.clientY - gesture.startY;\n if (deltaY < 0 || Math.abs(deltaX) > deltaY) return;\n\n event.preventDefault();\n updatePull(deltaY);\n };\n\n const label =\n status === \"refreshing\" ? refreshingLabel : status === \"ready\" ? releaseLabel : pullingLabel;\n\n return (\n <section\n ref={rootRef}\n aria-label={ariaLabel}\n aria-busy={isRefreshing}\n data-state={status}\n data-disabled={disabled || undefined}\n onPointerDown={startPointerPull}\n onPointerMove={movePointerPull}\n onPointerUp={(event) => {\n if (gestureRef.current.pointerId === event.pointerId) finishPull();\n }}\n onPointerCancel={(event) => {\n if (gestureRef.current.pointerId === event.pointerId) finishPull();\n }}\n className={cn(\n \"relative w-full overflow-y-auto overscroll-contain bg-background\",\n // No `touch-none` here — this element is the scroller, and the pull\n // only takes over once the content is already at the top. The callout\n // has to be off from the first frame though: iOS decides on it while\n // the finger is still resting, long before the pull is recognised.\n // Whatever the consumer renders inside stays selectable with a mouse;\n // only the pull itself suppresses selection, and only while it runs,\n // so dragging the page down cannot highlight it on the way.\n TOUCH_GESTURE_CONTENT_CLASS,\n status === \"pulling\" || status === \"ready\" ? \"cursor-grabbing select-none\" : \"cursor-grab\",\n (disabled || isRefreshing) && \"cursor-default\",\n className,\n )}\n >\n <motion.div\n aria-live=\"polite\"\n aria-atomic=\"true\"\n style={\n reduce\n ? { opacity: indicatorOpacity }\n : { opacity: indicatorOpacity, scale: indicatorScale }\n }\n className={cn(\n \"pointer-events-none absolute inset-x-0 top-0 z-20 flex h-[4.25rem] flex-col items-center justify-center gap-0.5 bg-linear-to-b from-background via-background/95 to-transparent font-medium text-[11px] text-muted-foreground\",\n indicatorClassName,\n )}\n >\n <RefreshBuddy progress={progress} status={status} reduce={Boolean(reduce)} />\n <span className=\"relative h-4 min-w-24 text-center\">\n <AnimatePresence initial={false} mode=\"wait\">\n <motion.span\n key={status}\n initial={reduce ? { opacity: 0 } : { opacity: 0, y: 3 }}\n animate={reduce ? { opacity: 1 } : { opacity: 1, y: 0 }}\n exit={reduce ? { opacity: 0 } : { opacity: 0, y: -3 }}\n transition={LABEL_SWAP}\n className=\"absolute inset-x-0 whitespace-nowrap\"\n >\n {label}\n </motion.span>\n </AnimatePresence>\n </span>\n </motion.div>\n\n <motion.div\n style={reduce ? undefined : { y }}\n className={cn(\n \"relative z-10 min-h-full bg-inherit will-change-transform\",\n contentClassName,\n )}\n >\n {children}\n </motion.div>\n </section>\n );\n}\n"],"mappings":";;;;;;;;AAuDA,MAAM,gBAAyB;CAC7B,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,WAAW;AACb;AAIA,MAAM,iBAAiB;CACrB,UAAU;CACV,MAAM;CACN,QAAQ,OAAO;AACjB;AACA,MAAM,aAAa;CACjB,UAAU;CACV,MAAM;CACN,QAAQ,OAAO;AACjB;AACA,MAAM,aAAa;CAAE,UAAU;CAAM,MAAM;AAAS;AAEpD,SAAS,iBAAiB,UAAkB,SAAiB;CAC3D,OAAO,WAAW,IAAI,KAAK,IAAI,CAAC,KAAK,IAAI,GAAG,QAAQ,IAAI,OAAO;AACjE;AAEA,SAAS,aAAa,EACpB,UACA,QACA,UAKC;CACD,MAAM,OAAO,aAAa,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;CACnD,MAAM,OAAO,aAAa,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACpD,MAAM,UAAU,aAAa,UAAU;EAAC;EAAG;EAAM;CAAC,GAAG;EAAC;EAAM;EAAK;CAAI,CAAC;CACtE,MAAM,QAAQ,WAAW;CACzB,MAAM,aAAa,WAAW;CAE9B,OACE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cAAc,UAAU;GACtB,IAAI,WAAW,QAAQ,cAAc,MAAM,WAAW,WAAW;EACnE;EACA,kBAAkB,UAAU;GAC1B,IAAI,WAAW,QAAQ,cAAc,MAAM,WAAW,WAAW;EACnE;EACA,WAAW,GACT,oEAQA,6BACA,WAAW,aAAa,WAAW,UAAU,gCAAgC,gBAC5E,YAAY,iBAAiB,kBAC9B,SACF;EA3BF,UAAA,CA6BE,qBAAC,OAAO,KAAR;GACE,aAAU;GACV,eAAY;GACZ,OACE,SACI,EAAE,SAAS,iBAAiB,IAC5B;IAAE,SAAS;IAAkB,OAAO;GAAe;GAEzD,WAAW,GACT,iOACA,kBACF;GAXF,UAAA,CAaE,oBAAC,cAAD;IAAwB;IAAkB;IAAQ,QAAQ,QAAQ,MAAM;GAAI,CAAA,GAC5E,oBAAC,QAAD;IAAM,WAAU;IACd,UAAA,oBAAC,iBAAD;KAAiB,SAAS;KAAO,MAAK;KACpC,UAAA,oBAAC,OAAO,MAAR;MAEE,SAAS,SAAS,EAAE,SAAS,EAAE,IAAI;OAAE,SAAS;OAAG,GAAG;MAAE;MACtD,SAAS,SAAS,EAAE,SAAS,EAAE,IAAI;OAAE,SAAS;OAAG,GAAG;MAAE;MACtD,MAAM,SAAS,EAAE,SAAS,EAAE,IAAI;OAAE,SAAS;OAAG,GAAG;MAAG;MACpD,YAAY;MACZ,WAAU;MAET,UAAA;KACU,GARN,MAQM;IACE,CAAA;GACb,CAAA,CACI;EAEZ,CAAA,GAAA,oBAAC,OAAO,KAAR;GACE,OAAO,SAAS,KAAA,IAAY,EAAE,EAAE;GAChC,WAAW,GACT,6DACA,gBACF;GAEC;EACS,CAAA,CACL;;AAEb"}
|
|
1
|
+
{"version":3,"file":"pull-to-refresh.js","names":[],"sources":["../../../src/components/motion/pull-to-refresh.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ReactNode,\n type PointerEvent as ReactPointerEvent,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport {\n AnimatePresence,\n animate,\n type MotionValue,\n motion,\n useMotionValue,\n useReducedMotion,\n useTransform,\n} from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_IN_OUT, EASE_OUT, SPRING_PANEL, SPRING_SWAP } from \"../../lib/ease\";\nimport { capturePointer, TOUCH_GESTURE_CONTENT_CLASS } from \"../../lib/touch\";\n\nexport type PullToRefreshStatus = \"idle\" | \"pulling\" | \"ready\" | \"refreshing\";\n\nexport interface PullToRefreshProps {\n /** Runs after the user pulls beyond the threshold and releases. */\n onRefresh: () => void | Promise<void>;\n children: ReactNode;\n /** Keeps the indicator active while an externally managed refresh runs. */\n refreshing?: boolean;\n disabled?: boolean;\n /** Resisted pull distance in pixels required to refresh. */\n threshold?: number;\n /** Maximum resisted pull distance in pixels. */\n maxPull?: number;\n /** Content offset in pixels while refreshing. */\n holdDistance?: number;\n pullingLabel?: ReactNode;\n releaseLabel?: ReactNode;\n refreshingLabel?: ReactNode;\n ariaLabel?: string;\n className?: string;\n contentClassName?: string;\n indicatorClassName?: string;\n}\n\ntype Gesture = {\n active: boolean;\n startX: number;\n startY: number;\n pointerId: number | null;\n};\n\nconst EMPTY_GESTURE: Gesture = {\n active: false,\n startX: 0,\n startY: 0,\n pointerId: null,\n};\n\n// This character needs a compact repeating rhythm rather than a settling\n// spring: a small orbit and blink that read as activity without feeling busy.\nconst CHARACTER_LOOP = {\n duration: 0.9,\n ease: EASE_IN_OUT,\n repeat: Number.POSITIVE_INFINITY,\n} as const;\nconst CALM_PULSE = {\n duration: 1.2,\n ease: EASE_IN_OUT,\n repeat: Number.POSITIVE_INFINITY,\n} as const;\nconst LABEL_SWAP = { duration: 0.16, ease: EASE_OUT } as const;\n\nfunction resistedDistance(distance: number, maxPull: number) {\n return maxPull * (1 - Math.exp(-Math.max(0, distance) / maxPull));\n}\n\nfunction RefreshBuddy({\n progress,\n status,\n reduce,\n}: {\n progress: MotionValue<number>;\n status: PullToRefreshStatus;\n reduce: boolean;\n}) {\n const lift = useTransform(progress, [0, 1], [-7, 0]);\n const tilt = useTransform(progress, [0, 1], [-10, 0]);\n const stretch = useTransform(progress, [0, 0.55, 1], [0.68, 1.1, 0.92]);\n const ready = status === \"ready\";\n const refreshing = status === \"refreshing\";\n\n return (\n <motion.span\n style={reduce ? undefined : { y: lift, rotate: tilt, scaleY: stretch }}\n className=\"block h-9 w-9 origin-bottom\"\n >\n <motion.svg\n aria-hidden=\"true\"\n viewBox=\"0 0 36 36\"\n style={{ opacity: 1 }}\n className=\"h-full w-full overflow-visible\"\n animate={\n refreshing\n ? reduce\n ? { opacity: [0.55, 1, 0.55] }\n : { y: [0, -2, 0], rotate: [-3, 3, -3] }\n : reduce\n ? { opacity: 1 }\n : { y: 0, rotate: 0, scale: ready ? 1.08 : 1 }\n }\n transition={refreshing ? (reduce ? CALM_PULSE : CHARACTER_LOOP) : SPRING_SWAP}\n >\n <motion.g\n style={{ transformOrigin: \"18px 18px\" }}\n animate={\n refreshing && !reduce\n ? { rotate: [0, 360] }\n : reduce\n ? undefined\n : { rotate: ready ? 0 : -35 }\n }\n transition={refreshing ? (reduce ? CALM_PULSE : CHARACTER_LOOP) : SPRING_SWAP}\n className={cn(\n \"transition-opacity duration-150\",\n ready || refreshing ? \"opacity-100\" : \"opacity-0\",\n )}\n >\n <path\n d=\"M18 2.5a15.5 15.5 0 0 1 12.7 6.6\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n className=\"text-muted-foreground\"\n />\n <circle cx=\"31.3\" cy=\"10.2\" r=\"2.2\" className=\"fill-foreground\" />\n </motion.g>\n\n <rect x=\"7\" y=\"7\" width=\"22\" height=\"22\" rx=\"9\" className=\"fill-foreground\" />\n\n <motion.g\n style={{ opacity: 1, transformOrigin: \"18px 16px\" }}\n animate={\n refreshing && !reduce\n ? { scaleY: [1, 1, 0.15, 1, 1] }\n : reduce\n ? { opacity: 1 }\n : { scaleY: ready ? 1.18 : 1 }\n }\n transition={refreshing && !reduce ? CHARACTER_LOOP : SPRING_SWAP}\n >\n <circle cx=\"14.2\" cy=\"16\" r=\"1.45\" className=\"fill-background\" />\n <circle cx=\"21.8\" cy=\"16\" r=\"1.45\" className=\"fill-background\" />\n </motion.g>\n\n <path\n d=\"M14.5 21h7\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n className={cn(\n \"text-background transition-opacity duration-150\",\n ready || refreshing ? \"opacity-0\" : \"opacity-100\",\n )}\n />\n <path\n d=\"M14 20.5c1 2.4 7 2.4 8 0\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n className={cn(\n \"text-background transition-opacity duration-150\",\n ready ? \"opacity-100\" : \"opacity-0\",\n )}\n />\n <circle\n cx=\"18\"\n cy=\"21\"\n r=\"1.6\"\n className={cn(\n \"fill-background transition-opacity duration-150\",\n refreshing ? \"opacity-100\" : \"opacity-0\",\n )}\n />\n </motion.svg>\n </motion.span>\n );\n}\n\nexport function PullToRefresh({\n onRefresh,\n children,\n refreshing = false,\n disabled = false,\n threshold = 76,\n maxPull = 132,\n holdDistance = 68,\n pullingLabel = \"Pull to refresh\",\n releaseLabel = \"Release to refresh\",\n refreshingLabel = \"Refreshing\",\n ariaLabel = \"Refreshable content\",\n className,\n contentClassName,\n indicatorClassName,\n}: PullToRefreshProps) {\n const rootRef = useRef<HTMLElement>(null);\n const gestureRef = useRef<Gesture>({ ...EMPTY_GESTURE });\n const animationRef = useRef<{ stop: () => void } | null>(null);\n const statusRef = useRef<PullToRefreshStatus>(\"idle\");\n const disabledRef = useRef(disabled);\n const externalRefreshingRef = useRef(refreshing);\n const refreshingRef = useRef(refreshing);\n const [status, setStatusState] = useState<PullToRefreshStatus>(\"idle\");\n const [internalRefreshing, setInternalRefreshing] = useState(false);\n const reduce = useReducedMotion();\n const pullThreshold = Math.max(24, threshold);\n const pullLimit = Math.max(maxPull, pullThreshold + 24);\n const restingDistance = Math.min(Math.max(0, holdDistance), pullThreshold);\n const y = useMotionValue(0);\n const progress = useTransform(y, [0, pullThreshold], [0, 1]);\n const indicatorOpacity = useTransform(y, [0, 10, pullThreshold], [0, 0.45, 1]);\n const indicatorScale = useTransform(y, [0, pullThreshold], [0.86, 1]);\n const isRefreshing = refreshing || internalRefreshing;\n\n disabledRef.current = disabled;\n externalRefreshingRef.current = refreshing;\n refreshingRef.current = isRefreshing;\n\n const setStatus = useCallback((next: PullToRefreshStatus) => {\n if (statusRef.current === next) return;\n statusRef.current = next;\n setStatusState(next);\n }, []);\n\n const settle = useCallback(\n (target: number) => {\n animationRef.current?.stop();\n\n if (reduce) {\n y.set(target);\n return;\n }\n\n animationRef.current = animate(y, target, SPRING_PANEL);\n },\n [reduce, y],\n );\n\n const updatePull = useCallback(\n (distance: number) => {\n if (disabledRef.current || refreshingRef.current) return;\n animationRef.current?.stop();\n\n const next = resistedDistance(distance, pullLimit);\n y.set(next);\n setStatus(next >= pullThreshold ? \"ready\" : \"pulling\");\n },\n [pullLimit, pullThreshold, setStatus, y],\n );\n\n const runRefresh = useCallback(async () => {\n if (disabledRef.current || refreshingRef.current) return;\n\n setInternalRefreshing(true);\n setStatus(\"refreshing\");\n settle(restingDistance);\n\n try {\n await onRefresh();\n } finally {\n setInternalRefreshing(false);\n\n // A synchronous refresh can resolve before React commits the temporary\n // internal state, so release here instead of relying only on the effect.\n if (!externalRefreshingRef.current) {\n setStatus(\"idle\");\n settle(0);\n }\n }\n }, [onRefresh, restingDistance, setStatus, settle]);\n\n const finishPull = useCallback(() => {\n const shouldRefresh =\n y.get() >= pullThreshold && !disabledRef.current && !refreshingRef.current;\n\n gestureRef.current = { ...EMPTY_GESTURE };\n\n if (shouldRefresh) {\n void runRefresh();\n return;\n }\n\n setStatus(\"idle\");\n settle(0);\n }, [pullThreshold, runRefresh, setStatus, settle, y]);\n\n useEffect(() => {\n if (isRefreshing) {\n setStatus(\"refreshing\");\n settle(restingDistance);\n return;\n }\n\n if (statusRef.current === \"refreshing\") {\n setStatus(\"idle\");\n settle(0);\n }\n }, [isRefreshing, restingDistance, setStatus, settle]);\n\n useEffect(() => {\n const root = rootRef.current;\n if (!root) return;\n\n const onTouchStart = (event: TouchEvent) => {\n if (\n event.touches.length !== 1 ||\n root.scrollTop > 0 ||\n disabledRef.current ||\n refreshingRef.current\n ) {\n return;\n }\n\n const touch = event.touches[0];\n gestureRef.current = {\n active: true,\n startX: touch.clientX,\n startY: touch.clientY,\n pointerId: null,\n };\n };\n\n const onTouchMove = (event: TouchEvent) => {\n const gesture = gestureRef.current;\n const touch = event.touches[0];\n if (!gesture.active || !touch) return;\n\n const deltaX = touch.clientX - gesture.startX;\n const deltaY = touch.clientY - gesture.startY;\n\n if (root.scrollTop > 0 || deltaY < 0) {\n gestureRef.current = { ...EMPTY_GESTURE };\n return;\n }\n\n if (Math.abs(deltaX) > deltaY) return;\n\n event.preventDefault();\n updatePull(deltaY);\n };\n\n const onTouchEnd = () => {\n if (gestureRef.current.active) finishPull();\n };\n\n root.addEventListener(\"touchstart\", onTouchStart, { passive: true });\n root.addEventListener(\"touchmove\", onTouchMove, { passive: false });\n root.addEventListener(\"touchend\", onTouchEnd);\n root.addEventListener(\"touchcancel\", onTouchEnd);\n\n return () => {\n root.removeEventListener(\"touchstart\", onTouchStart);\n root.removeEventListener(\"touchmove\", onTouchMove);\n root.removeEventListener(\"touchend\", onTouchEnd);\n root.removeEventListener(\"touchcancel\", onTouchEnd);\n };\n }, [finishPull, updatePull]);\n\n useEffect(() => {\n return () => animationRef.current?.stop();\n }, []);\n\n const startPointerPull = (event: ReactPointerEvent<HTMLElement>) => {\n // Everything but touch: a finger is driven by the native listeners above,\n // which can `preventDefault` the page scroll a passive React handler\n // cannot. A pen fires no touch events at all, so this is its only route.\n if (\n event.pointerType === \"touch\" ||\n event.button !== 0 ||\n event.currentTarget.scrollTop > 0 ||\n disabled ||\n isRefreshing\n ) {\n return;\n }\n\n capturePointer(event.currentTarget, event.pointerId);\n gestureRef.current = {\n active: true,\n startX: event.clientX,\n startY: event.clientY,\n pointerId: event.pointerId,\n };\n };\n\n const movePointerPull = (event: ReactPointerEvent<HTMLElement>) => {\n const gesture = gestureRef.current;\n if (!gesture.active || gesture.pointerId !== event.pointerId) return;\n\n const deltaX = event.clientX - gesture.startX;\n const deltaY = event.clientY - gesture.startY;\n if (deltaY < 0 || Math.abs(deltaX) > deltaY) return;\n\n event.preventDefault();\n updatePull(deltaY);\n };\n\n const label =\n status === \"refreshing\" ? refreshingLabel : status === \"ready\" ? releaseLabel : pullingLabel;\n\n return (\n <section\n ref={rootRef}\n aria-label={ariaLabel}\n aria-busy={isRefreshing}\n data-state={status}\n data-disabled={disabled || undefined}\n onPointerDown={startPointerPull}\n onPointerMove={movePointerPull}\n onPointerUp={(event) => {\n if (gestureRef.current.pointerId === event.pointerId) finishPull();\n }}\n onPointerCancel={(event) => {\n if (gestureRef.current.pointerId === event.pointerId) finishPull();\n }}\n className={cn(\n \"bg-background relative w-full overflow-y-auto overscroll-contain\",\n // No `touch-none` here — this element is the scroller, and the pull\n // only takes over once the content is already at the top. The callout\n // has to be off from the first frame though: iOS decides on it while\n // the finger is still resting, long before the pull is recognised.\n // Whatever the consumer renders inside stays selectable with a mouse;\n // only the pull itself suppresses selection, and only while it runs,\n // so dragging the page down cannot highlight it on the way.\n TOUCH_GESTURE_CONTENT_CLASS,\n status === \"pulling\" || status === \"ready\" ? \"cursor-grabbing select-none\" : \"cursor-grab\",\n (disabled || isRefreshing) && \"cursor-default\",\n className,\n )}\n >\n <motion.div\n aria-live=\"polite\"\n aria-atomic=\"true\"\n style={\n reduce\n ? { opacity: indicatorOpacity }\n : { opacity: indicatorOpacity, scale: indicatorScale }\n }\n className={cn(\n \"from-background via-background/95 text-muted-foreground pointer-events-none absolute inset-x-0 top-0 z-20 flex h-[4.25rem] flex-col items-center justify-center gap-0.5 bg-linear-to-b to-transparent text-[11px] font-medium\",\n indicatorClassName,\n )}\n >\n <RefreshBuddy progress={progress} status={status} reduce={Boolean(reduce)} />\n <span className=\"relative h-4 min-w-24 text-center\">\n <AnimatePresence initial={false} mode=\"wait\">\n <motion.span\n key={status}\n initial={reduce ? { opacity: 0 } : { opacity: 0, y: 3 }}\n animate={reduce ? { opacity: 1 } : { opacity: 1, y: 0 }}\n exit={reduce ? { opacity: 0 } : { opacity: 0, y: -3 }}\n transition={LABEL_SWAP}\n className=\"absolute inset-x-0 whitespace-nowrap\"\n >\n {label}\n </motion.span>\n </AnimatePresence>\n </span>\n </motion.div>\n\n <motion.div\n style={reduce ? undefined : { y }}\n className={cn(\n \"relative z-10 min-h-full bg-inherit will-change-transform\",\n contentClassName,\n )}\n >\n {children}\n </motion.div>\n </section>\n );\n}\n"],"mappings":";;;;;;;;AAuDA,MAAM,gBAAyB;CAC7B,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,WAAW;AACb;AAIA,MAAM,iBAAiB;CACrB,UAAU;CACV,MAAM;CACN,QAAQ,OAAO;AACjB;AACA,MAAM,aAAa;CACjB,UAAU;CACV,MAAM;CACN,QAAQ,OAAO;AACjB;AACA,MAAM,aAAa;CAAE,UAAU;CAAM,MAAM;AAAS;AAEpD,SAAS,iBAAiB,UAAkB,SAAiB;CAC3D,OAAO,WAAW,IAAI,KAAK,IAAI,CAAC,KAAK,IAAI,GAAG,QAAQ,IAAI,OAAO;AACjE;AAEA,SAAS,aAAa,EACpB,UACA,QACA,UAKC;CACD,MAAM,OAAO,aAAa,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;CACnD,MAAM,OAAO,aAAa,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACpD,MAAM,UAAU,aAAa,UAAU;EAAC;EAAG;EAAM;CAAC,GAAG;EAAC;EAAM;EAAK;CAAI,CAAC;CACtE,MAAM,QAAQ,WAAW;CACzB,MAAM,aAAa,WAAW;CAE9B,OACE,oBAAC,OAAO,MAAR;EACE,OAAO,S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AQ,cAAc,MAAM,WAAW,WAAW;EACnE;EACA,kBAAkB,UAAU;GAC1B,IAAI,WAAW,QAAQ,cAAc,MAAM,WAAW,WAAW;EACnE;EACA,WAAW,GACT,oEAQA,6BACA,WAAW,aAAa,WAAW,UAAU,gCAAgC,gBAC5E,YAAY,iBAAiB,kBAC9B,SACF;EA3BF,UAAA,CA6BE,qBAAC,OAAO,KAAR;GACE,aAAU;GACV,eAAY;GACZ,OACE,SACI,EAAE,SAAS,iBAAiB,IAC5B;IAAE,SAAS;IAAkB,OAAO;GAAe;GAEzD,WAAW,GACT,iOACA,kBACF;GAXF,UAAA,CAaE,oBAAC,cAAD;IAAwB;IAAkB;IAAQ,QAAQ,QAAQ,MAAM;GAAI,CAAA,GAC5E,oBAAC,QAAD;IAAM,WAAU;IACd,UAAA,oBAAC,iBAAD;KAAiB,SAAS;KAAO,MAAK;KACpC,UAAA,oBAAC,OAAO,MAAR;MAEE,SAAS,SAAS,EAAE,SAAS,EAAE,IAAI;OAAE,SAAS;OAAG,GAAG;MAAE;MACtD,SAAS,SAAS,EAAE,SAAS,EAAE,IAAI;OAAE,SAAS;OAAG,GAAG;MAAE;MACtD,MAAM,SAAS,EAAE,SAAS,EAAE,IAAI;OAAE,SAAS;OAAG,GAAG;MAAG;MACpD,YAAY;MACZ,WAAU;MAET,UAAA;KACU,GARN,MAQM;IACE,CAAA;GACb,CAAA,CACI;EAEZ,CAAA,GAAA,oBAAC,OAAO,KAAR;GACE,OAAO,SAAS,KAAA,IAAY,EAAE,EAAE;GAChC,WAAW,GACT,6DACA,gBACF;GAEC;EACS,CAAA,CACL;;AAEb"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
//#region src/components/motion/radio.d.ts
|
|
3
2
|
export interface RadioGroupProps {
|
|
4
3
|
value?: string;
|
|
5
4
|
defaultValue?: string;
|
|
@@ -23,5 +22,4 @@ export interface RadioGroupItemProps {
|
|
|
23
22
|
id?: string;
|
|
24
23
|
}
|
|
25
24
|
export declare function RadioGroupItem({ value, label, description, disabled, className, id: idProp }: RadioGroupItemProps): import("react").JSX.Element;
|
|
26
|
-
//#endregion
|
|
27
25
|
//# sourceMappingURL=radio.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.d.ts","names":[],"sources":["../../../src/components/motion/radio.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"radio.d.ts","names":[],"sources":["../../../src/components/motion/radio.tsx"],"mappings":";iBA0CiB;EACf;EACA;EACA,iBAAiB;EACjB,UAAU;EACV;EACA;;EAEA;;EAEA;;wBAGc,aACd,OACA,cACA,eACA,UACA,WACA,2BACc,8BACK,kBAClB,kCAAe,IAAA;iBAyDD;EACf;EACA;;EAEA;EACA;EACA;EACA;;wBAGc,iBACd,OACA,OACA,aACA,UACA,WACA,IAAI,UACH,sCAAmB,IAAA"}
|
|
@@ -4,7 +4,7 @@ import { createContext, useCallback, useContext, useId, useLayoutEffect, useMemo
|
|
|
4
4
|
import { cn } from "@kumix/utils";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { MotionConfig, motion, useReducedMotion } from "motion/react";
|
|
7
|
-
|
|
7
|
+
// src/components/motion/radio.tsx
|
|
8
8
|
const RadioCtx = createContext(null);
|
|
9
9
|
function useRadioGroup() {
|
|
10
10
|
const ctx = useContext(RadioCtx);
|
|
@@ -113,14 +113,14 @@ function RadioGroupItem({ value, label, description, disabled, className, id: id
|
|
|
113
113
|
whileTap: reduce || disabled ? void 0 : { scale: .92 },
|
|
114
114
|
transition: SPRING_PRESS,
|
|
115
115
|
"data-state": selected ? "checked" : "unchecked",
|
|
116
|
-
className: cn("relative inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2
|
|
116
|
+
className: cn("relative inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-colors duration-200 outline-none", "focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2", "disabled:cursor-not-allowed disabled:opacity-60", selected ? "border-primary" : "border-muted-foreground/50 hover:border-muted-foreground"),
|
|
117
117
|
children: selected ? /* @__PURE__ */ jsx(motion.span, {
|
|
118
118
|
layoutId,
|
|
119
|
-
className: "absolute inset-1 rounded-full
|
|
119
|
+
className: "bg-primary absolute inset-1 rounded-full",
|
|
120
120
|
transition: reduce ? { duration: 0 } : SPRING_LAYOUT
|
|
121
121
|
}) : null
|
|
122
122
|
}), label || description ? /* @__PURE__ */ jsxs("span", {
|
|
123
|
-
className: cn("flex min-w-0
|
|
123
|
+
className: cn("flex min-w-0 flex-col gap-0.5 select-none", disabled && "opacity-60"),
|
|
124
124
|
children: [label ? /* @__PURE__ */ jsx("span", {
|
|
125
125
|
id: labelId,
|
|
126
126
|
className: cn("text-foreground text-sm", description && "leading-4"),
|
|
@@ -133,7 +133,6 @@ function RadioGroupItem({ value, label, description, disabled, className, id: id
|
|
|
133
133
|
}) : null]
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
|
-
//#endregion
|
|
137
136
|
export { RadioGroup, RadioGroupItem };
|
|
138
137
|
|
|
139
138
|
//# sourceMappingURL=radio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.js","names":[],"sources":["../../../src/components/motion/radio.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n createContext,\n type KeyboardEvent,\n type ReactNode,\n useCallback,\n useContext,\n useId,\n useLayoutEffect,\n useMemo,\n useState,\n} from \"react\";\nimport { MotionConfig, motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { SPRING_LAYOUT, SPRING_PRESS } from \"../../lib/ease\";\n\ntype RadioCtx = {\n value: string;\n setValue: (value: string) => void;\n layoutId: string;\n /**\n * The one option Tab reaches: the selected option, or the first enabled one\n * when nothing enabled is selected. `null` until the options have\n * registered, when every enabled option stays reachable.\n */\n tabStop: string | null;\n register: (value: string, disabled: boolean) => void;\n unregister: (value: string) => void;\n};\n\nconst RadioCtx = createContext<RadioCtx | null>(null);\n\nfunction useRadioGroup() {\n const ctx = useContext(RadioCtx);\n if (!ctx) {\n throw new Error(\"RadioGroupItem must be used inside <RadioGroup>\");\n }\n return ctx;\n}\n\nexport interface RadioGroupProps {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n children: ReactNode;\n className?: string;\n orientation?: \"vertical\" | \"horizontal\";\n /** Accessible name for the group when no visible label names it. */\n \"aria-label\"?: string;\n /** Id of a visible element that names the group. */\n \"aria-labelledby\"?: string;\n}\n\nexport function RadioGroup({\n value,\n defaultValue = \"\",\n onValueChange,\n children,\n className,\n orientation = \"vertical\",\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n}: RadioGroupProps) {\n const [internal, setInternal] = useState(defaultValue);\n const layoutId = useId();\n const reduce = useReducedMotion();\n const controlled = value !== undefined;\n const current = controlled ? value : internal;\n const setValue = useCallback(\n (next: string) => {\n if (!controlled) setInternal(next);\n onValueChange?.(next);\n },\n [controlled, onValueChange],\n );\n const [options, setOptions] = useState<Map<string, boolean>>(new Map());\n const register = useCallback((option: string, disabled: boolean) => {\n setOptions((map) => (map.get(option) === disabled ? map : new Map(map).set(option, disabled)));\n }, []);\n const unregister = useCallback((option: string) => {\n setOptions((map) => {\n if (!map.has(option)) return map;\n const next = new Map(map);\n next.delete(option);\n return next;\n });\n }, []);\n // Resolved during render so the group has exactly one tab stop in the same\n // commit that changes the selection or the options.\n let tabStop: string | null = null;\n if (options.size > 0) {\n const enabled = Array.from(options).filter(([, disabled]) => !disabled);\n tabStop = enabled.some(([option]) => option === current) ? current : (enabled[0]?.[0] ?? \"\");\n }\n const contextValue = useMemo(\n () => ({ value: current, setValue, layoutId, tabStop, register, unregister }),\n [current, layoutId, setValue, tabStop, register, unregister],\n );\n\n return (\n <MotionConfig transition={reduce ? { duration: 0 } : SPRING_LAYOUT}>\n <RadioCtx.Provider value={contextValue}>\n <div\n role=\"radiogroup\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={cn(\n \"flex gap-3\",\n orientation === \"vertical\" ? \"flex-col\" : \"flex-row flex-wrap\",\n className,\n )}\n >\n {children}\n </div>\n </RadioCtx.Provider>\n </MotionConfig>\n );\n}\n\nexport interface RadioGroupItemProps {\n value: string;\n label?: string;\n /** Supporting text under the label, announced as the description rather than the name. */\n description?: string;\n disabled?: boolean;\n className?: string;\n id?: string;\n}\n\nexport function RadioGroupItem({\n value,\n label,\n description,\n disabled,\n className,\n id: idProp,\n}: RadioGroupItemProps) {\n const { value: groupValue, setValue, layoutId, tabStop, register, unregister } = useRadioGroup();\n const autoId = useId();\n const id = idProp ?? autoId;\n const reduce = useReducedMotion();\n const selected = groupValue === value;\n const descriptionId = description ? `${id}-description` : undefined;\n // The wrapping <label> would fold the description into the name, so name from the label text alone.\n const labelId = description && label ? `${id}-label` : undefined;\n\n useLayoutEffect(() => {\n register(value, Boolean(disabled));\n }, [register, value, disabled]);\n useLayoutEffect(() => () => unregister(value), [unregister, value]);\n\n const reachable = !disabled && (tabStop === null ? true : tabStop === value);\n\n // Arrow keys move to the next enabled option in the group, wrapping at the\n // ends, and select it as focus arrives, like native radio buttons.\n const onKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n const step =\n event.key === \"ArrowDown\" || event.key === \"ArrowRight\"\n ? 1\n : event.key === \"ArrowUp\" || event.key === \"ArrowLeft\"\n ? -1\n : 0;\n if (!step) return;\n const group = event.currentTarget.closest('[role=\"radiogroup\"]');\n const radios = Array.from(\n group?.querySelectorAll<HTMLButtonElement>('[role=\"radio\"]') ?? [],\n ).filter((radio) => !radio.disabled && radio.closest('[role=\"radiogroup\"]') === group);\n const at = radios.indexOf(event.currentTarget);\n if (at < 0 || radios.length < 2) return;\n event.preventDefault();\n const next = radios[(at + step + radios.length) % radios.length];\n next.focus();\n next.click();\n };\n\n return (\n <label\n htmlFor={id}\n className={cn(\n \"inline-flex gap-3\",\n description ? \"items-start\" : \"items-center\",\n disabled ? \"cursor-not-allowed\" : \"cursor-pointer\",\n className,\n )}\n >\n <motion.button\n id={id}\n type=\"button\"\n role=\"radio\"\n aria-checked={selected}\n aria-labelledby={labelId}\n aria-describedby={descriptionId}\n disabled={disabled}\n tabIndex={reachable ? 0 : -1}\n onClick={() => !disabled && setValue(value)}\n onKeyDown={onKeyDown}\n whileTap={reduce || disabled ? undefined : { scale: 0.92 }}\n transition={SPRING_PRESS}\n data-state={selected ? \"checked\" : \"unchecked\"}\n className={cn(\n \"relative inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 outline-none transition-colors duration-200\",\n \"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n \"disabled:cursor-not-allowed disabled:opacity-60\",\n selected ? \"border-primary\" : \"border-muted-foreground/50 hover:border-muted-foreground\",\n )}\n >\n {selected ? (\n <motion.span\n layoutId={layoutId}\n className=\"absolute inset-1 rounded-full bg-primary\"\n transition={reduce ? { duration: 0 } : SPRING_LAYOUT}\n />\n ) : null}\n </motion.button>\n {label || description ? (\n <span className={cn(\"flex min-w-0 select-none flex-col gap-0.5\", disabled && \"opacity-60\")}>\n {label ? (\n <span\n id={labelId}\n // Geist sits low in a 20px line; a 16px line lifts the text onto the control.\n className={cn(\"text-foreground text-sm\", description && \"leading-4\")}\n >\n {label}\n </span>\n ) : null}\n {description ? (\n <span id={descriptionId} className=\"text-muted-foreground text-xs\">\n {description}\n </span>\n ) : null}\n </span>\n ) : null}\n </label>\n );\n}\n"],"mappings":";;;;;;;AAgCA,MAAM,WAAW,cAA+B,IAAI;AAEpD,SAAS,gBAAgB;CACvB,MAAM,MAAM,WAAW,QAAQ;CAC/B,IAAI,CAAC,KACH,MAAM,IAAI,MAAM,iDAAiD;CAEnE,OAAO;AACT;AAeA,SAAgB,WAAW,EACzB,OACA,eAAe,IACf,eACA,UACA,WACA,cAAc,YACd,cAAc,WACd,mBAAmB,kBACD;CAClB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EACT,WAAW,GACT,qBACA,cAAc,gBAAgB,gBAC9B,WAAW,uBAAuB,kBAClC,SACF;EAPF,UAAA,CASE,oBAAC,OAAO,QAAR;GACM;GACJ,MAAK;GACL,MAAK;GACL,gBAAc;GACd,mBAAiB;GACjB,oBAAkB;GACR;GACV,UAAU,YAAY,IAAI;GAC1B,eAAe,CAAC,YAAY,SAAS,KAAK;GAC/B;GACX,UAAU,UAAU,WAAW,KAAA,IAAY,EAAE,OAAO,IAAK;GACzD,YAAY;GACZ,cAAY,WAAW,YAAY;GACnC,WAAW,GACT,uIACA,iHACA,mDACA,WAAW,mBAAmB,0DAChC;GAEC,UAAA,WACC,oBAAC,OAAO,MAAR;IACY;IACV,WAAU;IACV,YAAY,SAAS,EAAE,UAAU,EAAE,IAAI;GACxC,CAAA,IACC;EACS,CAAA,GACd,SAAS,cACR,qBAAC,QAAD;GAAM,WAAW,GAAG,6CAA6C,YAAY,YAAY;GAAzF,UAAA,CACG,QACC,oBAAC,QAAD;IACE,IAAI;IAEJ,WAAW,GAAG,2BAA2B,eAAe,WAAW;IAElE,UAAA;GACG,CAAA,IACJ,MACH,cACC,oBAAC,QAAD;IAAM,IAAI;IAAe,WAAU;IAChC,UAAA;GACG,CAAA,IACJ,IACA;EACJ,CAAA,IAAA,IACC;;AAEX"}
|
|
1
|
+
{"version":3,"file":"radio.js","names":[],"sources":["../../../src/components/motion/radio.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n createContext,\n type KeyboardEvent,\n type ReactNode,\n useCallback,\n useContext,\n useId,\n useLayoutEffect,\n useMemo,\n useState,\n} from \"react\";\nimport { MotionConfig, motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { SPRING_LAYOUT, SPRING_PRESS } from \"../../lib/ease\";\n\ntype RadioCtx = {\n value: string;\n setValue: (value: string) => void;\n layoutId: string;\n /**\n * The one option Tab reaches: the selected option, or the first enabled one\n * when nothing enabled is selected. `null` until the options have\n * registered, when every enabled option stays reachable.\n */\n tabStop: string | null;\n register: (value: string, disabled: boolean) => void;\n unregister: (value: string) => void;\n};\n\nconst RadioCtx = createContext<RadioCtx | null>(null);\n\nfunction useRadioGroup() {\n const ctx = useContext(RadioCtx);\n if (!ctx) {\n throw new Error(\"RadioGroupItem must be used inside <RadioGroup>\");\n }\n return ctx;\n}\n\nexport interface RadioGroupProps {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n children: ReactNode;\n className?: string;\n orientation?: \"vertical\" | \"horizontal\";\n /** Accessible name for the group when no visible label names it. */\n \"aria-label\"?: string;\n /** Id of a visible element that names the group. */\n \"aria-labelledby\"?: string;\n}\n\nexport function RadioGroup({\n value,\n defaultValue = \"\",\n onValueChange,\n children,\n className,\n orientation = \"vertical\",\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n}: RadioGroupProps) {\n const [internal, setInternal] = useState(defaultValue);\n const layoutId = useId();\n const reduce = useReducedMotion();\n const controlled = value !== undefined;\n const current = controlled ? value : internal;\n const setValue = useCallback(\n (next: string) => {\n if (!controlled) setInternal(next);\n onValueChange?.(next);\n },\n [controlled, onValueChange],\n );\n const [options, setOptions] = useState<Map<string, boolean>>(new Map());\n const register = useCallback((option: string, disabled: boolean) => {\n setOptions((map) => (map.get(option) === disabled ? map : new Map(map).set(option, disabled)));\n }, []);\n const unregister = useCallback((option: string) => {\n setOptions((map) => {\n if (!map.has(option)) return map;\n const next = new Map(map);\n next.delete(option);\n return next;\n });\n }, []);\n // Resolved during render so the group has exactly one tab stop in the same\n // commit that changes the selection or the options.\n let tabStop: string | null = null;\n if (options.size > 0) {\n const enabled = Array.from(options).filter(([, disabled]) => !disabled);\n tabStop = enabled.some(([option]) => option === current) ? current : (enabled[0]?.[0] ?? \"\");\n }\n const contextValue = useMemo(\n () => ({ value: current, setValue, layoutId, tabStop, register, unregister }),\n [current, layoutId, setValue, tabStop, register, unregister],\n );\n\n return (\n <MotionConfig transition={reduce ? { duration: 0 } : SPRING_LAYOUT}>\n <RadioCtx.Provider value={contextValue}>\n <div\n role=\"radiogroup\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={cn(\n \"flex gap-3\",\n orientation === \"vertical\" ? \"flex-col\" : \"flex-row flex-wrap\",\n className,\n )}\n >\n {children}\n </div>\n </RadioCtx.Provider>\n </MotionConfig>\n );\n}\n\nexport interface RadioGroupItemProps {\n value: string;\n label?: string;\n /** Supporting text under the label, announced as the description rather than the name. */\n description?: string;\n disabled?: boolean;\n className?: string;\n id?: string;\n}\n\nexport function RadioGroupItem({\n value,\n label,\n description,\n disabled,\n className,\n id: idProp,\n}: RadioGroupItemProps) {\n const { value: groupValue, setValue, layoutId, tabStop, register, unregister } = useRadioGroup();\n const autoId = useId();\n const id = idProp ?? autoId;\n const reduce = useReducedMotion();\n const selected = groupValue === value;\n const descriptionId = description ? `${id}-description` : undefined;\n // The wrapping <label> would fold the description into the name, so name from the label text alone.\n const labelId = description && label ? `${id}-label` : undefined;\n\n useLayoutEffect(() => {\n register(value, Boolean(disabled));\n }, [register, value, disabled]);\n useLayoutEffect(() => () => unregister(value), [unregister, value]);\n\n const reachable = !disabled && (tabStop === null ? true : tabStop === value);\n\n // Arrow keys move to the next enabled option in the group, wrapping at the\n // ends, and select it as focus arrives, like native radio buttons.\n const onKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n const step =\n event.key === \"ArrowDown\" || event.key === \"ArrowRight\"\n ? 1\n : event.key === \"ArrowUp\" || event.key === \"ArrowLeft\"\n ? -1\n : 0;\n if (!step) return;\n const group = event.currentTarget.closest('[role=\"radiogroup\"]');\n const radios = Array.from(\n group?.querySelectorAll<HTMLButtonElement>('[role=\"radio\"]') ?? [],\n ).filter((radio) => !radio.disabled && radio.closest('[role=\"radiogroup\"]') === group);\n const at = radios.indexOf(event.currentTarget);\n if (at < 0 || radios.length < 2) return;\n event.preventDefault();\n const next = radios[(at + step + radios.length) % radios.length];\n next.focus();\n next.click();\n };\n\n return (\n <label\n htmlFor={id}\n className={cn(\n \"inline-flex gap-3\",\n description ? \"items-start\" : \"items-center\",\n disabled ? \"cursor-not-allowed\" : \"cursor-pointer\",\n className,\n )}\n >\n <motion.button\n id={id}\n type=\"button\"\n role=\"radio\"\n aria-checked={selected}\n aria-labelledby={labelId}\n aria-describedby={descriptionId}\n disabled={disabled}\n tabIndex={reachable ? 0 : -1}\n onClick={() => !disabled && setValue(value)}\n onKeyDown={onKeyDown}\n whileTap={reduce || disabled ? undefined : { scale: 0.92 }}\n transition={SPRING_PRESS}\n data-state={selected ? \"checked\" : \"unchecked\"}\n className={cn(\n \"relative inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-colors duration-200 outline-none\",\n \"focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2\",\n \"disabled:cursor-not-allowed disabled:opacity-60\",\n selected ? \"border-primary\" : \"border-muted-foreground/50 hover:border-muted-foreground\",\n )}\n >\n {selected ? (\n <motion.span\n layoutId={layoutId}\n className=\"bg-primary absolute inset-1 rounded-full\"\n transition={reduce ? { duration: 0 } : SPRING_LAYOUT}\n />\n ) : null}\n </motion.button>\n {label || description ? (\n <span className={cn(\"flex min-w-0 flex-col gap-0.5 select-none\", disabled && \"opacity-60\")}>\n {label ? (\n <span\n id={labelId}\n // Geist sits low in a 20px line; a 16px line lifts the text onto the control.\n className={cn(\"text-foreground text-sm\", description && \"leading-4\")}\n >\n {label}\n </span>\n ) : null}\n {description ? (\n <span id={descriptionId} className=\"text-muted-foreground text-xs\">\n {description}\n </span>\n ) : null}\n </span>\n ) : null}\n </label>\n );\n}\n"],"mappings":";;;;;;;AAgCA,MAAM,WAAW,cAA+B,IAAI;AAEpD,SAAS,gBAAgB;CACvB,MAAM,MAAM,WAAW,QAAQ;CAC/B,IAAI,CAAC,KACH,MAAM,IAAI,MAAM,iDAAiD;CAEnE,OAAO;AACT;AAeA,SAAgB,WAAW,EACzB,OACA,eAAe,IACf,eACA,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AAK,MAAM;CACb;CAEA,OACE,qBAAC,SAAD;EACE,SAAS;EACT,WAAW,GACT,qBACA,cAAc,gBAAgB,gBAC9B,WAAW,uBAAuB,kBAClC,SACF;EAPF,UAAA,CASE,oBAAC,OAAO,QAAR;GACM;GACJ,MAAK;GACL,MAAK;GACL,gBAAc;GACd,mBAAiB;GACjB,oBAAkB;GACR;GACV,UAAU,YAAY,IAAI;GAC1B,eAAe,CAAC,YAAY,SAAS,KAAK;GAC/B;GACX,UAAU,UAAU,WAAW,KAAA,IAAY,EAAE,OAAO,IAAK;GACzD,YAAY;GACZ,cAAY,WAAW,YAAY;GACnC,WAAW,GACT,uIACA,iHACA,mDACA,WAAW,mBAAmB,0DAChC;GAEC,UAAA,WACC,oBAAC,OAAO,MAAR;IACY;IACV,WAAU;IACV,YAAY,SAAS,EAAE,UAAU,EAAE,IAAI;GACxC,CAAA,IACC;EACS,CAAA,GACd,SAAS,cACR,qBAAC,QAAD;GAAM,WAAW,GAAG,6CAA6C,YAAY,YAAY;GAAzF,UAAA,CACG,QACC,oBAAC,QAAD;IACE,IAAI;IAEJ,WAAW,GAAG,2BAA2B,eAAe,WAAW;IAElE,UAAA;GACG,CAAA,IACJ,MACH,cACC,oBAAC,QAAD;IAAM,IAAI;IAAe,WAAU;IAChC,UAAA;GACG,CAAA,IACJ,IACA;EACJ,CAAA,IAAA,IACC;;AAEX"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SliderOptions } from "../../hooks/use-slider.js";
|
|
2
|
-
//#region src/components/motion/range-slider-bubble.d.ts
|
|
3
2
|
export interface BubbleSliderProps extends SliderOptions {
|
|
4
3
|
/** Formats the value shown in the bubble. */
|
|
5
4
|
format?: (value: number) => string;
|
|
@@ -11,5 +10,4 @@ export interface BubbleSliderProps extends SliderOptions {
|
|
|
11
10
|
* the way, then settles upright when you let go.
|
|
12
11
|
*/
|
|
13
12
|
export declare function BubbleSlider({ format, className, ...options }: BubbleSliderProps): import("react").JSX.Element;
|
|
14
|
-
//#endregion
|
|
15
13
|
//# sourceMappingURL=range-slider-bubble.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range-slider-bubble.d.ts","names":[],"sources":["../../../src/components/motion/range-slider-bubble.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"range-slider-bubble.d.ts","names":[],"sources":["../../../src/components/motion/range-slider-bubble.tsx"],"mappings":";iBAwBiB,0BAA0B;;EAEzC,UAAU;EACV;;;;;;;wBAQc,eAAe,QAAQ,cAAc,WAAW,oCAAiB,IAAA"}
|
|
@@ -6,7 +6,7 @@ import { useEffect } from "react";
|
|
|
6
6
|
import { cn } from "@kumix/utils";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { AnimatePresence, motion, useMotionTemplate, useMotionValue, useReducedMotion, useSpring, useTransform, useVelocity } from "motion/react";
|
|
9
|
-
|
|
9
|
+
// src/components/motion/range-slider-bubble.tsx
|
|
10
10
|
const SPRING_TILT = {
|
|
11
11
|
stiffness: 260,
|
|
12
12
|
damping: 22,
|
|
@@ -50,14 +50,14 @@ function BubbleSlider({ format, className, ...options }) {
|
|
|
50
50
|
className: cn("relative flex h-20 w-full items-end px-5 pb-5", options.disabled ? "pointer-events-none opacity-50" : void 0, className),
|
|
51
51
|
children: /* @__PURE__ */ jsxs("div", {
|
|
52
52
|
...trackProps,
|
|
53
|
-
className: cn("relative h-2 w-full touch-none rounded-full
|
|
53
|
+
className: cn("bg-muted relative h-2 w-full touch-none rounded-full", TOUCH_GESTURE_CLASS, options.disabled ? void 0 : "cursor-grab active:cursor-grabbing"),
|
|
54
54
|
children: [
|
|
55
55
|
/* @__PURE__ */ jsx(motion.div, {
|
|
56
|
-
className: "absolute inset-y-0 left-0 rounded-full
|
|
56
|
+
className: "bg-foreground absolute inset-y-0 left-0 rounded-full",
|
|
57
57
|
style: { width: left }
|
|
58
58
|
}),
|
|
59
59
|
/* @__PURE__ */ jsx(motion.div, {
|
|
60
|
-
className: "absolute top-1/2 size-5 rounded-full border-2
|
|
60
|
+
className: "border-foreground bg-background absolute top-1/2 size-5 rounded-full border-2 shadow-sm",
|
|
61
61
|
style: {
|
|
62
62
|
left,
|
|
63
63
|
x: "-50%",
|
|
@@ -99,20 +99,19 @@ function BubbleSlider({ format, className, ...options }) {
|
|
|
99
99
|
scaleY: stretch,
|
|
100
100
|
originY: 1
|
|
101
101
|
},
|
|
102
|
-
className: "relative rounded-xl
|
|
103
|
-
children: [readout, /* @__PURE__ */ jsx("span", { className: "absolute -bottom-1 left-1/2 size-2.5 -translate-x-1/2 rotate-45 rounded-[3px]
|
|
102
|
+
className: "bg-foreground text-background relative rounded-xl px-2.5 py-1 text-sm font-medium tabular-nums shadow-md",
|
|
103
|
+
children: [readout, /* @__PURE__ */ jsx("span", { className: "bg-foreground absolute -bottom-1 left-1/2 size-2.5 -translate-x-1/2 rotate-45 rounded-[3px]" })]
|
|
104
104
|
}) : null })
|
|
105
105
|
}),
|
|
106
106
|
/* @__PURE__ */ jsx("button", {
|
|
107
107
|
type: "button",
|
|
108
108
|
...sliderProps,
|
|
109
|
-
className: "absolute inset-x-0 -inset-y-5 touch-none rounded-full outline-none
|
|
109
|
+
className: "ring-foreground/30 absolute inset-x-0 -inset-y-5 touch-none rounded-full outline-none focus-visible:ring-4"
|
|
110
110
|
})
|
|
111
111
|
]
|
|
112
112
|
})
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
|
-
//#endregion
|
|
116
115
|
export { BubbleSlider };
|
|
117
116
|
|
|
118
117
|
//# sourceMappingURL=range-slider-bubble.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range-slider-bubble.js","names":[],"sources":["../../../src/components/motion/range-slider-bubble.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect } from \"react\";\nimport {\n AnimatePresence,\n motion,\n useMotionTemplate,\n useMotionValue,\n useReducedMotion,\n useSpring,\n useTransform,\n useVelocity,\n} from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { type SliderOptions, useSlider } from \"../../hooks/use-slider\";\nimport { SPRING_GLIDE, SPRING_PANEL, SPRING_PRESS } from \"../../lib/ease\";\nimport { TOUCH_GESTURE_CLASS } from \"../../lib/touch\";\n\n// Loose enough that the bubble keeps leaning a beat after the pointer stops.\nconst SPRING_TILT = { stiffness: 260, damping: 22, mass: 0.4 } as const;\n/** Drag speed (px/s of track percent) that maxes out lean and squash. */\nconst FULL_TILT = 320;\n\nexport interface BubbleSliderProps extends SliderOptions {\n /** Formats the value shown in the bubble. */\n format?: (value: number) => string;\n className?: string;\n}\n\n/**\n * Slider with a value bubble that pops out of the thumb on grab and reacts to\n * how fast you drag: it leans into the direction of travel and squashes along\n * the way, then settles upright when you let go.\n */\nexport function BubbleSlider({ format, className, ...options }: BubbleSliderProps) {\n const reduce = useReducedMotion();\n // A bare number needs no valueText — it would only repeat aria-valuenow.\n const { percent, current, dragging, trackProps, sliderProps } = useSlider({\n ...options,\n formatValueText: options.formatValueText ?? format,\n });\n // The value is already snapped to the step — rounding here would only make\n // the bubble disagree with aria-valuenow on a fractional scale.\n const readout = format ? format(current) : current;\n\n const target = useMotionValue(percent);\n useEffect(() => {\n target.set(percent);\n }, [percent, target]);\n const smooth = useSpring(target, SPRING_GLIDE);\n const pos = reduce ? target : smooth;\n const left = useMotionTemplate`${pos}%`;\n\n // One spring drives the whole reaction: lean is signed, squash reads its\n // magnitude. Two springs off the same velocity would just run twice.\n const velocity = useVelocity(pos);\n const lean = useSpring(\n useTransform(velocity, [-FULL_TILT, 0, FULL_TILT], [1, 0, -1], { clamp: true }),\n SPRING_TILT,\n );\n const tilt = useTransform(lean, (v) => v * 16);\n const squash = useTransform(lean, (v) => 1 + Math.abs(v) * 0.18);\n const stretch = useTransform(lean, (v) => 1 - Math.abs(v) * 0.12);\n\n return (\n <div\n className={cn(\n // px/pb leave room for the thumb, the bubble and the 48px hit area to\n // overhang the 8px track without escaping the component's own box\n \"relative flex h-20 w-full items-end px-5 pb-5\",\n options.disabled ? \"pointer-events-none opacity-50\" : undefined,\n className,\n )}\n >\n <div\n {...trackProps}\n className={cn(\n \"relative h-2 w-full touch-none rounded-full
|
|
1
|
+
{"version":3,"file":"range-slider-bubble.js","names":[],"sources":["../../../src/components/motion/range-slider-bubble.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect } from \"react\";\nimport {\n AnimatePresence,\n motion,\n useMotionTemplate,\n useMotionValue,\n useReducedMotion,\n useSpring,\n useTransform,\n useVelocity,\n} from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { type SliderOptions, useSlider } from \"../../hooks/use-slider\";\nimport { SPRING_GLIDE, SPRING_PANEL, SPRING_PRESS } from \"../../lib/ease\";\nimport { TOUCH_GESTURE_CLASS } from \"../../lib/touch\";\n\n// Loose enough that the bubble keeps leaning a beat after the pointer stops.\nconst SPRING_TILT = { stiffness: 260, damping: 22, mass: 0.4 } as const;\n/** Drag speed (px/s of track percent) that maxes out lean and squash. */\nconst FULL_TILT = 320;\n\nexport interface BubbleSliderProps extends SliderOptions {\n /** Formats the value shown in the bubble. */\n format?: (value: number) => string;\n className?: string;\n}\n\n/**\n * Slider with a value bubble that pops out of the thumb on grab and reacts to\n * how fast you drag: it leans into the direction of travel and squashes along\n * the way, then settles upright when you let go.\n */\nexport function BubbleSlider({ format, className, ...options }: BubbleSliderProps) {\n const reduce = useReducedMotion();\n // A bare number needs no valueText — it would only repeat aria-valuenow.\n const { percent, current, dragging, trackProps, sliderProps } = useSlider({\n ...options,\n formatValueText: options.formatValueText ?? format,\n });\n // The value is already snapped to the step — rounding here would only make\n // the bubble disagree with aria-valuenow on a fractional scale.\n const readout = format ? format(current) : current;\n\n const target = useMotionValue(percent);\n useEffect(() => {\n target.set(percent);\n }, [percent, target]);\n const smooth = useSpring(target, SPRING_GLIDE);\n const pos = reduce ? target : smooth;\n const left = useMotionTemplate`${pos}%`;\n\n // One spring drives the whole reaction: lean is signed, squash reads its\n // magnitude. Two springs off the same velocity would just run twice.\n const velocity = useVelocity(pos);\n const lean = useSpring(\n useTransform(velocity, [-FULL_TILT, 0, FULL_TILT], [1, 0, -1], { clamp: true }),\n SPRING_TILT,\n );\n const tilt = useTransform(lean, (v) => v * 16);\n const squash = useTransform(lean, (v) => 1 + Math.abs(v) * 0.18);\n const stretch = useTransform(lean, (v) => 1 - Math.abs(v) * 0.12);\n\n return (\n <div\n className={cn(\n // px/pb leave room for the thumb, the bubble and the 48px hit area to\n // overhang the 8px track without escaping the component's own box\n \"relative flex h-20 w-full items-end px-5 pb-5\",\n options.disabled ? \"pointer-events-none opacity-50\" : undefined,\n className,\n )}\n >\n <div\n {...trackProps}\n className={cn(\n \"bg-muted relative h-2 w-full touch-none rounded-full\",\n TOUCH_GESTURE_CLASS,\n options.disabled ? undefined : \"cursor-grab active:cursor-grabbing\",\n )}\n >\n <motion.div\n className=\"bg-foreground absolute inset-y-0 left-0 rounded-full\"\n style={{ width: left }}\n />\n\n {/* thumb — overhangs the track by half its width at both ends, which the\n wrapper's padding leaves room for */}\n <motion.div\n className=\"border-foreground bg-background absolute top-1/2 size-5 rounded-full border-2 shadow-sm\"\n style={{ left, x: \"-50%\", y: \"-50%\" }}\n animate={reduce ? undefined : { scale: dragging ? 1.25 : 1 }}\n transition={SPRING_PRESS}\n />\n\n {/* bubble — anchored to the thumb, leaning with drag velocity */}\n <motion.div className=\"pointer-events-none absolute bottom-6\" style={{ left, x: \"-50%\" }}>\n <AnimatePresence>\n {dragging ? (\n <motion.div\n initial={reduce ? { opacity: 0 } : { opacity: 0, scale: 0.4, y: 10 }}\n animate={reduce ? { opacity: 1 } : { opacity: 1, scale: 1, y: 0 }}\n exit={\n reduce\n ? { opacity: 0, transition: { duration: 0.12 } }\n : { opacity: 0, scale: 0.5, y: 8, transition: { duration: 0.12 } }\n }\n transition={reduce ? { duration: 0.12 } : SPRING_PANEL}\n style={\n reduce ? undefined : { rotate: tilt, scaleX: squash, scaleY: stretch, originY: 1 }\n }\n className=\"bg-foreground text-background relative rounded-xl px-2.5 py-1 text-sm font-medium tabular-nums shadow-md\"\n >\n {readout}\n <span className=\"bg-foreground absolute -bottom-1 left-1/2 size-2.5 -translate-x-1/2 rotate-45 rounded-[3px]\" />\n </motion.div>\n ) : null}\n </AnimatePresence>\n </motion.div>\n\n {/* 8px of track is not a touch target — pad the hit area out to 48px */}\n <button\n type=\"button\"\n {...sliderProps}\n className=\"ring-foreground/30 absolute inset-x-0 -inset-y-5 touch-none rounded-full outline-none focus-visible:ring-4\"\n />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAoBA,MAAM,cAAc;CAAE,WAAW;CAAK,SAAS;CAAI,MAAM;AAAI;;AAE7D,MAAM,YAAY;;;;;;AAalB,SAAgB,aAAa,EAAE,QAAQ,WAAW,GAAG,WAA8B;CACjF,MAAM,SAAS,iBAAiB;CAEhC,MAAM,EAAE,SAAS,SAAS,UAAU,YAAY,gBAAgB,UAAU;EACxE,GAAG;EACH,iBAAiB,QAAQ,mBAAmB;CAC9C,CAAC;CAGD,MAAM,UAAU,SAAS,OAAO,OAAO,IAAI;CAE3C,MAAM,SAAS,eAAe,OAAO;CACrC,gBAAgB;EACd,OAAO,IAAI,OAAO;CACpB,GAAG,CAAC,SAAS,MAAM,CAAC;CACpB,MAAM,SAAS,UAAU,QAAQ,YAAY;CAC7C,MAAM,MAAM,SAAS,SAAS;CAC9B,MAAM,OAAO,iBAAiB,GAAG,IAAI;CAIrC,MAAM,WAAW,YAAY,GAAG;CAChC,MAAM,OAAO,UACX,aAAa,UAAU;EAAC;EAAY;EAAG;CAAS,GAAG;EAAC;EAAG;EAAG;CAAE,GAAG,EAAE,OAAO,KAAK,CAAC,GAC9E,WACF;CACA,MAAM,OAAO,aAAa,OAAO,MAAM,IAAI,EAAE;CAC7C,MAAM,SAAS,aAAa,OAAO,MAAM,IAAI,KAAK,IAAI,CAAC,IAAI,GAAI;CAC/D,MAAM,UAAU,aAAa,OAAO,MAAM,IAAI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A;GACE;;CACF,CAAA;AAET"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SliderOptions } from "../../hooks/use-slider.js";
|
|
2
|
-
//#region src/components/motion/range-slider-fluid.d.ts
|
|
3
2
|
export interface FluidSliderProps extends SliderOptions {
|
|
4
3
|
/** Text shown on the left of the track. */
|
|
5
4
|
label?: string;
|
|
@@ -13,5 +12,4 @@ export interface FluidSliderProps extends SliderOptions {
|
|
|
13
12
|
* fill has covered it.
|
|
14
13
|
*/
|
|
15
14
|
export declare function FluidSlider({ label, format, className, ...options }: FluidSliderProps): import("react").JSX.Element;
|
|
16
|
-
//#endregion
|
|
17
15
|
//# sourceMappingURL=range-slider-fluid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range-slider-fluid.d.ts","names":[],"sources":["../../../src/components/motion/range-slider-fluid.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"range-slider-fluid.d.ts","names":[],"sources":["../../../src/components/motion/range-slider-fluid.tsx"],"mappings":";iBAiBiB,yBAAyB;;EAExC;;EAEA,UAAU;EACV;;;;;;;wBAQc,cACd,OAGA,QACA,cACG,WACF,mCAAgB,IAAA"}
|
|
@@ -6,7 +6,7 @@ import { useEffect } from "react";
|
|
|
6
6
|
import { cn } from "@kumix/utils";
|
|
7
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { motion, useMotionTemplate, useMotionValue, useReducedMotion, useSpring, useTransform } from "motion/react";
|
|
9
|
-
|
|
9
|
+
// src/components/motion/range-slider-fluid.tsx
|
|
10
10
|
/**
|
|
11
11
|
* Thumbless slider: the whole pill is the control. The fill glides to the new
|
|
12
12
|
* value behind a rounded liquid cap, and the label reads inverted wherever the
|
|
@@ -36,29 +36,28 @@ function FluidSlider({ label, format = (v) => `${v}%`, className, ...options })
|
|
|
36
36
|
...trackProps,
|
|
37
37
|
animate: reduce ? void 0 : { scale: dragging ? 1.03 : 1 },
|
|
38
38
|
transition: SPRING_PRESS,
|
|
39
|
-
className: cn("relative flex h-12 w-full touch-none overflow-hidden rounded-full
|
|
39
|
+
className: cn("bg-muted relative flex h-12 w-full touch-none overflow-hidden rounded-full", TOUCH_GESTURE_CLASS, options.disabled ? "pointer-events-none opacity-50" : "cursor-grab active:cursor-grabbing", className),
|
|
40
40
|
children: [
|
|
41
41
|
/* @__PURE__ */ jsx("div", {
|
|
42
|
-
className: "pointer-events-none absolute inset-0 flex items-center justify-between px-5
|
|
42
|
+
className: "text-foreground pointer-events-none absolute inset-0 flex items-center justify-between px-5 text-sm font-medium",
|
|
43
43
|
children: row
|
|
44
44
|
}),
|
|
45
45
|
/* @__PURE__ */ jsxs(motion.div, {
|
|
46
46
|
className: "absolute inset-0",
|
|
47
47
|
style: { clipPath },
|
|
48
|
-
children: [/* @__PURE__ */ jsx("div", { className: "absolute inset-0
|
|
49
|
-
className: "pointer-events-none absolute inset-0 flex items-center justify-between px-5
|
|
48
|
+
children: [/* @__PURE__ */ jsx("div", { className: "bg-foreground absolute inset-0" }), /* @__PURE__ */ jsx("div", {
|
|
49
|
+
className: "text-background pointer-events-none absolute inset-0 flex items-center justify-between px-5 text-sm font-medium",
|
|
50
50
|
children: row
|
|
51
51
|
})]
|
|
52
52
|
}),
|
|
53
53
|
/* @__PURE__ */ jsx("button", {
|
|
54
54
|
type: "button",
|
|
55
55
|
...sliderProps,
|
|
56
|
-
className: "absolute inset-0 touch-none rounded-full outline-none ring-
|
|
56
|
+
className: "ring-foreground/40 absolute inset-0 touch-none rounded-full outline-none ring-inset focus-visible:ring-4"
|
|
57
57
|
})
|
|
58
58
|
]
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
|
-
//#endregion
|
|
62
61
|
export { FluidSlider };
|
|
63
62
|
|
|
64
63
|
//# sourceMappingURL=range-slider-fluid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range-slider-fluid.js","names":[],"sources":["../../../src/components/motion/range-slider-fluid.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect } from \"react\";\nimport {\n motion,\n useMotionTemplate,\n useMotionValue,\n useReducedMotion,\n useSpring,\n useTransform,\n} from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { type SliderOptions, useSlider } from \"../../hooks/use-slider\";\nimport { SPRING_GLIDE, SPRING_PRESS } from \"../../lib/ease\";\nimport { TOUCH_GESTURE_CLASS } from \"../../lib/touch\";\n\nexport interface FluidSliderProps extends SliderOptions {\n /** Text shown on the left of the track. */\n label?: string;\n /** Formats the value shown on the right. */\n format?: (value: number) => string;\n className?: string;\n}\n\n/**\n * Thumbless slider: the whole pill is the control. The fill glides to the new\n * value behind a rounded liquid cap, and the label reads inverted wherever the\n * fill has covered it.\n */\nexport function FluidSlider({\n label,\n // The value arrives already snapped to the step. Rounding it again would\n // only make the label and the announcement disagree with aria-valuenow.\n format = (v) => `${v}%`,\n className,\n ...options\n}: FluidSliderProps) {\n const reduce = useReducedMotion();\n const { percent, current, dragging, trackProps, sliderProps } = useSlider({\n ...options,\n formatValueText: options.formatValueText ?? format,\n });\n\n const target = useMotionValue(percent);\n useEffect(() => {\n target.set(percent);\n }, [percent, target]);\n const smooth = useSpring(target, SPRING_GLIDE);\n const pos = reduce ? target : smooth;\n // Reveal the fill by clipping a full-width layer rather than animating its\n // width: at 0% the clip is empty, so no hairline of a sub-pixel-wide box is\n // left behind, and the label inside is never scaled or re-laid out.\n const uncovered = useTransform(pos, (v) => 100 - v);\n const clipPath = useMotionTemplate`inset(0 ${uncovered}% 0 0 round 9999px)`;\n\n const row = (\n <>\n {label ? <span className=\"truncate\">{label}</span> : <span />}\n <span className=\"tabular-nums\">{format(current)}</span>\n </>\n );\n\n return (\n <motion.div\n {...trackProps}\n animate={reduce ? undefined : { scale: dragging ? 1.03 : 1 }}\n transition={SPRING_PRESS}\n className={cn(\n \"relative flex h-12 w-full touch-none overflow-hidden rounded-full
|
|
1
|
+
{"version":3,"file":"range-slider-fluid.js","names":[],"sources":["../../../src/components/motion/range-slider-fluid.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect } from \"react\";\nimport {\n motion,\n useMotionTemplate,\n useMotionValue,\n useReducedMotion,\n useSpring,\n useTransform,\n} from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { type SliderOptions, useSlider } from \"../../hooks/use-slider\";\nimport { SPRING_GLIDE, SPRING_PRESS } from \"../../lib/ease\";\nimport { TOUCH_GESTURE_CLASS } from \"../../lib/touch\";\n\nexport interface FluidSliderProps extends SliderOptions {\n /** Text shown on the left of the track. */\n label?: string;\n /** Formats the value shown on the right. */\n format?: (value: number) => string;\n className?: string;\n}\n\n/**\n * Thumbless slider: the whole pill is the control. The fill glides to the new\n * value behind a rounded liquid cap, and the label reads inverted wherever the\n * fill has covered it.\n */\nexport function FluidSlider({\n label,\n // The value arrives already snapped to the step. Rounding it again would\n // only make the label and the announcement disagree with aria-valuenow.\n format = (v) => `${v}%`,\n className,\n ...options\n}: FluidSliderProps) {\n const reduce = useReducedMotion();\n const { percent, current, dragging, trackProps, sliderProps } = useSlider({\n ...options,\n formatValueText: options.formatValueText ?? format,\n });\n\n const target = useMotionValue(percent);\n useEffect(() => {\n target.set(percent);\n }, [percent, target]);\n const smooth = useSpring(target, SPRING_GLIDE);\n const pos = reduce ? target : smooth;\n // Reveal the fill by clipping a full-width layer rather than animating its\n // width: at 0% the clip is empty, so no hairline of a sub-pixel-wide box is\n // left behind, and the label inside is never scaled or re-laid out.\n const uncovered = useTransform(pos, (v) => 100 - v);\n const clipPath = useMotionTemplate`inset(0 ${uncovered}% 0 0 round 9999px)`;\n\n const row = (\n <>\n {label ? <span className=\"truncate\">{label}</span> : <span />}\n <span className=\"tabular-nums\">{format(current)}</span>\n </>\n );\n\n return (\n <motion.div\n {...trackProps}\n animate={reduce ? undefined : { scale: dragging ? 1.03 : 1 }}\n transition={SPRING_PRESS}\n className={cn(\n \"bg-muted relative flex h-12 w-full touch-none overflow-hidden rounded-full\",\n TOUCH_GESTURE_CLASS,\n options.disabled ? \"pointer-events-none opacity-50\" : \"cursor-grab active:cursor-grabbing\",\n className,\n )}\n >\n {/* uncovered label — sits on the muted track */}\n <div className=\"text-foreground pointer-events-none absolute inset-0 flex items-center justify-between px-5 text-sm font-medium\">\n {row}\n </div>\n\n {/* fill + the same label, both clipped to the value, so the text inverts\n as the fill covers it and lines up glyph for glyph with the copy\n underneath. The clip's rounded right edge is the liquid cap. */}\n <motion.div className=\"absolute inset-0\" style={{ clipPath }}>\n <div className=\"bg-foreground absolute inset-0\" />\n <div className=\"text-background pointer-events-none absolute inset-0 flex items-center justify-between px-5 text-sm font-medium\">\n {row}\n </div>\n </motion.div>\n\n {/* focusable, keyboard-controlled handle surface. The ring is inset — an\n outset one is clipped away by the track's overflow-hidden. */}\n <button\n type=\"button\"\n {...sliderProps}\n className=\"ring-foreground/40 absolute inset-0 touch-none rounded-full outline-none ring-inset focus-visible:ring-4\"\n />\n </motion.div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AA8BA,SAAgB,YAAY,EAC1B,OAGA,UAAU,MAAM,GAAG,EAAE,IACrB,WACA,GAAG,WACgB;CACnB,MAAM,SAAS,iBAAiB;CAChC,MAAM,EAAE,SAAS,SAAS,UAAU,YAAY,gBAAgB,UAAU;EACxE,GAAG;EACH,iBAAiB,QAAQ,mBAAmB;CAC9C,CAAC;CAED,MAAM,SAAS,eAAe,OAAO;CACrC,gBAAgB;EACd,OAAO,IAAI,OAAO;CACpB,GAAG,CAAC,SAAS,MAAM,CAAC;CACpB,MAAM,SAAS,UAAU,QAAQ,YAAY;CAK7C,MAAM,YAAY,aAJN,SAAS,SAAS,SAIO,MAAM,MAAM,CAAC;CAClD,MAAM,WAAW,iBAAiB,WAAW,UAAU;CAEvD,MAAM,MACJ,qBAAA,YAAA,EAAA,UAAA,CACG,QAAQ,oBAAC,QAAD;EAAM,WAAU;EAAY,UAAA;CAAY,CAAA,IAAI,oBAAC,QAAD,CAAO,CAAA,G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