@kumix/ui 0.3.17 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -18
- package/dist/account-avatar-DILzuuvz.js +23 -0
- package/dist/account-avatar-DILzuuvz.js.map +1 -0
- package/dist/{cascader-types-BnH6wYD-.d.ts → cascader-types-DVT-znZ-.d.ts} +6 -3
- package/dist/cascader-types-DVT-znZ-.d.ts.map +1 -0
- package/dist/components/agents/agent-activity/activity-row.js +1 -1
- package/dist/components/agents/agent-activity/index.js +1 -1
- package/dist/components/agents/agent-code.js +1 -1
- package/dist/components/agents/ai-sidebar.js +1 -1
- package/dist/components/agents/approval-card/index.js +1 -1
- package/dist/components/agents/citations.js +1 -1
- package/dist/components/agents/code-block.js +1 -1
- package/dist/components/agents/file-diff.js +1 -1
- package/dist/components/agents/image-generation.js +1 -1
- package/dist/components/agents/message-bubble.js +1 -1
- package/dist/components/agents/prompt-input.js +1 -1
- package/dist/components/agents/streaming-response.js +1 -1
- package/dist/components/agents/todo-list.js +1 -1
- package/dist/components/agents/tool-approval.js +1 -1
- package/dist/components/agents/tool-result.js +1 -1
- package/dist/components/agents/voice-orb.d.ts +19 -0
- package/dist/components/agents/voice-orb.d.ts.map +1 -0
- package/dist/components/agents/voice-orb.js +389 -0
- package/dist/components/agents/voice-orb.js.map +1 -0
- package/dist/components/charts/bump-chart/context.d.ts +2 -0
- package/dist/components/charts/bump-chart/context.js +3 -0
- package/dist/components/charts/bump-chart/legend.d.ts +6 -0
- package/dist/components/charts/bump-chart/legend.d.ts.map +1 -0
- package/dist/components/charts/bump-chart/legend.js +60 -0
- package/dist/components/charts/bump-chart/legend.js.map +1 -0
- package/dist/components/charts/bump-chart/plot.d.ts +6 -0
- package/dist/components/charts/bump-chart/plot.d.ts.map +1 -0
- package/dist/components/charts/bump-chart/plot.js +3 -0
- package/dist/components/charts/bump-chart/point.d.ts +10 -0
- package/dist/components/charts/bump-chart/point.d.ts.map +1 -0
- package/dist/components/charts/bump-chart/point.js +124 -0
- package/dist/components/charts/bump-chart/point.js.map +1 -0
- package/dist/components/charts/bump-chart/series.d.ts +11 -0
- package/dist/components/charts/bump-chart/series.d.ts.map +1 -0
- package/dist/components/charts/bump-chart/series.js +101 -0
- package/dist/components/charts/bump-chart/series.js.map +1 -0
- package/dist/components/charts/bump-chart.d.ts +10 -0
- package/dist/components/charts/bump-chart.d.ts.map +1 -0
- package/dist/components/charts/bump-chart.js +23 -0
- package/dist/components/charts/bump-chart.js.map +1 -0
- package/dist/components/charts/composition-chart/context.d.ts +2 -0
- package/dist/components/charts/composition-chart/context.js +3 -0
- package/dist/components/charts/composition-chart/legend.d.ts +6 -0
- package/dist/components/charts/composition-chart/legend.d.ts.map +1 -0
- package/dist/components/charts/composition-chart/legend.js +51 -0
- package/dist/components/charts/composition-chart/legend.js.map +1 -0
- package/dist/components/charts/composition-chart/plot.d.ts +6 -0
- package/dist/components/charts/composition-chart/plot.d.ts.map +1 -0
- package/dist/components/charts/composition-chart/plot.js +174 -0
- package/dist/components/charts/composition-chart/plot.js.map +1 -0
- package/dist/components/charts/composition-chart/tooltip-content.d.ts +6 -0
- package/dist/components/charts/composition-chart/tooltip-content.d.ts.map +1 -0
- package/dist/components/charts/composition-chart/tooltip-content.js +63 -0
- package/dist/components/charts/composition-chart/tooltip-content.js.map +1 -0
- package/dist/components/charts/composition-chart.d.ts +9 -0
- package/dist/components/charts/composition-chart.d.ts.map +1 -0
- package/dist/components/charts/composition-chart.js +26 -0
- package/dist/components/charts/composition-chart.js.map +1 -0
- package/dist/components/charts/funnel-chart.d.ts +50 -0
- package/dist/components/charts/funnel-chart.d.ts.map +1 -0
- package/dist/components/charts/funnel-chart.js +216 -0
- package/dist/components/charts/funnel-chart.js.map +1 -0
- package/dist/components/charts/heat-calendar/grid.d.ts +8 -0
- package/dist/components/charts/heat-calendar/grid.d.ts.map +1 -0
- package/dist/components/charts/heat-calendar/grid.js +127 -0
- package/dist/components/charts/heat-calendar/grid.js.map +1 -0
- package/dist/components/charts/heat-calendar/legend.d.ts +6 -0
- package/dist/components/charts/heat-calendar/legend.d.ts.map +1 -0
- package/dist/components/charts/heat-calendar/legend.js +48 -0
- package/dist/components/charts/heat-calendar/legend.js.map +1 -0
- package/dist/components/charts/heat-calendar/tooltip.d.ts +2 -0
- package/dist/components/charts/heat-calendar/tooltip.js +50 -0
- package/dist/components/charts/heat-calendar/tooltip.js.map +1 -0
- package/dist/components/charts/heat-calendar.d.ts +9 -0
- package/dist/components/charts/heat-calendar.d.ts.map +1 -0
- package/dist/components/charts/heat-calendar.js +23 -0
- package/dist/components/charts/heat-calendar.js.map +1 -0
- package/dist/components/charts/liquidity-heatmap.d.ts +51 -0
- package/dist/components/charts/liquidity-heatmap.d.ts.map +1 -0
- package/dist/components/charts/liquidity-heatmap.js +311 -0
- package/dist/components/charts/liquidity-heatmap.js.map +1 -0
- package/dist/components/charts/order-book/depth-row.d.ts +13 -0
- package/dist/components/charts/order-book/depth-row.d.ts.map +1 -0
- package/dist/components/charts/order-book/depth-row.js +99 -0
- package/dist/components/charts/order-book/depth-row.js.map +1 -0
- package/dist/components/charts/order-book.d.ts +57 -0
- package/dist/components/charts/order-book.d.ts.map +1 -0
- package/dist/components/charts/order-book.js +207 -0
- package/dist/components/charts/order-book.js.map +1 -0
- package/dist/components/charts/price-target-fan/header.d.ts +8 -0
- package/dist/components/charts/price-target-fan/header.d.ts.map +1 -0
- package/dist/components/charts/price-target-fan/header.js +43 -0
- package/dist/components/charts/price-target-fan/header.js.map +1 -0
- package/dist/components/charts/price-target-fan/plot.d.ts +16 -0
- package/dist/components/charts/price-target-fan/plot.d.ts.map +1 -0
- package/dist/components/charts/price-target-fan/plot.js +142 -0
- package/dist/components/charts/price-target-fan/plot.js.map +1 -0
- package/dist/components/charts/price-target-fan/series.d.ts +15 -0
- package/dist/components/charts/price-target-fan/series.d.ts.map +1 -0
- package/dist/components/charts/price-target-fan/series.js +238 -0
- package/dist/components/charts/price-target-fan/series.js.map +1 -0
- package/dist/components/charts/price-target-fan/tooltip.d.ts +2 -0
- package/dist/components/charts/price-target-fan/tooltip.js +58 -0
- package/dist/components/charts/price-target-fan/tooltip.js.map +1 -0
- package/dist/components/charts/price-target-fan.d.ts +10 -0
- package/dist/components/charts/price-target-fan.d.ts.map +1 -0
- package/dist/components/charts/price-target-fan.js +24 -0
- package/dist/components/charts/price-target-fan.js.map +1 -0
- package/dist/components/charts/returns-calendar/grid.d.ts +8 -0
- package/dist/components/charts/returns-calendar/grid.d.ts.map +1 -0
- package/dist/components/charts/returns-calendar/grid.js +176 -0
- package/dist/components/charts/returns-calendar/grid.js.map +1 -0
- package/dist/components/charts/returns-calendar/tooltip.d.ts +2 -0
- package/dist/components/charts/returns-calendar/tooltip.js +55 -0
- package/dist/components/charts/returns-calendar/tooltip.js.map +1 -0
- package/dist/components/charts/returns-calendar.d.ts +48 -0
- package/dist/components/charts/returns-calendar.d.ts.map +1 -0
- package/dist/components/charts/returns-calendar.js +22 -0
- package/dist/components/charts/returns-calendar.js.map +1 -0
- package/dist/components/charts/status-bar/legend.d.ts +8 -0
- package/dist/components/charts/status-bar/legend.d.ts.map +1 -0
- package/dist/components/charts/status-bar/legend.js +37 -0
- package/dist/components/charts/status-bar/legend.js.map +1 -0
- package/dist/components/charts/status-bar/plot.d.ts +12 -0
- package/dist/components/charts/status-bar/plot.d.ts.map +1 -0
- package/dist/components/charts/status-bar/plot.js +176 -0
- package/dist/components/charts/status-bar/plot.js.map +1 -0
- package/dist/components/charts/status-bar/tooltip.d.ts +2 -0
- package/dist/components/charts/status-bar/tooltip.js +49 -0
- package/dist/components/charts/status-bar/tooltip.js.map +1 -0
- package/dist/components/charts/status-bar.d.ts +9 -0
- package/dist/components/charts/status-bar.d.ts.map +1 -0
- package/dist/components/charts/status-bar.js +64 -0
- package/dist/components/charts/status-bar.js.map +1 -0
- package/dist/components/charts/treemap/legend.d.ts +8 -0
- package/dist/components/charts/treemap/legend.d.ts.map +1 -0
- package/dist/components/charts/treemap/legend.js +35 -0
- package/dist/components/charts/treemap/legend.js.map +1 -0
- package/dist/components/charts/treemap/plot.d.ts +13 -0
- package/dist/components/charts/treemap/plot.d.ts.map +1 -0
- package/dist/components/charts/treemap/plot.js +123 -0
- package/dist/components/charts/treemap/plot.js.map +1 -0
- package/dist/components/charts/treemap/tile.d.ts +10 -0
- package/dist/components/charts/treemap/tile.d.ts.map +1 -0
- package/dist/components/charts/treemap/tile.js +114 -0
- package/dist/components/charts/treemap/tile.js.map +1 -0
- package/dist/components/charts/treemap/tooltip.d.ts +11 -0
- package/dist/components/charts/treemap/tooltip.d.ts.map +1 -0
- package/dist/components/charts/treemap/tooltip.js +73 -0
- package/dist/components/charts/treemap/tooltip.js.map +1 -0
- package/dist/components/charts/treemap.d.ts +56 -0
- package/dist/components/charts/treemap.d.ts.map +1 -0
- package/dist/components/charts/treemap.js +71 -0
- package/dist/components/charts/treemap.js.map +1 -0
- package/dist/components/charts/volume-profile/plot.d.ts +12 -0
- package/dist/components/charts/volume-profile/plot.d.ts.map +1 -0
- package/dist/components/charts/volume-profile/plot.js +211 -0
- package/dist/components/charts/volume-profile/plot.js.map +1 -0
- package/dist/components/charts/volume-profile/summary.d.ts +6 -0
- package/dist/components/charts/volume-profile/summary.d.ts.map +1 -0
- package/dist/components/charts/volume-profile/summary.js +76 -0
- package/dist/components/charts/volume-profile/summary.js.map +1 -0
- package/dist/components/charts/volume-profile/tooltip.d.ts +2 -0
- package/dist/components/charts/volume-profile/tooltip.js +84 -0
- package/dist/components/charts/volume-profile/tooltip.js.map +1 -0
- package/dist/components/charts/volume-profile.d.ts +111 -0
- package/dist/components/charts/volume-profile.d.ts.map +1 -0
- package/dist/components/charts/volume-profile.js +82 -0
- package/dist/components/charts/volume-profile.js.map +1 -0
- package/dist/components/custom/confirm-dialog.js +1 -1
- package/dist/components/motion/adaptive-stepper.js +1 -1
- package/dist/components/motion/alert.d.ts +40 -0
- package/dist/components/motion/alert.d.ts.map +1 -0
- package/dist/components/motion/alert.js +247 -0
- package/dist/components/motion/alert.js.map +1 -0
- package/dist/components/motion/animated-badge.js +1 -1
- package/dist/components/motion/animated-sidebar.js +1 -1
- package/dist/components/motion/animated-sidebar.js.map +1 -1
- package/dist/components/motion/animated-toast-stack.js +1 -1
- package/dist/components/motion/arc-picker.d.ts +28 -0
- package/dist/components/motion/arc-picker.d.ts.map +1 -0
- package/dist/components/motion/arc-picker.js +569 -0
- package/dist/components/motion/arc-picker.js.map +1 -0
- package/dist/components/motion/aspect-ratio.d.ts +23 -0
- package/dist/components/motion/aspect-ratio.d.ts.map +1 -0
- package/dist/components/motion/aspect-ratio.js +61 -0
- package/dist/components/motion/aspect-ratio.js.map +1 -0
- package/dist/components/motion/attachment-upload.d.ts.map +1 -1
- package/dist/components/motion/attachment-upload.js +2 -2
- package/dist/components/motion/attachment-upload.js.map +1 -1
- package/dist/components/motion/availability-scheduler/copy-menu.js +1 -1
- package/dist/components/motion/availability-scheduler/day-row.js +2 -2
- package/dist/components/motion/availability-scheduler/index.js +1 -1
- package/dist/components/motion/bloom-menu.js +1 -1
- package/dist/components/motion/bottom-sheet.js.map +1 -1
- package/dist/components/motion/bouncy-accordion.js +1 -1
- package/dist/components/motion/breadcrumb.d.ts +37 -0
- package/dist/components/motion/breadcrumb.d.ts.map +1 -0
- package/dist/components/motion/breadcrumb.js +259 -0
- package/dist/components/motion/breadcrumb.js.map +1 -0
- package/dist/components/motion/button/stateful.js +1 -1
- package/dist/components/motion/card-folder.js +1 -1
- package/dist/components/motion/center-morph-modal.js +1 -1
- package/dist/components/motion/collapsible.d.ts +34 -0
- package/dist/components/motion/collapsible.d.ts.map +1 -0
- package/dist/components/motion/collapsible.js +237 -0
- package/dist/components/motion/collapsible.js.map +1 -0
- package/dist/components/motion/color-selector.d.ts +28 -0
- package/dist/components/motion/color-selector.d.ts.map +1 -0
- package/dist/components/motion/color-selector.js +97 -0
- package/dist/components/motion/color-selector.js.map +1 -0
- package/dist/components/motion/combobox/list.js +1 -1
- package/dist/components/motion/combobox/trigger.js +1 -1
- package/dist/components/motion/command-palette.js +1 -1
- package/dist/components/motion/command-palette.js.map +1 -1
- package/dist/components/motion/context-menu.js +1 -1
- package/dist/components/motion/date-range-picker.d.ts +107 -0
- package/dist/components/motion/date-range-picker.d.ts.map +1 -0
- package/dist/components/motion/date-range-picker.js +907 -0
- package/dist/components/motion/date-range-picker.js.map +1 -0
- package/dist/components/motion/drawer.js.map +1 -1
- package/dist/components/motion/feedback-widget.js +1 -1
- package/dist/components/motion/file-tree.js +1 -1
- package/dist/components/motion/file-upload.js +1 -1
- package/dist/components/motion/infinite-masonry.js +1 -1
- package/dist/components/motion/knockout-bracket.d.ts +190 -0
- package/dist/components/motion/knockout-bracket.d.ts.map +1 -0
- package/dist/components/motion/knockout-bracket.js +952 -0
- package/dist/components/motion/knockout-bracket.js.map +1 -0
- package/dist/components/motion/knockout-wheel.d.ts +183 -0
- package/dist/components/motion/knockout-wheel.d.ts.map +1 -0
- package/dist/components/motion/knockout-wheel.js +1039 -0
- package/dist/components/motion/knockout-wheel.js.map +1 -0
- package/dist/components/motion/morphing-lightbox.d.ts +67 -0
- package/dist/components/motion/morphing-lightbox.d.ts.map +1 -0
- package/dist/components/motion/morphing-lightbox.js +499 -0
- package/dist/components/motion/morphing-lightbox.js.map +1 -0
- package/dist/components/motion/morphing-modal.js.map +1 -1
- package/dist/components/motion/morphing-search.js +1 -1
- package/dist/components/motion/morphing-search.js.map +1 -1
- package/dist/components/motion/morphing-tabs.js +1 -1
- package/dist/components/motion/multi-select/list.js +1 -1
- package/dist/components/motion/multi-select/trigger.js +1 -1
- package/dist/components/motion/notification-stack.js +1 -1
- package/dist/components/motion/overflow-actions.js +1 -1
- package/dist/components/motion/popover-morph.d.ts +5 -1
- package/dist/components/motion/popover-morph.d.ts.map +1 -1
- package/dist/components/motion/popover-morph.js +78 -27
- package/dist/components/motion/popover-morph.js.map +1 -1
- package/dist/components/motion/prediction-market-card.d.ts +37 -0
- package/dist/components/motion/prediction-market-card.d.ts.map +1 -0
- package/dist/components/motion/prediction-market-card.js +216 -0
- package/dist/components/motion/prediction-market-card.js.map +1 -0
- package/dist/components/motion/prediction-market.d.ts +49 -0
- package/dist/components/motion/prediction-market.d.ts.map +1 -0
- package/dist/components/motion/prediction-market.js +440 -0
- package/dist/components/motion/prediction-market.js.map +1 -0
- package/dist/components/motion/project-folder.js +1 -1
- package/dist/components/motion/project-folder.js.map +1 -1
- package/dist/components/motion/select-morph.js +1 -1
- package/dist/components/motion/select.js +1 -1
- package/dist/components/motion/signup-form.js +1 -1
- package/dist/components/motion/sortable-list.d.ts +53 -0
- package/dist/components/motion/sortable-list.d.ts.map +1 -0
- package/dist/components/motion/sortable-list.js +254 -0
- package/dist/components/motion/sortable-list.js.map +1 -0
- package/dist/components/motion/sortable-stack.d.ts +2 -0
- package/dist/components/motion/sortable-stack.js +3 -0
- package/dist/components/motion/swap/controls.d.ts +22 -0
- package/dist/components/motion/swap/controls.d.ts.map +1 -0
- package/dist/components/motion/swap/controls.js +167 -0
- package/dist/components/motion/swap/controls.js.map +1 -0
- package/dist/components/motion/swap/field.d.ts +14 -0
- package/dist/components/motion/swap/field.d.ts.map +1 -0
- package/dist/components/motion/swap/field.js +107 -0
- package/dist/components/motion/swap/field.js.map +1 -0
- package/dist/components/motion/swap/quote-row.d.ts +13 -0
- package/dist/components/motion/swap/quote-row.d.ts.map +1 -0
- package/dist/components/motion/swap/quote-row.js +55 -0
- package/dist/components/motion/swap/quote-row.js.map +1 -0
- package/dist/components/motion/swap/token-badges.d.ts +19 -0
- package/dist/components/motion/swap/token-badges.d.ts.map +1 -0
- package/dist/components/motion/swap/token-badges.js +54 -0
- package/dist/components/motion/swap/token-badges.js.map +1 -0
- package/dist/components/motion/swap/token-picker.d.ts +14 -0
- package/dist/components/motion/swap/token-picker.d.ts.map +1 -0
- package/dist/components/motion/swap/token-picker.js +190 -0
- package/dist/components/motion/swap/token-picker.js.map +1 -0
- package/dist/components/motion/swap.d.ts +14 -0
- package/dist/components/motion/swap.d.ts.map +1 -0
- package/dist/components/motion/swap.js +378 -0
- package/dist/components/motion/swap.js.map +1 -0
- package/dist/components/motion/table/row-handle.js +1 -1
- package/dist/components/motion/table/table-header.js +1 -1
- package/dist/components/motion/tabs.d.ts +5 -9
- package/dist/components/motion/tabs.d.ts.map +1 -1
- package/dist/components/motion/tabs.js +14 -5
- package/dist/components/motion/tabs.js.map +1 -1
- package/dist/components/motion/theme-toggle.js +1 -1
- package/dist/components/motion/tooltip/positioner.d.ts +33 -0
- package/dist/components/motion/tooltip/positioner.d.ts.map +1 -0
- package/dist/components/motion/tooltip/positioner.js +3 -0
- package/dist/components/motion/tooltip-surface.d.ts +5 -4
- package/dist/components/motion/tooltip-surface.d.ts.map +1 -1
- package/dist/components/motion/tooltip-surface.js +22 -73
- package/dist/components/motion/tooltip-surface.js.map +1 -1
- package/dist/components/motion/tooltip.d.ts +3 -1
- package/dist/components/motion/tooltip.d.ts.map +1 -1
- package/dist/components/motion/tooltip.js +54 -103
- package/dist/components/motion/tooltip.js.map +1 -1
- package/dist/components/motion/wallet-card/account-avatar.d.ts +8 -0
- package/dist/components/motion/wallet-card/account-avatar.d.ts.map +1 -0
- package/dist/components/motion/wallet-card/account-avatar.js +3 -0
- package/dist/components/motion/wallet-card/account-switcher.d.ts +14 -0
- package/dist/components/motion/wallet-card/account-switcher.d.ts.map +1 -0
- package/dist/components/motion/wallet-card/account-switcher.js +153 -0
- package/dist/components/motion/wallet-card/account-switcher.js.map +1 -0
- package/dist/components/motion/wallet-card/actions.d.ts +12 -0
- package/dist/components/motion/wallet-card/actions.d.ts.map +1 -0
- package/dist/components/motion/wallet-card/actions.js +58 -0
- package/dist/components/motion/wallet-card/actions.js.map +1 -0
- package/dist/components/motion/wallet-card/balance-delta.d.ts +12 -0
- package/dist/components/motion/wallet-card/balance-delta.d.ts.map +1 -0
- package/dist/components/motion/wallet-card/balance-delta.js +72 -0
- package/dist/components/motion/wallet-card/balance-delta.js.map +1 -0
- package/dist/components/motion/wallet-card/copy-button.d.ts +12 -0
- package/dist/components/motion/wallet-card/copy-button.d.ts.map +1 -0
- package/dist/components/motion/wallet-card/copy-button.js +41 -0
- package/dist/components/motion/wallet-card/copy-button.js.map +1 -0
- package/dist/components/motion/wallet-card/index.d.ts +13 -0
- package/dist/components/motion/wallet-card/index.d.ts.map +1 -0
- package/dist/components/motion/wallet-card/index.js +115 -0
- package/dist/components/motion/wallet-card/index.js.map +1 -0
- package/dist/components/motion/wallet-card/search-bar.d.ts +17 -0
- package/dist/components/motion/wallet-card/search-bar.d.ts.map +1 -0
- package/dist/components/motion/wallet-card/search-bar.js +156 -0
- package/dist/components/motion/wallet-card/search-bar.js.map +1 -0
- package/dist/components/reui/alert.d.ts +1 -1
- package/dist/components/reui/alert.js +1 -1
- package/dist/components/reui/autocomplete.js +1 -1
- package/dist/components/reui/badge.d.ts +1 -1
- package/dist/components/reui/cascader/cascader-async.d.ts +3 -2
- package/dist/components/reui/cascader/cascader-async.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-async.js.map +1 -1
- package/dist/components/reui/cascader/cascader-columns.js +4 -4
- package/dist/components/reui/cascader/cascader-columns.js.map +1 -1
- package/dist/components/reui/cascader/cascader-context.d.ts +12 -4
- package/dist/components/reui/cascader/cascader-context.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-context.js.map +1 -1
- package/dist/components/reui/cascader/cascader-footer.js +1 -1
- package/dist/components/reui/cascader/cascader-i18n.d.ts +1 -1
- package/dist/components/reui/cascader/cascader-item.d.ts +2 -2
- package/dist/components/reui/cascader/cascader-item.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-item.js +23 -17
- package/dist/components/reui/cascader/cascader-item.js.map +1 -1
- package/dist/components/reui/cascader/cascader-lib.d.ts +8 -1
- package/dist/components/reui/cascader/cascader-lib.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-lib.js +19 -11
- package/dist/components/reui/cascader/cascader-lib.js.map +1 -1
- package/dist/components/reui/cascader/cascader-nav.d.ts +1 -1
- package/dist/components/reui/cascader/cascader-nav.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-nav.js +6 -5
- 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.map +1 -1
- package/dist/components/reui/cascader/cascader-virtual.js.map +1 -1
- package/dist/components/reui/cascader/cascader.d.ts +6 -2
- package/dist/components/reui/cascader/cascader.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader.js +59 -21
- package/dist/components/reui/cascader/cascader.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-filter.js +3 -3
- 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.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-header.js +18 -14
- package/dist/components/reui/data-grid/data-grid-column-header.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-visibility.js +1 -1
- package/dist/components/reui/data-grid/data-grid-column-visibility.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-pagination.js +2 -2
- package/dist/components/reui/data-grid/data-grid-pagination.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-scroll-area.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-scroll-area.js +85 -61
- 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 +7 -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 +68 -39
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd.d.ts +7 -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 +90 -26
- package/dist/components/reui/data-grid/data-grid-table-dnd.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-virtual.js +1 -1
- 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.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table.js +157 -38
- package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid.d.ts +16 -0
- package/dist/components/reui/data-grid/data-grid.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid.js +81 -51
- package/dist/components/reui/data-grid/data-grid.js.map +1 -1
- package/dist/components/reui/date-selector.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-agenda-view.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-event.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-month-view.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-nav.js +2 -2
- package/dist/components/reui/filters/filters-advanced.js +2 -2
- package/dist/components/reui/filters/filters-advanced.js.map +1 -1
- package/dist/components/reui/filters/filters-builder.d.ts +1 -1
- package/dist/components/reui/filters/filters-builder.js +1 -1
- package/dist/components/reui/filters/filters-chip.js +2 -2
- package/dist/components/reui/filters/filters-editors.js +1 -1
- package/dist/components/reui/filters/filters-lib.d.ts +1 -1
- package/dist/components/reui/filters/filters.js +1 -1
- package/dist/components/reui/frame.js +1 -1
- package/dist/components/reui/gantt/gantt-bar.js +1 -1
- package/dist/components/reui/gantt/gantt-nav.js +2 -2
- package/dist/components/reui/gantt/gantt-view.js +1 -1
- package/dist/components/reui/kanban.d.ts.map +1 -1
- package/dist/components/reui/kanban.js +30 -1
- package/dist/components/reui/kanban.js.map +1 -1
- package/dist/components/reui/number-field.js +1 -1
- package/dist/components/reui/phone-input.js +1 -1
- package/dist/components/reui/rating.js +1 -1
- package/dist/components/reui/signature-pad.d.ts +160 -0
- package/dist/components/reui/signature-pad.d.ts.map +1 -0
- package/dist/components/reui/signature-pad.js +764 -0
- package/dist/components/reui/signature-pad.js.map +1 -0
- package/dist/components/reui/time-picker.d.ts +202 -0
- package/dist/components/reui/time-picker.d.ts.map +1 -0
- package/dist/components/reui/time-picker.js +1002 -0
- package/dist/components/reui/time-picker.js.map +1 -0
- package/dist/components/reui/tree.js +1 -1
- package/dist/components/ui/accordion.js +1 -1
- package/dist/components/ui/alert-dialog.js +1 -1
- package/dist/components/ui/alert.js +1 -1
- package/dist/components/ui/attachment.js +1 -1
- package/dist/components/ui/breadcrumb.js +1 -1
- package/dist/components/ui/bubble.js +1 -1
- package/dist/components/ui/button-group.js +1 -1
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/calendar.js +1 -1
- package/dist/components/ui/carousel.js +1 -1
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/combobox.js +1 -1
- package/dist/components/ui/command.js +1 -1
- package/dist/components/ui/context-menu.js +1 -1
- package/dist/components/ui/dialog.js +1 -1
- package/dist/components/ui/dropdown-menu.js +1 -1
- package/dist/components/ui/empty.js +1 -1
- package/dist/components/ui/field.js +1 -1
- package/dist/components/ui/input-group.d.ts +1 -1
- package/dist/components/ui/input-group.js +1 -1
- package/dist/components/ui/input-otp.js +1 -1
- package/dist/components/ui/item.js +1 -1
- package/dist/components/ui/marker.d.ts +1 -1
- package/dist/components/ui/marker.js +1 -1
- package/dist/components/ui/menubar.js +1 -1
- package/dist/components/ui/message-scroller.js +1 -1
- package/dist/components/ui/native-select.js +1 -1
- package/dist/components/ui/navigation-menu.js +1 -1
- package/dist/components/ui/pagination.js +1 -1
- package/dist/components/ui/questionnaire.js +1 -1
- package/dist/components/ui/select.js +1 -1
- package/dist/components/ui/sheet.js +1 -1
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/spinner.js +1 -1
- package/dist/components/ui/tabs.js +1 -1
- package/dist/components/ui/toast.js +1 -1
- package/dist/components/ui/toggle.js +1 -1
- package/dist/constants-CsKm9sSk.js +30 -0
- package/dist/constants-CsKm9sSk.js.map +1 -0
- package/dist/context-3_vY1jbv.js +141 -0
- package/dist/context-3_vY1jbv.js.map +1 -0
- package/dist/context-BE60udRT.js +99 -0
- package/dist/context-BE60udRT.js.map +1 -0
- package/dist/context-BYXeJQnz.d.ts +150 -0
- package/dist/context-BYXeJQnz.d.ts.map +1 -0
- package/dist/context-Bc6VC1HA.js +181 -0
- package/dist/context-Bc6VC1HA.js.map +1 -0
- package/dist/context-BqjZ1Z_w.js +111 -0
- package/dist/context-BqjZ1Z_w.js.map +1 -0
- package/dist/context-CZfRKkcZ.js +204 -0
- package/dist/context-CZfRKkcZ.js.map +1 -0
- package/dist/context-Cn-00gfW.js +169 -0
- package/dist/context-Cn-00gfW.js.map +1 -0
- package/dist/context-Cnlo53sV.d.ts +92 -0
- package/dist/context-Cnlo53sV.d.ts.map +1 -0
- package/dist/context-Rl5VCYA8.js +257 -0
- package/dist/context-Rl5VCYA8.js.map +1 -0
- package/dist/context-sD8DQga-.js +122 -0
- package/dist/context-sD8DQga-.js.map +1 -0
- package/dist/{copy-menu-TIKvPaAZ.js → copy-menu-C5GaT4Z-.js} +2 -2
- package/dist/{copy-menu-TIKvPaAZ.js.map → copy-menu-C5GaT4Z-.js.map} +1 -1
- package/dist/ease-B82HVmio.d.ts +50 -0
- package/dist/ease-B82HVmio.d.ts.map +1 -0
- package/dist/hooks/use-modal-scope.d.ts +6 -0
- package/dist/hooks/use-modal-scope.d.ts.map +1 -0
- package/dist/hooks/use-modal-scope.js +83 -0
- package/dist/hooks/use-modal-scope.js.map +1 -0
- package/dist/lib/ease.d.ts +2 -49
- package/dist/model-DfeFradZ.d.ts +9 -0
- package/dist/model-DfeFradZ.d.ts.map +1 -0
- package/dist/model-DlbIqCZg.d.ts +41 -0
- package/dist/model-DlbIqCZg.d.ts.map +1 -0
- package/dist/plot-CdFTbMI_.js +131 -0
- package/dist/plot-CdFTbMI_.js.map +1 -0
- package/dist/positioner-3mCqiebN.js +204 -0
- package/dist/positioner-3mCqiebN.js.map +1 -0
- package/dist/tooltip-BarafYiU.d.ts +67 -0
- package/dist/tooltip-BarafYiU.d.ts.map +1 -0
- package/dist/tooltip-BqxVD6D-.d.ts +64 -0
- package/dist/tooltip-BqxVD6D-.d.ts.map +1 -0
- package/dist/tooltip-C01qUgsW.d.ts +133 -0
- package/dist/tooltip-C01qUgsW.d.ts.map +1 -0
- package/dist/tooltip-C6qUs7px.d.ts +36 -0
- package/dist/tooltip-C6qUs7px.d.ts.map +1 -0
- package/dist/tooltip-DQ4DXgeu.d.ts +94 -0
- package/dist/tooltip-DQ4DXgeu.d.ts.map +1 -0
- package/dist/types-B_6p3LXz.d.ts +36 -0
- package/dist/types-B_6p3LXz.d.ts.map +1 -0
- package/dist/types-D6e3gWOA.d.ts +22 -0
- package/dist/types-D6e3gWOA.d.ts.map +1 -0
- package/dist/use-geometry-CH0foIo7.d.ts +9 -0
- package/dist/use-geometry-CH0foIo7.d.ts.map +1 -0
- package/dist/utils-B3YXTsDI.js +26 -0
- package/dist/utils-B3YXTsDI.js.map +1 -0
- package/package.json +14 -9
- package/dist/cascader-types-BnH6wYD-.d.ts.map +0 -1
- package/dist/lib/ease.d.ts.map +0 -1
|
@@ -3,9 +3,9 @@ import { EASE_OUT, SPRING_PRESS } from "../../lib/ease.js";
|
|
|
3
3
|
import { Liquid, LiquidItem } from "./liquid.js";
|
|
4
4
|
import { createContext, useCallback, useContext, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
5
5
|
import { cn } from "@kumix/utils";
|
|
6
|
-
import { Minus, Plus } from "lucide-react";
|
|
7
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
7
|
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
8
|
+
import { Minus, Plus } from "lucide-react";
|
|
9
9
|
//#region src/components/motion/adaptive-stepper.tsx
|
|
10
10
|
const STEPPER_LIQUID_TRANSITION = {
|
|
11
11
|
duration: 600,
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ComponentProps, RefObject } from "react";
|
|
2
|
+
import { HTMLMotionProps } from "motion/react";
|
|
3
|
+
//#region src/components/motion/alert.d.ts
|
|
4
|
+
export type AlertVariant = "default" | "info" | "success" | "warning" | "destructive";
|
|
5
|
+
export type AlertState = {
|
|
6
|
+
open: boolean;
|
|
7
|
+
variant: AlertVariant;
|
|
8
|
+
setOpen: (open: boolean) => void;
|
|
9
|
+
dismiss: () => void;
|
|
10
|
+
};
|
|
11
|
+
/** Shared visibility and variant for custom alert children. */
|
|
12
|
+
export declare function useAlert(): AlertState;
|
|
13
|
+
export interface AlertProps extends Omit<HTMLMotionProps<"div">, "initial" | "animate" | "exit" | "layout" | "transition" | "role"> {
|
|
14
|
+
variant?: AlertVariant;
|
|
15
|
+
open?: boolean;
|
|
16
|
+
defaultOpen?: boolean;
|
|
17
|
+
onOpenChange?: (open: boolean) => void;
|
|
18
|
+
/** Focus this element when closing hides the currently focused alert control. */
|
|
19
|
+
returnFocusRef?: RefObject<HTMLElement | null>;
|
|
20
|
+
/** Layout classes for the inner row, separate from the animated surface. */
|
|
21
|
+
contentClassName?: string;
|
|
22
|
+
/** Defaults to alert for warning/destructive, and status for other variants. */
|
|
23
|
+
role?: "alert" | "status";
|
|
24
|
+
}
|
|
25
|
+
export declare function Alert({ variant, open: controlledOpen, defaultOpen, onOpenChange, returnFocusRef, contentClassName, className, children, role, style, ref, ...props }: AlertProps): import("react").JSX.Element;
|
|
26
|
+
export interface AlertIconProps extends ComponentProps<"span"> {}
|
|
27
|
+
export declare function AlertIcon({ className, children, ...props }: AlertIconProps): import("react").JSX.Element;
|
|
28
|
+
export interface AlertContentProps extends ComponentProps<"div"> {}
|
|
29
|
+
export declare function AlertContent({ className, ...props }: AlertContentProps): import("react").JSX.Element;
|
|
30
|
+
export interface AlertTitleProps extends ComponentProps<"div"> {}
|
|
31
|
+
export declare function AlertTitle({ className, ...props }: AlertTitleProps): import("react").JSX.Element;
|
|
32
|
+
export interface AlertDescriptionProps extends ComponentProps<"div"> {}
|
|
33
|
+
export declare function AlertDescription({ className, ...props }: AlertDescriptionProps): import("react").JSX.Element;
|
|
34
|
+
export interface AlertActionProps extends ComponentProps<"div"> {}
|
|
35
|
+
/** Compose buttons or links here; this part never creates a nested button. */
|
|
36
|
+
export declare function AlertAction({ className, ...props }: AlertActionProps): import("react").JSX.Element;
|
|
37
|
+
export interface AlertCloseProps extends Omit<HTMLMotionProps<"button">, "layout"> {}
|
|
38
|
+
export declare function AlertClose({ className, children, onClick, ...props }: AlertCloseProps): import("react").JSX.Element;
|
|
39
|
+
//#endregion
|
|
40
|
+
//# sourceMappingURL=alert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.d.ts","names":[],"sources":["../../../src/components/motion/alert.tsx"],"mappings":";;;YAoBY;YAEA;EACV;EACA,SAAS;EACT,UAAU;EACV;;;wBAYc,YAAY;iBAoBX,mBACP,KACN;EAGF,UAAU;EACV;EACA;EACA,gBAAgB;;EAEhB,iBAAiB,UAAU;;EAE3B;;EAEA;;wBAGc,QACd,SACA,MAAM,gBACN,aACA,cACA,gBACA,kBACA,WACA,UACA,MACA,OACA,QACG,SACF,6BAAU,IAAA;iBAyGI,uBAAuB;wBAExB,YAAY,WAAW,aAAa,SAAS,iCAAc,IAAA;iBAiC1D,0BAA0B;wBAE3B,eAAe,cAAc,SAAS,oCAAiB,IAAA;iBAUtD,wBAAwB;wBAEzB,aAAa,cAAc,SAAS,kCAAe,IAAA;iBAUlD,8BAA8B;wBAE/B,mBAAmB,cAAc,SAAS,wCAAqB,IAAA;iBAa9D,yBAAyB;;wBAG1B,cAAc,cAAc,SAAS,mCAAgB,IAAA;iBAUpD,wBAAwB,KAAK;wBAE9B,aAAa,WAAW,UAAU,YAAY,SAAS,kCAAe,IAAA"}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { EASE_OUT, SPRING_LAYOUT, SPRING_PRESS } from "../../lib/ease.js";
|
|
3
|
+
import { t as PresenceGate } from "../../presence-gate-BekdC4Bo.js";
|
|
4
|
+
import { createContext, useCallback, useContext, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
5
|
+
import { cn } from "@kumix/utils";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
8
|
+
import { AlertCircle, CheckCircle2, Info, TriangleAlert, X } from "lucide-react";
|
|
9
|
+
//#region src/components/motion/alert.tsx
|
|
10
|
+
const AlertContext = createContext(null);
|
|
11
|
+
function useAlertContext(component) {
|
|
12
|
+
const context = useContext(AlertContext);
|
|
13
|
+
if (!context) throw new Error(`${component} must be used within <Alert>`);
|
|
14
|
+
return context;
|
|
15
|
+
}
|
|
16
|
+
/** Shared visibility and variant for custom alert children. */
|
|
17
|
+
function useAlert() {
|
|
18
|
+
return useAlertContext("useAlert");
|
|
19
|
+
}
|
|
20
|
+
const VARIANT_CLASS = {
|
|
21
|
+
default: "bg-background text-foreground",
|
|
22
|
+
info: "bg-primary/5 text-primary",
|
|
23
|
+
success: "bg-emerald-500/5 text-emerald-700 dark:text-emerald-400",
|
|
24
|
+
warning: "bg-amber-500/5 text-amber-800 dark:text-amber-300",
|
|
25
|
+
destructive: "bg-destructive/5 text-destructive"
|
|
26
|
+
};
|
|
27
|
+
const VARIANT_ICON = {
|
|
28
|
+
default: Info,
|
|
29
|
+
info: Info,
|
|
30
|
+
success: CheckCircle2,
|
|
31
|
+
warning: TriangleAlert,
|
|
32
|
+
destructive: AlertCircle
|
|
33
|
+
};
|
|
34
|
+
function Alert({ variant = "default", open: controlledOpen, defaultOpen = true, onOpenChange, returnFocusRef, contentClassName, className, children, role = variant === "warning" || variant === "destructive" ? "alert" : "status", style, ref, ...props }) {
|
|
35
|
+
const [internalOpen, setInternalOpen] = useState(defaultOpen);
|
|
36
|
+
const open = controlledOpen ?? internalOpen;
|
|
37
|
+
const reduce = useReducedMotion() ?? false;
|
|
38
|
+
const surfaceRef = useRef(null);
|
|
39
|
+
const stateRef = useRef({
|
|
40
|
+
open,
|
|
41
|
+
controlled: controlledOpen !== void 0,
|
|
42
|
+
onOpenChange
|
|
43
|
+
});
|
|
44
|
+
useLayoutEffect(() => {
|
|
45
|
+
stateRef.current = {
|
|
46
|
+
open,
|
|
47
|
+
controlled: controlledOpen !== void 0,
|
|
48
|
+
onOpenChange
|
|
49
|
+
};
|
|
50
|
+
}, [
|
|
51
|
+
controlledOpen,
|
|
52
|
+
onOpenChange,
|
|
53
|
+
open
|
|
54
|
+
]);
|
|
55
|
+
const setOpen = useCallback((next) => {
|
|
56
|
+
const state = stateRef.current;
|
|
57
|
+
if (next === state.open) return;
|
|
58
|
+
if (!state.controlled) {
|
|
59
|
+
stateRef.current = {
|
|
60
|
+
...state,
|
|
61
|
+
open: next
|
|
62
|
+
};
|
|
63
|
+
setInternalOpen(next);
|
|
64
|
+
}
|
|
65
|
+
state.onOpenChange?.(next);
|
|
66
|
+
}, []);
|
|
67
|
+
const dismiss = useCallback(() => setOpen(false), [setOpen]);
|
|
68
|
+
const context = useMemo(() => ({
|
|
69
|
+
open,
|
|
70
|
+
variant,
|
|
71
|
+
reduce,
|
|
72
|
+
setOpen,
|
|
73
|
+
dismiss
|
|
74
|
+
}), [
|
|
75
|
+
open,
|
|
76
|
+
variant,
|
|
77
|
+
reduce,
|
|
78
|
+
setOpen,
|
|
79
|
+
dismiss
|
|
80
|
+
]);
|
|
81
|
+
const setRef = useCallback((node) => {
|
|
82
|
+
surfaceRef.current = node;
|
|
83
|
+
const cleanup = typeof ref === "function" ? ref(node) : void 0;
|
|
84
|
+
if (ref && typeof ref !== "function") ref.current = node;
|
|
85
|
+
if (!node) return;
|
|
86
|
+
return () => {
|
|
87
|
+
surfaceRef.current = null;
|
|
88
|
+
if (typeof cleanup === "function") cleanup();
|
|
89
|
+
else if (typeof ref === "function") ref(null);
|
|
90
|
+
else if (ref) ref.current = null;
|
|
91
|
+
};
|
|
92
|
+
}, [ref]);
|
|
93
|
+
useLayoutEffect(() => {
|
|
94
|
+
if (!open && surfaceRef.current?.contains(document.activeElement)) returnFocusRef?.current?.focus({ preventScroll: true });
|
|
95
|
+
}, [open, returnFocusRef]);
|
|
96
|
+
return /* @__PURE__ */ jsx(AlertContext.Provider, {
|
|
97
|
+
value: context,
|
|
98
|
+
children: /* @__PURE__ */ jsx(AnimatePresence, {
|
|
99
|
+
initial: false,
|
|
100
|
+
children: open && /* @__PURE__ */ jsx(PresenceGate, { children: ({ gate, isPresent }) => /* @__PURE__ */ jsx(motion.div, {
|
|
101
|
+
...props,
|
|
102
|
+
...gate,
|
|
103
|
+
ref: setRef,
|
|
104
|
+
role,
|
|
105
|
+
"aria-hidden": !isPresent || props["aria-hidden"],
|
|
106
|
+
"data-slot": "alert",
|
|
107
|
+
"data-variant": variant,
|
|
108
|
+
"data-state": isPresent ? "open" : "closed",
|
|
109
|
+
initial: {
|
|
110
|
+
opacity: 0,
|
|
111
|
+
transform: reduce ? "none" : "translateY(-6px)"
|
|
112
|
+
},
|
|
113
|
+
animate: {
|
|
114
|
+
opacity: 1,
|
|
115
|
+
transform: "none"
|
|
116
|
+
},
|
|
117
|
+
exit: {
|
|
118
|
+
opacity: 0,
|
|
119
|
+
transform: reduce ? "none" : "translateY(-6px)",
|
|
120
|
+
transition: {
|
|
121
|
+
duration: .12,
|
|
122
|
+
ease: EASE_OUT
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
layout: !reduce,
|
|
126
|
+
transition: {
|
|
127
|
+
opacity: {
|
|
128
|
+
duration: .18,
|
|
129
|
+
ease: EASE_OUT
|
|
130
|
+
},
|
|
131
|
+
transform: {
|
|
132
|
+
duration: .2,
|
|
133
|
+
ease: EASE_OUT
|
|
134
|
+
},
|
|
135
|
+
layout: SPRING_LAYOUT
|
|
136
|
+
},
|
|
137
|
+
style: {
|
|
138
|
+
...style,
|
|
139
|
+
...gate.style,
|
|
140
|
+
originY: 0,
|
|
141
|
+
transitionTimingFunction: "cubic-bezier(0.16, 1, 0.3, 1)"
|
|
142
|
+
},
|
|
143
|
+
className: cn("relative w-full rounded-xl p-4 text-sm transition-colors duration-200", VARIANT_CLASS[variant], className),
|
|
144
|
+
children: /* @__PURE__ */ jsx(motion.div, {
|
|
145
|
+
layout: reduce ? false : "position",
|
|
146
|
+
transition: { layout: SPRING_LAYOUT },
|
|
147
|
+
style: { originY: 0 },
|
|
148
|
+
className: cn("flex min-w-0 items-start gap-3", contentClassName),
|
|
149
|
+
children
|
|
150
|
+
})
|
|
151
|
+
}) }, "alert")
|
|
152
|
+
})
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
function AlertIcon({ className, children, ...props }) {
|
|
156
|
+
const { variant, reduce } = useAlertContext("AlertIcon");
|
|
157
|
+
const Icon = VARIANT_ICON[variant];
|
|
158
|
+
return /* @__PURE__ */ jsx("span", {
|
|
159
|
+
...props,
|
|
160
|
+
"aria-hidden": "true",
|
|
161
|
+
"data-slot": "alert-icon",
|
|
162
|
+
className: cn("mt-0.5 inline-flex size-4 shrink-0 items-center justify-center", className),
|
|
163
|
+
children: /* @__PURE__ */ jsx(AnimatePresence, {
|
|
164
|
+
initial: false,
|
|
165
|
+
mode: "popLayout",
|
|
166
|
+
children: /* @__PURE__ */ jsx(motion.span, {
|
|
167
|
+
initial: {
|
|
168
|
+
opacity: 0,
|
|
169
|
+
transform: reduce ? "translateY(0px) scale(1)" : "translateY(4px) scale(0.9)"
|
|
170
|
+
},
|
|
171
|
+
animate: {
|
|
172
|
+
opacity: 1,
|
|
173
|
+
transform: "translateY(0px) scale(1)"
|
|
174
|
+
},
|
|
175
|
+
exit: {
|
|
176
|
+
opacity: 0,
|
|
177
|
+
transform: reduce ? "translateY(0px) scale(1)" : "translateY(-4px) scale(0.9)",
|
|
178
|
+
transition: {
|
|
179
|
+
duration: .1,
|
|
180
|
+
ease: EASE_OUT
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
transition: {
|
|
184
|
+
duration: .18,
|
|
185
|
+
ease: EASE_OUT
|
|
186
|
+
},
|
|
187
|
+
className: "inline-flex [&>svg]:size-4",
|
|
188
|
+
children: children ?? /* @__PURE__ */ jsx(Icon, {})
|
|
189
|
+
}, variant)
|
|
190
|
+
})
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
function AlertContent({ className, ...props }) {
|
|
194
|
+
return /* @__PURE__ */ jsx("div", {
|
|
195
|
+
...props,
|
|
196
|
+
"data-slot": "alert-content",
|
|
197
|
+
className: cn("min-w-0 flex-1 space-y-1", className)
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
function AlertTitle({ className, ...props }) {
|
|
201
|
+
return /* @__PURE__ */ jsx("div", {
|
|
202
|
+
...props,
|
|
203
|
+
"data-slot": "alert-title",
|
|
204
|
+
className: cn("text-pretty font-medium leading-5", className)
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
function AlertDescription({ className, ...props }) {
|
|
208
|
+
return /* @__PURE__ */ jsx("div", {
|
|
209
|
+
...props,
|
|
210
|
+
"data-slot": "alert-description",
|
|
211
|
+
className: cn("text-pretty text-muted-foreground leading-relaxed [&_a]:underline [&_a]:underline-offset-4", className)
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
/** Compose buttons or links here; this part never creates a nested button. */
|
|
215
|
+
function AlertAction({ className, ...props }) {
|
|
216
|
+
return /* @__PURE__ */ jsx("div", {
|
|
217
|
+
...props,
|
|
218
|
+
"data-slot": "alert-action",
|
|
219
|
+
className: cn("flex flex-wrap items-center gap-2 pt-2", className)
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
function AlertClose({ className, children, onClick, ...props }) {
|
|
223
|
+
const { dismiss, reduce } = useAlertContext("AlertClose");
|
|
224
|
+
return /* @__PURE__ */ jsx(motion.button, {
|
|
225
|
+
type: "button",
|
|
226
|
+
"aria-label": "Dismiss alert",
|
|
227
|
+
...props,
|
|
228
|
+
tabIndex: props.tabIndex ?? 0,
|
|
229
|
+
"data-slot": "alert-close",
|
|
230
|
+
layout: reduce ? false : "position",
|
|
231
|
+
transition: SPRING_PRESS,
|
|
232
|
+
whileTap: reduce ? void 0 : { scale: .94 },
|
|
233
|
+
className: cn("-m-1.5 inline-flex size-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground outline-none transition-colors hover:bg-foreground/5 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", className),
|
|
234
|
+
onClick: (event) => {
|
|
235
|
+
onClick?.(event);
|
|
236
|
+
if (!event.defaultPrevented) dismiss();
|
|
237
|
+
},
|
|
238
|
+
children: children ?? /* @__PURE__ */ jsx(X, {
|
|
239
|
+
"aria-hidden": "true",
|
|
240
|
+
className: "size-4"
|
|
241
|
+
})
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
//#endregion
|
|
245
|
+
export { Alert, AlertAction, AlertClose, AlertContent, AlertDescription, AlertIcon, AlertTitle, useAlert };
|
|
246
|
+
|
|
247
|
+
//# sourceMappingURL=alert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.js","names":[],"sources":["../../../src/components/motion/alert.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ComponentProps,\n createContext,\n type RefObject,\n useCallback,\n useContext,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { AlertCircle, CheckCircle2, Info, TriangleAlert, X } from \"lucide-react\";\nimport { AnimatePresence, type HTMLMotionProps, motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT, EASE_OUT_CSS, SPRING_LAYOUT, SPRING_PRESS } from \"../../lib/ease\";\nimport { PresenceGate } from \"../../lib/presence-gate\";\n\nexport type AlertVariant = \"default\" | \"info\" | \"success\" | \"warning\" | \"destructive\";\n\nexport type AlertState = {\n open: boolean;\n variant: AlertVariant;\n setOpen: (open: boolean) => void;\n dismiss: () => void;\n};\n\nconst AlertContext = createContext<(AlertState & { reduce: boolean }) | null>(null);\n\nfunction useAlertContext(component: string) {\n const context = useContext(AlertContext);\n if (!context) throw new Error(`${component} must be used within <Alert>`);\n return context;\n}\n\n/** Shared visibility and variant for custom alert children. */\nexport function useAlert(): AlertState {\n return useAlertContext(\"useAlert\");\n}\n\nconst VARIANT_CLASS: Record<AlertVariant, string> = {\n default: \"bg-background text-foreground\",\n info: \"bg-primary/5 text-primary\",\n success: \"bg-emerald-500/5 text-emerald-700 dark:text-emerald-400\",\n warning: \"bg-amber-500/5 text-amber-800 dark:text-amber-300\",\n destructive: \"bg-destructive/5 text-destructive\",\n};\n\nconst VARIANT_ICON = {\n default: Info,\n info: Info,\n success: CheckCircle2,\n warning: TriangleAlert,\n destructive: AlertCircle,\n};\n\nexport interface AlertProps\n extends Omit<\n HTMLMotionProps<\"div\">,\n \"initial\" | \"animate\" | \"exit\" | \"layout\" | \"transition\" | \"role\"\n > {\n variant?: AlertVariant;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Focus this element when closing hides the currently focused alert control. */\n returnFocusRef?: RefObject<HTMLElement | null>;\n /** Layout classes for the inner row, separate from the animated surface. */\n contentClassName?: string;\n /** Defaults to alert for warning/destructive, and status for other variants. */\n role?: \"alert\" | \"status\";\n}\n\nexport function Alert({\n variant = \"default\",\n open: controlledOpen,\n defaultOpen = true,\n onOpenChange,\n returnFocusRef,\n contentClassName,\n className,\n children,\n role = variant === \"warning\" || variant === \"destructive\" ? \"alert\" : \"status\",\n style,\n ref,\n ...props\n}: AlertProps) {\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const open = controlledOpen ?? internalOpen;\n const reduce = useReducedMotion() ?? false;\n const surfaceRef = useRef<HTMLDivElement>(null);\n const stateRef = useRef({ open, controlled: controlledOpen !== undefined, onOpenChange });\n\n useLayoutEffect(() => {\n stateRef.current = { open, controlled: controlledOpen !== undefined, onOpenChange };\n }, [controlledOpen, onOpenChange, open]);\n\n const setOpen = useCallback((next: boolean) => {\n const state = stateRef.current;\n if (next === state.open) return;\n if (!state.controlled) {\n stateRef.current = { ...state, open: next };\n setInternalOpen(next);\n }\n state.onOpenChange?.(next);\n }, []);\n const dismiss = useCallback(() => setOpen(false), [setOpen]);\n const context = useMemo(\n () => ({ open, variant, reduce, setOpen, dismiss }),\n [open, variant, reduce, setOpen, dismiss],\n );\n\n const setRef = useCallback(\n (node: HTMLDivElement | null) => {\n surfaceRef.current = node;\n const cleanup = typeof ref === \"function\" ? ref(node) : undefined;\n if (ref && typeof ref !== \"function\") ref.current = node;\n if (!node) return;\n return () => {\n surfaceRef.current = null;\n if (typeof cleanup === \"function\") cleanup();\n else if (typeof ref === \"function\") ref(null);\n else if (ref) ref.current = null;\n };\n },\n [ref],\n );\n\n useLayoutEffect(() => {\n if (!open && surfaceRef.current?.contains(document.activeElement)) {\n returnFocusRef?.current?.focus({ preventScroll: true });\n }\n }, [open, returnFocusRef]);\n\n return (\n <AlertContext.Provider value={context}>\n <AnimatePresence initial={false}>\n {open && (\n <PresenceGate key=\"alert\">\n {({ gate, isPresent }) => (\n <motion.div\n {...props}\n {...gate}\n ref={setRef}\n role={role}\n aria-hidden={!isPresent || props[\"aria-hidden\"]}\n data-slot=\"alert\"\n data-variant={variant}\n data-state={isPresent ? \"open\" : \"closed\"}\n initial={{ opacity: 0, transform: reduce ? \"none\" : \"translateY(-6px)\" }}\n animate={{ opacity: 1, transform: \"none\" }}\n exit={{\n opacity: 0,\n transform: reduce ? \"none\" : \"translateY(-6px)\",\n transition: { duration: 0.12, ease: EASE_OUT },\n }}\n layout={!reduce}\n transition={{\n opacity: { duration: 0.18, ease: EASE_OUT },\n transform: { duration: 0.2, ease: EASE_OUT },\n layout: SPRING_LAYOUT,\n }}\n style={{\n ...style,\n ...gate.style,\n originY: 0,\n transitionTimingFunction: EASE_OUT_CSS,\n }}\n className={cn(\n \"relative w-full rounded-xl p-4 text-sm transition-colors duration-200\",\n VARIANT_CLASS[variant],\n className,\n )}\n >\n <motion.div\n layout={reduce ? false : \"position\"}\n transition={{ layout: SPRING_LAYOUT }}\n style={{ originY: 0 }}\n className={cn(\"flex min-w-0 items-start gap-3\", contentClassName)}\n >\n {children}\n </motion.div>\n </motion.div>\n )}\n </PresenceGate>\n )}\n </AnimatePresence>\n </AlertContext.Provider>\n );\n}\n\nexport interface AlertIconProps extends ComponentProps<\"span\"> {}\n\nexport function AlertIcon({ className, children, ...props }: AlertIconProps) {\n const { variant, reduce } = useAlertContext(\"AlertIcon\");\n const Icon = VARIANT_ICON[variant];\n return (\n <span\n {...props}\n aria-hidden=\"true\"\n data-slot=\"alert-icon\"\n className={cn(\"mt-0.5 inline-flex size-4 shrink-0 items-center justify-center\", className)}\n >\n <AnimatePresence initial={false} mode=\"popLayout\">\n <motion.span\n key={variant}\n initial={{\n opacity: 0,\n transform: reduce ? \"translateY(0px) scale(1)\" : \"translateY(4px) scale(0.9)\",\n }}\n animate={{ opacity: 1, transform: \"translateY(0px) scale(1)\" }}\n exit={{\n opacity: 0,\n transform: reduce ? \"translateY(0px) scale(1)\" : \"translateY(-4px) scale(0.9)\",\n transition: { duration: 0.1, ease: EASE_OUT },\n }}\n transition={{ duration: 0.18, ease: EASE_OUT }}\n className=\"inline-flex [&>svg]:size-4\"\n >\n {children ?? <Icon />}\n </motion.span>\n </AnimatePresence>\n </span>\n );\n}\n\nexport interface AlertContentProps extends ComponentProps<\"div\"> {}\n\nexport function AlertContent({ className, ...props }: AlertContentProps) {\n return (\n <div\n {...props}\n data-slot=\"alert-content\"\n className={cn(\"min-w-0 flex-1 space-y-1\", className)}\n />\n );\n}\n\nexport interface AlertTitleProps extends ComponentProps<\"div\"> {}\n\nexport function AlertTitle({ className, ...props }: AlertTitleProps) {\n return (\n <div\n {...props}\n data-slot=\"alert-title\"\n className={cn(\"text-pretty font-medium leading-5\", className)}\n />\n );\n}\n\nexport interface AlertDescriptionProps extends ComponentProps<\"div\"> {}\n\nexport function AlertDescription({ className, ...props }: AlertDescriptionProps) {\n return (\n <div\n {...props}\n data-slot=\"alert-description\"\n className={cn(\n \"text-pretty text-muted-foreground leading-relaxed [&_a]:underline [&_a]:underline-offset-4\",\n className,\n )}\n />\n );\n}\n\nexport interface AlertActionProps extends ComponentProps<\"div\"> {}\n\n/** Compose buttons or links here; this part never creates a nested button. */\nexport function AlertAction({ className, ...props }: AlertActionProps) {\n return (\n <div\n {...props}\n data-slot=\"alert-action\"\n className={cn(\"flex flex-wrap items-center gap-2 pt-2\", className)}\n />\n );\n}\n\nexport interface AlertCloseProps extends Omit<HTMLMotionProps<\"button\">, \"layout\"> {}\n\nexport function AlertClose({ className, children, onClick, ...props }: AlertCloseProps) {\n const { dismiss, reduce } = useAlertContext(\"AlertClose\");\n return (\n <motion.button\n type=\"button\"\n aria-label=\"Dismiss alert\"\n {...props}\n tabIndex={props.tabIndex ?? 0}\n data-slot=\"alert-close\"\n layout={reduce ? false : \"position\"}\n transition={SPRING_PRESS}\n whileTap={reduce ? undefined : { scale: 0.94 }}\n className={cn(\n \"-m-1.5 inline-flex size-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground outline-none transition-colors hover:bg-foreground/5 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\",\n className,\n )}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) dismiss();\n }}\n >\n {children ?? <X aria-hidden=\"true\" className=\"size-4\" />}\n </motion.button>\n );\n}\n"],"mappings":";;;;;;;;;AA6BA,MAAM,eAAe,cAAyD,IAAI;AAElF,SAAS,gBAAgB,WAAmB;CAC1C,MAAM,UAAU,WAAW,YAAY;CACvC,IAAI,CAAC,SAAS,MAAM,IAAI,MAAM,GAAG,UAAU,6BAA6B;CACxE,OAAO;AACT;;AAGA,SAAgB,WAAuB;CACrC,OAAO,gBAAgB,UAAU;AACnC;AAEA,MAAM,gBAA8C;CAClD,SAAS;CACT,MAAM;CACN,SAAS;C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,SAAS,GAAG,SAA0B;CACtF,MAAM,EAAE,SAAS,WAAW,gBAAgB,YAAY;CACxD,OACE,oBAAC,OAAO,QAAR;EACE,MAAK;EACL,cAAW;EACX,GAAI;EACJ,UAAU,MAAM,YAAY;EAC5B,aAAU;EACV,QAAQ,SAAS,QAAQ;EACzB,YAAY;EACZ,UAAU,SAAS,KAAA,IAAY,EAAE,OAAO,IAAK;EAC7C,WAAW,GACT,4QACA,SACF;EACA,UAAU,UAAU;GAClB,UAAU,KAAK;GACf,IAAI,CAAC,MAAM,kBAAkB,QAAQ;EACvC;EAEC,UAAA,YAAY,oBAAC,GAAD;GAAG,eAAY;GAAO,WAAU;EAAU,CAAA;CAC1C,CAAA;AAEnB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { EASE_OUT } from "../../lib/ease.js";
|
|
3
3
|
import { cn } from "@kumix/utils";
|
|
4
|
-
import { AlertTriangle, Check, Circle, Info, LoaderCircle, X } from "lucide-react";
|
|
5
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
5
|
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
6
|
+
import { AlertTriangle, Check, Circle, Info, LoaderCircle, X } from "lucide-react";
|
|
7
7
|
//#region src/components/motion/animated-badge.tsx
|
|
8
8
|
const STATUS_CLASS = {
|
|
9
9
|
neutral: "border-border bg-card text-muted-foreground",
|
|
@@ -3,9 +3,9 @@ import { EASE_DRAWER, EASE_OUT, SPRING_LAYOUT, SPRING_PRESS } from "../../lib/ea
|
|
|
3
3
|
import { SharedLayoutBg } from "./shared-layout-bg.js";
|
|
4
4
|
import { createContext, createElement, forwardRef, useCallback, useContext, useEffect, useId, useRef, useState, useSyncExternalStore } from "react";
|
|
5
5
|
import { cn } from "@kumix/utils";
|
|
6
|
-
import { ChevronRight } from "lucide-react";
|
|
7
6
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
7
|
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
8
|
+
import { ChevronRight } from "lucide-react";
|
|
9
9
|
import { createPortal } from "react-dom";
|
|
10
10
|
//#region src/components/motion/animated-sidebar.tsx
|
|
11
11
|
const MOBILE_QUERY = "(max-width: 767px)";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animated-sidebar.js","names":[],"sources":["../../../src/components/motion/animated-sidebar.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ButtonHTMLAttributes,\n type CSSProperties,\n createContext,\n forwardRef,\n type HTMLAttributes,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useId,\n useRef,\n useState,\n useSyncExternalStore,\n} from \"react\";\nimport { ChevronRight } from \"lucide-react\";\nimport {\n AnimatePresence,\n type HTMLMotionProps,\n motion,\n useReducedMotion,\n type Variants,\n} from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_DRAWER, EASE_OUT, SPRING_LAYOUT, SPRING_PRESS } from \"../../lib/ease\";\nimport { SharedLayoutBg } from \"./shared-layout-bg\";\n\ntype SidebarState = \"expanded\" | \"collapsed\";\ntype SidebarSide = \"left\" | \"right\";\ntype SidebarVariant = \"sidebar\" | \"floating\" | \"inset\";\ntype SidebarCollapsible = \"offcanvas\" | \"icon\" | \"none\";\n\nconst MOBILE_QUERY = \"(max-width: 767px)\";\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\";\n\nconst PANEL_TRANSITION = {\n duration: 0.36,\n ease: EASE_DRAWER,\n} as const;\n\n// The desktop rail settles at a hard zero-width boundary. Keep the spring\n// critically damped so it cannot overshoot, pause against that boundary, and\n// then snap back during the final frame.\nconst SIDEBAR_MORPH_TRANSITION = {\n type: \"spring\",\n stiffness: 380,\n damping: 35,\n mass: 0.75,\n} as const;\n\nconst LABEL_ENTER_TRANSITION = {\n duration: 0.2,\n delay: 0.08,\n ease: EASE_OUT,\n} as const;\n\nconst LABEL_EXIT_TRANSITION = {\n duration: 0.12,\n ease: EASE_OUT,\n} as const;\n\nconst SUBMENU_TRANSITION = {\n duration: 0.18,\n ease: EASE_OUT,\n} as const;\n\nconst SUBMENU_VARIANTS: Variants = {\n closed: {\n opacity: 0,\n clipPath: \"inset(0 0 100% 0 round 8px)\",\n transition: {\n duration: 0.14,\n ease: EASE_OUT,\n staggerChildren: 0.025,\n staggerDirection: -1,\n },\n },\n open: {\n opacity: 1,\n clipPath: \"inset(0 0 0% 0 round 8px)\",\n transition: {\n duration: 0.2,\n delayChildren: 0.035,\n ease: EASE_OUT,\n staggerChildren: 0.045,\n },\n },\n};\n\nconst SUBMENU_ITEM_VARIANTS: Variants = {\n closed: {\n opacity: 0,\n y: -6,\n filter: \"blur(3px)\",\n },\n open: {\n opacity: 1,\n y: 0,\n filter: \"blur(0px)\",\n transition: SUBMENU_TRANSITION,\n },\n};\n\nconst REDUCED_TRANSITION = {\n duration: 0.16,\n ease: EASE_OUT,\n} as const;\n\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 subscribeToMobileQuery(callback: () => void) {\n const query = window.matchMedia(MOBILE_QUERY);\n query.addEventListener(\"change\", callback);\n return () => query.removeEventListener(\"change\", callback);\n}\n\nfunction getMobileSnapshot() {\n return window.matchMedia(MOBILE_QUERY).matches;\n}\n\nfunction getServerMobileSnapshot() {\n return false;\n}\n\nfunction useIsMobile() {\n return useSyncExternalStore(subscribeToMobileQuery, getMobileSnapshot, getServerMobileSnapshot);\n}\n\ninterface AnimatedSidebarContextValue {\n isMobile: boolean;\n layoutId: string;\n open: boolean;\n openMobile: boolean;\n reduce: boolean;\n setOpen: (open: boolean) => void;\n setOpenMobile: (open: boolean) => void;\n state: SidebarState;\n toggleSidebar: () => void;\n triggerRef: React.RefObject<HTMLButtonElement | null>;\n}\n\nconst AnimatedSidebarContext = createContext<AnimatedSidebarContextValue | null>(null);\n\ninterface AnimatedSidebarPanelContextValue {\n collapsed: boolean;\n collapsible: SidebarCollapsible;\n side: SidebarSide;\n}\n\nconst AnimatedSidebarPanelContext = createContext<AnimatedSidebarPanelContextValue | null>(null);\n\nexport function useAnimatedSidebar() {\n const context = useContext(AnimatedSidebarContext);\n if (!context) {\n throw new Error(\"useAnimatedSidebar must be used inside AnimatedSidebarProvider.\");\n }\n return context;\n}\n\nfunction useAnimatedSidebarPanel() {\n const context = useContext(AnimatedSidebarPanelContext);\n if (!context) {\n throw new Error(\"Animated Sidebar parts must be used inside AnimatedSidebar.\");\n }\n return context;\n}\n\ntype SidebarProviderStyle = CSSProperties & {\n \"--sidebar-width\"?: string;\n \"--sidebar-width-icon\"?: string;\n \"--sidebar-width-mobile\"?: string;\n};\n\nexport interface AnimatedSidebarProviderProps extends HTMLAttributes<HTMLDivElement> {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n openMobile?: boolean;\n defaultOpenMobile?: boolean;\n onOpenMobileChange?: (open: boolean) => void;\n style?: SidebarProviderStyle;\n}\n\nexport function AnimatedSidebarProvider({\n children,\n open,\n defaultOpen = true,\n onOpenChange,\n openMobile,\n defaultOpenMobile = false,\n onOpenMobileChange,\n className,\n style,\n ...props\n}: AnimatedSidebarProviderProps) {\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const [internalOpenMobile, setInternalOpenMobile] = useState(defaultOpenMobile);\n const isMobile = useIsMobile();\n const reduce = useReducedMotion() ?? false;\n const generatedId = useId();\n const triggerRef = useRef<HTMLButtonElement>(null);\n const desktopOpen = open ?? internalOpen;\n const mobileOpen = openMobile ?? internalOpenMobile;\n\n const setOpen = useCallback(\n (nextOpen: boolean) => {\n if (open === undefined) setInternalOpen(nextOpen);\n onOpenChange?.(nextOpen);\n },\n [onOpenChange, open],\n );\n\n const setOpenMobile = useCallback(\n (nextOpen: boolean) => {\n if (openMobile === undefined) setInternalOpenMobile(nextOpen);\n onOpenMobileChange?.(nextOpen);\n },\n [onOpenMobileChange, openMobile],\n );\n\n const toggleSidebar = useCallback(() => {\n if (isMobile) setOpenMobile(!mobileOpen);\n else setOpen(!desktopOpen);\n }, [desktopOpen, isMobile, mobileOpen, setOpen, setOpenMobile]);\n\n useEffect(() => {\n const handleShortcut = (event: KeyboardEvent) => {\n if (\n event.key.toLowerCase() === SIDEBAR_KEYBOARD_SHORTCUT &&\n (event.metaKey || event.ctrlKey)\n ) {\n event.preventDefault();\n toggleSidebar();\n }\n };\n\n window.addEventListener(\"keydown\", handleShortcut);\n return () => window.removeEventListener(\"keydown\", handleShortcut);\n }, [toggleSidebar]);\n\n return (\n <AnimatedSidebarContext.Provider\n value={{\n isMobile,\n layoutId: `${generatedId}-active`,\n open: desktopOpen,\n openMobile: mobileOpen,\n reduce,\n setOpen,\n setOpenMobile,\n state: desktopOpen ? \"expanded\" : \"collapsed\",\n toggleSidebar,\n triggerRef,\n }}\n >\n <div\n {...props}\n data-slot=\"sidebar-wrapper\"\n data-state={desktopOpen ? \"expanded\" : \"collapsed\"}\n style={{\n \"--sidebar-width\": \"16rem\",\n \"--sidebar-width-icon\": \"4.25rem\",\n \"--sidebar-width-mobile\": \"18rem\",\n ...style,\n }}\n className={cn(\"group/sidebar-wrapper flex min-h-svh w-full min-w-0\", className)}\n >\n {children}\n </div>\n </AnimatedSidebarContext.Provider>\n );\n}\n\nfunction MobileSidebar({\n ariaLabel,\n children,\n className,\n side,\n}: {\n ariaLabel: string;\n children: ReactNode;\n className?: string;\n side: SidebarSide;\n}) {\n const context = useAnimatedSidebar();\n const panelRef = useRef<HTMLDivElement>(null);\n const [mounted, setMounted] = useState(false);\n // The sheet is mounted for as long as the viewport is mobile, so it hides\n // itself while closed rather than sitting there transparent and interactive.\n // Opening shows it in the same commit that starts the slide — a delayed show\n // would run the focus effect below against a still-hidden panel, and focus()\n // on a hidden element is ignored. Closing waits for the slide to finish, and\n // the panel's own exit tells us when that is: no duration to keep in sync.\n const [hidden, setHidden] = useState(!context.openMobile);\n // The completion callback fires for the open slide too, and it reads state\n // from whenever motion settles: a ref keeps it on the current one.\n const openMobileRef = useRef(context.openMobile);\n\n useEffect(() => setMounted(true), []);\n\n useEffect(() => {\n openMobileRef.current = context.openMobile;\n if (context.openMobile) setHidden(false);\n }, [context.openMobile]);\n\n useEffect(() => {\n if (!context.openMobile) return;\n\n const body = document.body;\n const scrollY = window.scrollY;\n const previousBodyStyles = {\n left: body.style.left,\n overflow: body.style.overflow,\n position: body.style.position,\n right: body.style.right,\n top: body.style.top,\n };\n\n body.style.position = \"fixed\";\n body.style.top = `-${scrollY}px`;\n body.style.left = \"0\";\n body.style.right = \"0\";\n body.style.overflow = \"hidden\";\n\n const focusFrame = requestAnimationFrame(() => {\n const firstFocusable = panelRef.current?.querySelector<HTMLElement>(FOCUSABLE_SELECTOR);\n (firstFocusable ?? panelRef.current)?.focus({ preventScroll: true });\n });\n\n return () => {\n cancelAnimationFrame(focusFrame);\n body.style.position = previousBodyStyles.position;\n body.style.top = previousBodyStyles.top;\n body.style.left = previousBodyStyles.left;\n body.style.right = previousBodyStyles.right;\n body.style.overflow = previousBodyStyles.overflow;\n window.scrollTo(0, scrollY);\n context.triggerRef.current?.focus({ preventScroll: true });\n };\n }, [context.openMobile, context.triggerRef]);\n\n if (!mounted) return null;\n\n // This container groups the sheet for hiding and the z-index and carries no\n // box: both children are `fixed` and resolve against the viewport themselves.\n // The scrim spans the viewport edges but paints a colour, and the panel is\n // inset off one side and paints its own surface, so no layer here is a\n // transparent edge-spanning one. See tests/fixed-overlay-edge-sampling.test.tsx.\n return createPortal(\n <div\n className={cn(\n \"pointer-events-none fixed top-0 left-0 z-50 size-0 md:hidden\",\n hidden && !context.openMobile ? \"invisible\" : \"visible\",\n )}\n >\n <motion.button\n type=\"button\"\n aria-label=\"Close sidebar\"\n tabIndex={context.openMobile ? 0 : -1}\n initial={false}\n animate={{ opacity: context.openMobile ? 1 : 0 }}\n transition={context.reduce ? REDUCED_TRANSITION : PANEL_TRANSITION}\n onClick={() => context.setOpenMobile(false)}\n className={cn(\n \"fixed inset-0 bg-black/40\",\n context.openMobile ? \"pointer-events-auto\" : \"pointer-events-none\",\n )}\n />\n\n <motion.div\n ref={panelRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={ariaLabel}\n aria-hidden={!context.openMobile}\n inert={!context.openMobile}\n tabIndex={-1}\n data-mobile=\"true\"\n data-state={context.openMobile ? \"expanded\" : \"collapsed\"}\n data-side={side}\n initial={false}\n animate={{\n opacity: context.reduce ? (context.openMobile ? 1 : 0) : 1,\n x: context.reduce ? 0 : context.openMobile ? \"0%\" : side === \"left\" ? \"-100%\" : \"100%\",\n }}\n transition={context.reduce ? REDUCED_TRANSITION : PANEL_TRANSITION}\n onAnimationComplete={() => {\n if (!openMobileRef.current) setHidden(true);\n }}\n onKeyDown={(event) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n context.setOpenMobile(false);\n return;\n }\n\n if (event.key !== \"Tab\") return;\n const focusable = panelRef.current\n ? Array.from(panelRef.current.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR))\n : [];\n\n if (focusable.length === 0) {\n event.preventDefault();\n panelRef.current?.focus();\n return;\n }\n\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\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 className={cn(\n \"pointer-events-auto fixed inset-y-0 flex h-dvh w-(--sidebar-width-mobile) max-w-[88vw] flex-col overflow-hidden\",\n \"border-border bg-background shadow-2xl will-change-transform\",\n side === \"left\" ? \"left-0 border-r\" : \"right-0 border-l\",\n !context.openMobile && \"pointer-events-none\",\n className,\n )}\n >\n <AnimatedSidebarPanelContext.Provider\n value={{ collapsed: false, collapsible: \"none\", side }}\n >\n {children}\n </AnimatedSidebarPanelContext.Provider>\n </motion.div>\n </div>,\n document.body,\n );\n}\n\nexport interface AnimatedSidebarProps extends Omit<HTMLMotionProps<\"aside\">, \"children\"> {\n children?: ReactNode;\n side?: SidebarSide;\n variant?: SidebarVariant;\n collapsible?: SidebarCollapsible;\n ariaLabel?: string;\n panelClassName?: string;\n}\n\nexport const AnimatedSidebar = forwardRef<HTMLElement, AnimatedSidebarProps>(\n function AnimatedSidebar(\n {\n side = \"left\",\n variant = \"sidebar\",\n collapsible = \"icon\",\n ariaLabel = \"Sidebar\",\n children,\n className,\n panelClassName,\n style,\n ...props\n },\n forwardedRef,\n ) {\n const context = useAnimatedSidebar();\n const collapsed = collapsible !== \"none\" && !context.open;\n const offcanvas = collapsed && collapsible === \"offcanvas\";\n const width = offcanvas\n ? \"0px\"\n : collapsed\n ? \"var(--sidebar-width-icon)\"\n : \"var(--sidebar-width)\";\n\n if (context.isMobile) {\n return (\n <MobileSidebar ariaLabel={ariaLabel} className={className} side={side}>\n {children}\n </MobileSidebar>\n );\n }\n\n return (\n <motion.aside\n {...props}\n ref={forwardedRef}\n initial={false}\n aria-label={ariaLabel}\n data-slot=\"sidebar\"\n data-state={collapsed ? \"collapsed\" : \"expanded\"}\n data-collapsible={collapsible}\n data-variant={variant}\n data-side={side}\n animate={{ width }}\n transition={context.reduce ? { duration: 0 } : SIDEBAR_MORPH_TRANSITION}\n style={style}\n className={cn(\n \"group/sidebar relative hidden h-auto shrink-0 will-change-[width] md:block\",\n \"peer\",\n side === \"right\" && \"order-last\",\n className,\n )}\n >\n <motion.div\n initial={false}\n animate={{\n opacity: offcanvas ? 0 : 1,\n x: offcanvas ? (side === \"left\" ? \"-100%\" : \"100%\") : \"0%\",\n }}\n transition={context.reduce ? REDUCED_TRANSITION : PANEL_TRANSITION}\n className={cn(\n \"sticky top-0 flex h-svh w-full flex-col overflow-hidden bg-background\",\n collapsible === \"offcanvas\" && \"w-(--sidebar-width)\",\n variant === \"sidebar\" &&\n (side === \"left\" ? \"border-border border-r\" : \"border-border border-l\"),\n variant === \"floating\" &&\n \"m-2 h-[calc(100svh-1rem)] rounded-2xl border border-border shadow-sm\",\n variant === \"inset\" && \"m-2 h-[calc(100svh-1rem)] rounded-2xl\",\n panelClassName,\n )}\n >\n <AnimatedSidebarPanelContext.Provider value={{ collapsed, collapsible, side }}>\n {children}\n </AnimatedSidebarPanelContext.Provider>\n </motion.div>\n </motion.aside>\n );\n },\n);\n\nexport interface AnimatedSidebarTriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {}\n\nexport const AnimatedSidebarTrigger = forwardRef<HTMLButtonElement, AnimatedSidebarTriggerProps>(\n function AnimatedSidebarTrigger({ className, onClick, type = \"button\", ...props }, forwardedRef) {\n const context = useAnimatedSidebar();\n const expanded = context.isMobile ? context.openMobile : context.open;\n\n return (\n <button\n {...props}\n ref={(node) => {\n context.triggerRef.current = node;\n if (typeof forwardedRef === \"function\") forwardedRef(node);\n else if (forwardedRef) forwardedRef.current = node;\n }}\n type={type}\n aria-label={props[\"aria-label\"] ?? \"Toggle sidebar\"}\n aria-expanded={expanded}\n data-slot=\"sidebar-trigger\"\n data-state={expanded ? \"expanded\" : \"collapsed\"}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) context.toggleSidebar();\n }}\n className={cn(\n \"inline-flex size-10 shrink-0 items-center justify-center rounded-xl outline-none\",\n \"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n className,\n )}\n />\n );\n },\n);\n\nexport interface AnimatedSidebarCloseProps extends ButtonHTMLAttributes<HTMLButtonElement> {}\n\nexport const AnimatedSidebarClose = forwardRef<HTMLButtonElement, AnimatedSidebarCloseProps>(\n function AnimatedSidebarClose({ className, onClick, type = \"button\", ...props }, forwardedRef) {\n const context = useAnimatedSidebar();\n\n return (\n <button\n {...props}\n ref={forwardedRef}\n type={type}\n aria-label={props[\"aria-label\"] ?? \"Close sidebar\"}\n onClick={(event) => {\n onClick?.(event);\n if (event.defaultPrevented) return;\n if (context.isMobile) context.setOpenMobile(false);\n else context.setOpen(false);\n }}\n className={cn(\n \"inline-flex size-10 shrink-0 items-center justify-center rounded-xl outline-none\",\n \"focus-visible:ring-2 focus-visible:ring-ring\",\n className,\n )}\n />\n );\n },\n);\n\nexport interface AnimatedSidebarRailProps extends ButtonHTMLAttributes<HTMLButtonElement> {}\n\nexport const AnimatedSidebarRail = forwardRef<HTMLButtonElement, AnimatedSidebarRailProps>(\n function AnimatedSidebarRail({ className, onClick, type = \"button\", ...props }, forwardedRef) {\n const context = useAnimatedSidebar();\n const panel = useAnimatedSidebarPanel();\n\n return (\n <button\n {...props}\n ref={forwardedRef}\n type={type}\n data-side={panel.side}\n aria-label={props[\"aria-label\"] ?? \"Toggle sidebar\"}\n title=\"Toggle sidebar\"\n tabIndex={-1}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) context.toggleSidebar();\n }}\n className={cn(\n \"absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 outline-none md:block\",\n \"after:absolute after:inset-y-0 after:left-1/2 after:w-px after:bg-transparent after:transition-colors hover:after:bg-border\",\n \"data-[side=right]:right-0 data-[side=left]:left-full data-[side=right]:translate-x-1/2\",\n className,\n )}\n />\n );\n },\n);\n\nexport interface AnimatedSidebarInsetProps extends HTMLMotionProps<\"main\"> {}\n\nexport const AnimatedSidebarInset = forwardRef<HTMLElement, AnimatedSidebarInsetProps>(\n function AnimatedSidebarInset({ className, ...props }, forwardedRef) {\n return (\n <motion.main\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-inset\"\n className={cn(\n \"relative flex min-h-svh min-w-0 flex-1 flex-col bg-background\",\n \"md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-2xl md:peer-data-[variant=inset]:shadow-sm\",\n className,\n )}\n />\n );\n },\n);\n\nexport const AnimatedSidebarHeader = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function AnimatedSidebarHeader({ className, ...props }, forwardedRef) {\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-header\"\n className={cn(\"flex shrink-0 flex-col gap-2 p-3\", className)}\n />\n );\n },\n);\n\nexport const AnimatedSidebarContent = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function AnimatedSidebarContent({ className, ...props }, forwardedRef) {\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-content\"\n className={cn(\n \"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overflow-x-hidden overscroll-contain px-2 py-2\",\n className,\n )}\n />\n );\n },\n);\n\nexport const AnimatedSidebarFooter = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function AnimatedSidebarFooter({ className, ...props }, forwardedRef) {\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-footer\"\n className={cn(\n \"flex shrink-0 flex-col gap-2 border-border border-t p-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]\",\n className,\n )}\n />\n );\n },\n);\n\nexport const AnimatedSidebarGroup = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function AnimatedSidebarGroup({ className, ...props }, forwardedRef) {\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-group\"\n className={cn(\"flex w-full min-w-0 flex-col px-1 py-1.5\", className)}\n />\n );\n },\n);\n\nexport const AnimatedSidebarGroupLabel = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function AnimatedSidebarGroupLabel({ children, className, ...props }, forwardedRef) {\n const { collapsed } = useAnimatedSidebarPanel();\n\n return (\n <div\n {...props}\n ref={forwardedRef}\n aria-hidden={collapsed}\n data-slot=\"sidebar-group-label\"\n className={cn(\n \"mb-1 h-7 overflow-hidden px-2 font-medium text-[10px] text-muted-foreground uppercase tracking-[0.14em] transition-opacity\",\n collapsed ? \"opacity-0\" : \"opacity-100\",\n className,\n )}\n >\n {children}\n </div>\n );\n },\n);\n\nexport const AnimatedSidebarGroupContent = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement>\n>(function AnimatedSidebarGroupContent({ className, ...props }, forwardedRef) {\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-group-content\"\n className={cn(\"w-full min-w-0\", className)}\n />\n );\n});\n\nexport const AnimatedSidebarMenu = forwardRef<HTMLUListElement, HTMLAttributes<HTMLUListElement>>(\n function AnimatedSidebarMenu({ children, className, ...props }, forwardedRef) {\n return (\n <SharedLayoutBg\n {...props}\n ref={forwardedRef as React.Ref<HTMLElement>}\n as=\"ul\"\n inset={0}\n pillClassName=\"rounded-xl bg-muted/70\"\n pillContainerClassName=\"inset-y-auto top-0 h-9\"\n data-slot=\"sidebar-menu\"\n className={cn(\"flex w-full min-w-0 list-none flex-col gap-0.5\", className)}\n >\n {children}\n </SharedLayoutBg>\n );\n },\n);\n\nexport const AnimatedSidebarMenuItem = forwardRef<HTMLLIElement, HTMLMotionProps<\"li\">>(\n function AnimatedSidebarMenuItem({ className, ...props }, forwardedRef) {\n return (\n <motion.li\n {...props}\n ref={forwardedRef}\n layout=\"position\"\n transition={SPRING_LAYOUT}\n data-slot=\"sidebar-menu-item\"\n className={cn(\"relative\", className)}\n />\n );\n },\n);\n\nexport interface AnimatedSidebarMenuSubProps extends Omit<HTMLMotionProps<\"ul\">, \"children\"> {\n open: boolean;\n children?: ReactNode;\n}\n\nexport const AnimatedSidebarMenuSub = forwardRef<HTMLUListElement, AnimatedSidebarMenuSubProps>(\n function AnimatedSidebarMenuSub({ open, children, className, ...props }, forwardedRef) {\n const context = useAnimatedSidebar();\n const panel = useAnimatedSidebarPanel();\n\n return (\n <AnimatePresence initial={false} mode=\"popLayout\">\n {open && !panel.collapsed ? (\n <motion.ul\n {...props}\n ref={forwardedRef}\n key=\"sidebar-submenu\"\n variants={context.reduce ? undefined : SUBMENU_VARIANTS}\n initial={context.reduce ? false : \"closed\"}\n animate={context.reduce ? { opacity: 1 } : \"open\"}\n exit={context.reduce ? { opacity: 0 } : \"closed\"}\n transition={context.reduce ? { duration: 0.12 } : undefined}\n data-slot=\"sidebar-menu-sub\"\n className={cn(\n \"relative mt-1 ml-5 flex min-w-0 flex-col gap-0.5 border-border border-l pl-3\",\n className,\n )}\n >\n {children}\n </motion.ul>\n ) : null}\n </AnimatePresence>\n );\n },\n);\n\nexport const AnimatedSidebarMenuSubItem = forwardRef<HTMLLIElement, HTMLMotionProps<\"li\">>(\n function AnimatedSidebarMenuSubItem({ className, ...props }, forwardedRef) {\n return (\n <motion.li\n {...props}\n ref={forwardedRef}\n variants={SUBMENU_ITEM_VARIANTS}\n data-slot=\"sidebar-menu-sub-item\"\n className={cn(\"relative min-w-0\", className)}\n />\n );\n },\n);\n\nexport interface AnimatedSidebarMenuSubButtonProps {\n children: ReactNode;\n icon?: ReactNode;\n href?: string;\n isActive?: boolean;\n disabled?: boolean;\n closeOnSelect?: boolean;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\";\n rel?: string;\n onSelect?: () => void;\n className?: string;\n}\n\nexport function AnimatedSidebarMenuSubButton({\n children,\n icon,\n href,\n isActive = false,\n disabled = false,\n closeOnSelect = true,\n target,\n rel,\n onSelect,\n className,\n}: AnimatedSidebarMenuSubButtonProps) {\n const context = useAnimatedSidebar();\n\n const select = (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n onSelect?.();\n if (context.isMobile && closeOnSelect) context.setOpenMobile(false);\n };\n\n const content = (\n <>\n <span aria-hidden=\"true\" className=\"grid size-4 shrink-0 place-items-center\">\n {icon ?? <span className=\"size-1 rounded-full bg-current\" />}\n </span>\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n </>\n );\n\n const interactiveClassName = cn(\n \"flex min-h-8 w-full min-w-0 items-center gap-2 rounded-lg px-2 text-left text-xs outline-none\",\n \"text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground\",\n \"focus-visible:bg-muted/70 focus-visible:ring-2 focus-visible:ring-ring\",\n isActive && \"bg-muted/70 text-foreground\",\n disabled && \"cursor-not-allowed opacity-40\",\n className,\n );\n\n return href ? (\n <motion.a\n href={href}\n target={target}\n rel={rel ?? (target === \"_blank\" ? \"noreferrer noopener\" : undefined)}\n aria-current={isActive ? \"page\" : undefined}\n aria-disabled={disabled || undefined}\n tabIndex={disabled ? -1 : undefined}\n onClick={select}\n whileTap={context.reduce || disabled ? undefined : { scale: 0.98 }}\n transition={SPRING_PRESS}\n className={interactiveClassName}\n >\n {content}\n </motion.a>\n ) : (\n <motion.button\n type=\"button\"\n disabled={disabled}\n aria-current={isActive ? \"page\" : undefined}\n onClick={select}\n whileTap={context.reduce || disabled ? undefined : { scale: 0.98 }}\n transition={SPRING_PRESS}\n className={interactiveClassName}\n >\n {content}\n </motion.button>\n );\n}\n\nexport interface AnimatedSidebarMenuButtonProps {\n children: ReactNode;\n icon?: ReactNode;\n badge?: ReactNode;\n href?: string;\n isActive?: boolean;\n ariaExpanded?: boolean;\n disabled?: boolean;\n closeOnSelect?: boolean;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\";\n rel?: string;\n onSelect?: () => void;\n className?: string;\n}\n\nexport function AnimatedSidebarMenuButton({\n children,\n icon,\n badge,\n href,\n isActive = false,\n ariaExpanded,\n disabled = false,\n closeOnSelect,\n target,\n rel,\n onSelect,\n className,\n}: AnimatedSidebarMenuButtonProps) {\n const context = useAnimatedSidebar();\n const panel = useAnimatedSidebarPanel();\n const textLabel = typeof children === \"string\" ? children : undefined;\n\n const select = (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n onSelect?.();\n const shouldCloseOnSelect = closeOnSelect ?? ariaExpanded === undefined;\n if (context.isMobile && shouldCloseOnSelect) {\n context.setOpenMobile(false);\n }\n // A submenu cannot render in the icon rail, so opening one from there\n // leaves its children unreachable — a pointer can still fall back to the\n // rail or the shortcut, a finger has nothing. Selecting a group unfolds\n // the panel that is about to hold it.\n if (ariaExpanded !== undefined && panel.collapsed && !context.isMobile) {\n context.setOpen(true);\n }\n };\n\n const content = (\n <>\n {isActive ? (\n <motion.span\n layoutId={context.layoutId}\n transition={context.reduce ? { duration: 0 } : SPRING_LAYOUT}\n className=\"absolute inset-0 rounded-xl bg-muted\"\n />\n ) : null}\n {icon ? (\n <span aria-hidden=\"true\" className=\"relative z-10 grid size-5 shrink-0 place-items-center\">\n {icon}\n </span>\n ) : null}\n <motion.span\n initial={false}\n animate={{\n opacity: panel.collapsed ? 0 : 1,\n x: panel.collapsed ? -4 : 0,\n }}\n transition={\n context.reduce\n ? REDUCED_TRANSITION\n : panel.collapsed\n ? LABEL_EXIT_TRANSITION\n : LABEL_ENTER_TRANSITION\n }\n aria-hidden={panel.collapsed}\n className={cn(\n \"relative z-10 min-w-0 flex-1 truncate\",\n panel.collapsed && \"pointer-events-none\",\n )}\n >\n {children}\n </motion.span>\n {badge && !panel.collapsed ? (\n <span className=\"relative z-10 shrink-0 text-muted-foreground text-xs\">{badge}</span>\n ) : null}\n {ariaExpanded !== undefined ? (\n <motion.span\n aria-hidden=\"true\"\n initial={false}\n animate={{\n opacity: panel.collapsed ? 0 : 1,\n rotate: ariaExpanded ? 90 : 0,\n x: panel.collapsed ? 4 : 0,\n }}\n transition={context.reduce ? { duration: 0 } : SPRING_LAYOUT}\n className=\"relative z-10 grid size-4 shrink-0 place-items-center text-muted-foreground\"\n >\n <ChevronRight className=\"size-3.5\" />\n </motion.span>\n ) : null}\n </>\n );\n\n const interactiveClassName = cn(\n \"relative flex min-h-9 w-full min-w-0 items-center gap-2.5 overflow-hidden rounded-xl px-3 text-left font-medium text-sm outline-none\",\n \"text-muted-foreground transition-colors hover:text-foreground\",\n \"focus-visible:bg-muted/70 focus-visible:ring-2 focus-visible:ring-ring\",\n isActive && \"text-foreground\",\n disabled && \"cursor-not-allowed opacity-40\",\n className,\n );\n\n return href ? (\n <motion.a\n href={href}\n target={target}\n rel={rel ?? (target === \"_blank\" ? \"noreferrer noopener\" : undefined)}\n aria-current={isActive ? \"page\" : undefined}\n aria-expanded={ariaExpanded}\n aria-disabled={disabled || undefined}\n aria-label={panel.collapsed ? textLabel : undefined}\n title={panel.collapsed ? textLabel : undefined}\n tabIndex={disabled ? -1 : undefined}\n onClick={select}\n whileTap={context.reduce || disabled ? undefined : { scale: 0.98 }}\n transition={SPRING_PRESS}\n className={interactiveClassName}\n >\n {content}\n </motion.a>\n ) : (\n <motion.button\n type=\"button\"\n disabled={disabled}\n aria-current={isActive ? \"page\" : undefined}\n aria-expanded={ariaExpanded}\n aria-label={panel.collapsed ? textLabel : undefined}\n title={panel.collapsed ? textLabel : undefined}\n onClick={select}\n whileTap={context.reduce || disabled ? undefined : { scale: 0.98 }}\n transition={SPRING_PRESS}\n className={interactiveClassName}\n >\n {content}\n </motion.button>\n );\n}\n"],"mappings":";;;;;;;;;;AAoCA,MAAM,eAAe;AACrB,MAAM,4BAA4B;AAElC,MAAM,mBAAmB;CACvB,UAAU;CACV,MAAM;AACR;AAKA,MAAM,2BAA2B;CAC/B,MAAM;CACN,WAAW;CACX,SAAS;CACT,MAAM;AACR;AAEA,MAAM,yBAAyB;CAC7B,UAAU;CACV,OAAO;CACP,MAAM;AACR;AAEA,MAAM,wBAAwB;CAC5B,UAAU;CACV,MAAM;AACR;AAEA,MAAM,qBAAqB;CACzB,UAAU;CACV,MAAM;AACR;AAEA,MAAM,mBAA6B;CACjC,QAAQ;EACN,SAAS;EACT,UAAU;EACV,YAAY;GACV,UAAU;GACV,MAAM;GACN,iBAAiB;GACjB,kBAAkB;EACpB;CACF;CACA,MAAM;EACJ,SAAS;EACT,UAAU;EACV,YAAY;GACV,UAAU;GACV,eAAe;GACf,MAAM;GACN,iBAAiB;EACnB;CACF;AACF;AAEA,MAAM,wBAAkC;CACtC,QAAQ;EACN,SAAS;EACT,GAAG;EACH,QAAQ;CACV;CACA,MAAM;EACJ,SAAS;EACT,GAAG;EACH,Q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QAAQ,SAAS,EAAE,UAAU,EAAE,IAAI;GAC/C,WAAU;GAEV,UAAA,oBAAC,cAAD,EAAc,WAAU,WAAY,CAAA;EACzB,CAAA,IACX;CACJ,EAAA,CAAA;CAGJ,MAAM,uBAAuB,GAC3B,wIACA,iEACA,0EACA,YAAY,mBACZ,YAAY,iCACZ,SACF;CAEA,OAAO,OACL,oBAAC,OAAO,GAAR;EACQ;EACE;EACR,KAAK,QAAQ,WAAW,WAAW,wBAAwB,KAAA;EAC3D,gBAAc,WAAW,SAAS,KAAA;EAClC,iBAAe;EACf,iBAAe,YAAY,KAAA;EAC3B,cAAY,MAAM,YAAY,YAAY,KAAA;EAC1C,OAAO,MAAM,YAAY,YAAY,KAAA;EACrC,UAAU,WAAW,KAAK,KAAA;EAC1B,SAAS;EACT,UAAU,QAAQ,UAAU,WAAW,KAAA,IAAY,EAAE,OAAO,IAAK;EACjE,YAAY;EACZ,WAAW;EAEV,UAAA;CACO,CAAA,IAEV,oBAAC,OAAO,QAAR;EACE,MAAK;EACK;EACV,gBAAc,WAAW,SAAS,KAAA;EAClC,iBAAe;EACf,cAAY,MAAM,YAAY,YAAY,KAAA;EAC1C,OAAO,MAAM,YAAY,YAAY,KAAA;EACrC,SAAS;EACT,UAAU,QAAQ,UAAU,WAAW,KAAA,IAAY,EAAE,OAAO,IAAK;EACjE,YAAY;EACZ,WAAW;EAEV,UAAA;CACY,CAAA;AAEnB"}
|
|
1
|
+
{"version":3,"file":"animated-sidebar.js","names":[],"sources":["../../../src/components/motion/animated-sidebar.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ButtonHTMLAttributes,\n type CSSProperties,\n createContext,\n forwardRef,\n type HTMLAttributes,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useId,\n useRef,\n useState,\n useSyncExternalStore,\n} from \"react\";\nimport { ChevronRight } from \"lucide-react\";\nimport {\n AnimatePresence,\n type HTMLMotionProps,\n motion,\n useReducedMotion,\n type Variants,\n} from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_DRAWER, EASE_OUT, SPRING_LAYOUT, SPRING_PRESS } from \"../../lib/ease\";\nimport { SharedLayoutBg } from \"./shared-layout-bg\";\n\ntype SidebarState = \"expanded\" | \"collapsed\";\ntype SidebarSide = \"left\" | \"right\";\ntype SidebarVariant = \"sidebar\" | \"floating\" | \"inset\";\ntype SidebarCollapsible = \"offcanvas\" | \"icon\" | \"none\";\n\nconst MOBILE_QUERY = \"(max-width: 767px)\";\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\";\n\nconst PANEL_TRANSITION = {\n duration: 0.36,\n ease: EASE_DRAWER,\n} as const;\n\n// The desktop rail settles at a hard zero-width boundary. Keep the spring\n// critically damped so it cannot overshoot, pause against that boundary, and\n// then snap back during the final frame.\nconst SIDEBAR_MORPH_TRANSITION = {\n type: \"spring\",\n stiffness: 380,\n damping: 35,\n mass: 0.75,\n} as const;\n\nconst LABEL_ENTER_TRANSITION = {\n duration: 0.2,\n delay: 0.08,\n ease: EASE_OUT,\n} as const;\n\nconst LABEL_EXIT_TRANSITION = {\n duration: 0.12,\n ease: EASE_OUT,\n} as const;\n\nconst SUBMENU_TRANSITION = {\n duration: 0.18,\n ease: EASE_OUT,\n} as const;\n\nconst SUBMENU_VARIANTS: Variants = {\n closed: {\n opacity: 0,\n clipPath: \"inset(0 0 100% 0 round 8px)\",\n transition: {\n duration: 0.14,\n ease: EASE_OUT,\n staggerChildren: 0.025,\n staggerDirection: -1,\n },\n },\n open: {\n opacity: 1,\n clipPath: \"inset(0 0 0% 0 round 8px)\",\n transition: {\n duration: 0.2,\n delayChildren: 0.035,\n ease: EASE_OUT,\n staggerChildren: 0.045,\n },\n },\n};\n\nconst SUBMENU_ITEM_VARIANTS: Variants = {\n closed: {\n opacity: 0,\n y: -6,\n filter: \"blur(3px)\",\n },\n open: {\n opacity: 1,\n y: 0,\n filter: \"blur(0px)\",\n transition: SUBMENU_TRANSITION,\n },\n};\n\nconst REDUCED_TRANSITION = {\n duration: 0.16,\n ease: EASE_OUT,\n} as const;\n\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 subscribeToMobileQuery(callback: () => void) {\n const query = window.matchMedia(MOBILE_QUERY);\n query.addEventListener(\"change\", callback);\n return () => query.removeEventListener(\"change\", callback);\n}\n\nfunction getMobileSnapshot() {\n return window.matchMedia(MOBILE_QUERY).matches;\n}\n\nfunction getServerMobileSnapshot() {\n return false;\n}\n\nfunction useIsMobile() {\n return useSyncExternalStore(subscribeToMobileQuery, getMobileSnapshot, getServerMobileSnapshot);\n}\n\ninterface AnimatedSidebarContextValue {\n isMobile: boolean;\n layoutId: string;\n open: boolean;\n openMobile: boolean;\n reduce: boolean;\n setOpen: (open: boolean) => void;\n setOpenMobile: (open: boolean) => void;\n state: SidebarState;\n toggleSidebar: () => void;\n triggerRef: React.RefObject<HTMLButtonElement | null>;\n}\n\nconst AnimatedSidebarContext = createContext<AnimatedSidebarContextValue | null>(null);\n\ninterface AnimatedSidebarPanelContextValue {\n collapsed: boolean;\n collapsible: SidebarCollapsible;\n side: SidebarSide;\n}\n\nconst AnimatedSidebarPanelContext = createContext<AnimatedSidebarPanelContextValue | null>(null);\n\nexport function useAnimatedSidebar() {\n const context = useContext(AnimatedSidebarContext);\n if (!context) {\n throw new Error(\"useAnimatedSidebar must be used inside AnimatedSidebarProvider.\");\n }\n return context;\n}\n\nfunction useAnimatedSidebarPanel() {\n const context = useContext(AnimatedSidebarPanelContext);\n if (!context) {\n throw new Error(\"Animated Sidebar parts must be used inside AnimatedSidebar.\");\n }\n return context;\n}\n\ntype SidebarProviderStyle = CSSProperties & {\n \"--sidebar-width\"?: string;\n \"--sidebar-width-icon\"?: string;\n \"--sidebar-width-mobile\"?: string;\n};\n\nexport interface AnimatedSidebarProviderProps extends HTMLAttributes<HTMLDivElement> {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n openMobile?: boolean;\n defaultOpenMobile?: boolean;\n onOpenMobileChange?: (open: boolean) => void;\n style?: SidebarProviderStyle;\n}\n\nexport function AnimatedSidebarProvider({\n children,\n open,\n defaultOpen = true,\n onOpenChange,\n openMobile,\n defaultOpenMobile = false,\n onOpenMobileChange,\n className,\n style,\n ...props\n}: AnimatedSidebarProviderProps) {\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const [internalOpenMobile, setInternalOpenMobile] = useState(defaultOpenMobile);\n const isMobile = useIsMobile();\n const reduce = useReducedMotion() ?? false;\n const generatedId = useId();\n const triggerRef = useRef<HTMLButtonElement>(null);\n const desktopOpen = open ?? internalOpen;\n const mobileOpen = openMobile ?? internalOpenMobile;\n\n const setOpen = useCallback(\n (nextOpen: boolean) => {\n if (open === undefined) setInternalOpen(nextOpen);\n onOpenChange?.(nextOpen);\n },\n [onOpenChange, open],\n );\n\n const setOpenMobile = useCallback(\n (nextOpen: boolean) => {\n if (openMobile === undefined) setInternalOpenMobile(nextOpen);\n onOpenMobileChange?.(nextOpen);\n },\n [onOpenMobileChange, openMobile],\n );\n\n const toggleSidebar = useCallback(() => {\n if (isMobile) setOpenMobile(!mobileOpen);\n else setOpen(!desktopOpen);\n }, [desktopOpen, isMobile, mobileOpen, setOpen, setOpenMobile]);\n\n useEffect(() => {\n const handleShortcut = (event: KeyboardEvent) => {\n if (\n event.key.toLowerCase() === SIDEBAR_KEYBOARD_SHORTCUT &&\n (event.metaKey || event.ctrlKey)\n ) {\n event.preventDefault();\n toggleSidebar();\n }\n };\n\n window.addEventListener(\"keydown\", handleShortcut);\n return () => window.removeEventListener(\"keydown\", handleShortcut);\n }, [toggleSidebar]);\n\n return (\n <AnimatedSidebarContext.Provider\n value={{\n isMobile,\n layoutId: `${generatedId}-active`,\n open: desktopOpen,\n openMobile: mobileOpen,\n reduce,\n setOpen,\n setOpenMobile,\n state: desktopOpen ? \"expanded\" : \"collapsed\",\n toggleSidebar,\n triggerRef,\n }}\n >\n <div\n {...props}\n data-slot=\"sidebar-wrapper\"\n data-state={desktopOpen ? \"expanded\" : \"collapsed\"}\n style={{\n \"--sidebar-width\": \"16rem\",\n \"--sidebar-width-icon\": \"4.25rem\",\n \"--sidebar-width-mobile\": \"18rem\",\n ...style,\n }}\n className={cn(\"group/sidebar-wrapper flex min-h-svh w-full min-w-0\", className)}\n >\n {children}\n </div>\n </AnimatedSidebarContext.Provider>\n );\n}\n\nfunction MobileSidebar({\n ariaLabel,\n children,\n className,\n side,\n}: {\n ariaLabel: string;\n children: ReactNode;\n className?: string;\n side: SidebarSide;\n}) {\n const context = useAnimatedSidebar();\n const panelRef = useRef<HTMLDivElement>(null);\n const [mounted, setMounted] = useState(false);\n // The sheet is mounted for as long as the viewport is mobile, so it hides\n // itself while closed rather than sitting there transparent and interactive.\n // Opening shows it in the same commit that starts the slide — a delayed show\n // would run the focus effect below against a still-hidden panel, and focus()\n // on a hidden element is ignored. Closing waits for the slide to finish, and\n // the panel's own exit tells us when that is: no duration to keep in sync.\n const [hidden, setHidden] = useState(!context.openMobile);\n // The completion callback fires for the open slide too, and it reads state\n // from whenever motion settles: a ref keeps it on the current one.\n const openMobileRef = useRef(context.openMobile);\n\n useEffect(() => setMounted(true), []);\n\n useEffect(() => {\n openMobileRef.current = context.openMobile;\n if (context.openMobile) setHidden(false);\n }, [context.openMobile]);\n\n useEffect(() => {\n if (!context.openMobile) return;\n\n const body = document.body;\n const scrollY = window.scrollY;\n const previousBodyStyles = {\n left: body.style.left,\n overflow: body.style.overflow,\n position: body.style.position,\n right: body.style.right,\n top: body.style.top,\n };\n\n body.style.position = \"fixed\";\n body.style.top = `-${scrollY}px`;\n body.style.left = \"0\";\n body.style.right = \"0\";\n body.style.overflow = \"hidden\";\n\n const focusFrame = requestAnimationFrame(() => {\n const firstFocusable = panelRef.current?.querySelector<HTMLElement>(FOCUSABLE_SELECTOR);\n (firstFocusable ?? panelRef.current)?.focus({ preventScroll: true });\n });\n\n return () => {\n cancelAnimationFrame(focusFrame);\n body.style.position = previousBodyStyles.position;\n body.style.top = previousBodyStyles.top;\n body.style.left = previousBodyStyles.left;\n body.style.right = previousBodyStyles.right;\n body.style.overflow = previousBodyStyles.overflow;\n window.scrollTo(0, scrollY);\n context.triggerRef.current?.focus({ preventScroll: true });\n };\n }, [context.openMobile, context.triggerRef]);\n\n if (!mounted) return null;\n\n // This container groups the sheet for hiding and the z-index and carries no\n // box: both children are `fixed` and resolve against the viewport themselves.\n // The scrim spans the viewport edges but paints a colour, and the panel is\n // inset off one side and paints its own surface, so no layer here is a\n // transparent edge-spanning one.\n return createPortal(\n <div\n className={cn(\n \"pointer-events-none fixed top-0 left-0 z-50 size-0 md:hidden\",\n hidden && !context.openMobile ? \"invisible\" : \"visible\",\n )}\n >\n <motion.button\n type=\"button\"\n aria-label=\"Close sidebar\"\n tabIndex={context.openMobile ? 0 : -1}\n initial={false}\n animate={{ opacity: context.openMobile ? 1 : 0 }}\n transition={context.reduce ? REDUCED_TRANSITION : PANEL_TRANSITION}\n onClick={() => context.setOpenMobile(false)}\n className={cn(\n \"fixed inset-0 bg-black/40\",\n context.openMobile ? \"pointer-events-auto\" : \"pointer-events-none\",\n )}\n />\n\n <motion.div\n ref={panelRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={ariaLabel}\n aria-hidden={!context.openMobile}\n inert={!context.openMobile}\n tabIndex={-1}\n data-mobile=\"true\"\n data-state={context.openMobile ? \"expanded\" : \"collapsed\"}\n data-side={side}\n initial={false}\n animate={{\n opacity: context.reduce ? (context.openMobile ? 1 : 0) : 1,\n x: context.reduce ? 0 : context.openMobile ? \"0%\" : side === \"left\" ? \"-100%\" : \"100%\",\n }}\n transition={context.reduce ? REDUCED_TRANSITION : PANEL_TRANSITION}\n onAnimationComplete={() => {\n if (!openMobileRef.current) setHidden(true);\n }}\n onKeyDown={(event) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n context.setOpenMobile(false);\n return;\n }\n\n if (event.key !== \"Tab\") return;\n const focusable = panelRef.current\n ? Array.from(panelRef.current.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR))\n : [];\n\n if (focusable.length === 0) {\n event.preventDefault();\n panelRef.current?.focus();\n return;\n }\n\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\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 className={cn(\n \"pointer-events-auto fixed inset-y-0 flex h-dvh w-(--sidebar-width-mobile) max-w-[88vw] flex-col overflow-hidden\",\n \"border-border bg-background shadow-2xl will-change-transform\",\n side === \"left\" ? \"left-0 border-r\" : \"right-0 border-l\",\n !context.openMobile && \"pointer-events-none\",\n className,\n )}\n >\n <AnimatedSidebarPanelContext.Provider\n value={{ collapsed: false, collapsible: \"none\", side }}\n >\n {children}\n </AnimatedSidebarPanelContext.Provider>\n </motion.div>\n </div>,\n document.body,\n );\n}\n\nexport interface AnimatedSidebarProps extends Omit<HTMLMotionProps<\"aside\">, \"children\"> {\n children?: ReactNode;\n side?: SidebarSide;\n variant?: SidebarVariant;\n collapsible?: SidebarCollapsible;\n ariaLabel?: string;\n panelClassName?: string;\n}\n\nexport const AnimatedSidebar = forwardRef<HTMLElement, AnimatedSidebarProps>(\n function AnimatedSidebar(\n {\n side = \"left\",\n variant = \"sidebar\",\n collapsible = \"icon\",\n ariaLabel = \"Sidebar\",\n children,\n className,\n panelClassName,\n style,\n ...props\n },\n forwardedRef,\n ) {\n const context = useAnimatedSidebar();\n const collapsed = collapsible !== \"none\" && !context.open;\n const offcanvas = collapsed && collapsible === \"offcanvas\";\n const width = offcanvas\n ? \"0px\"\n : collapsed\n ? \"var(--sidebar-width-icon)\"\n : \"var(--sidebar-width)\";\n\n if (context.isMobile) {\n return (\n <MobileSidebar ariaLabel={ariaLabel} className={className} side={side}>\n {children}\n </MobileSidebar>\n );\n }\n\n return (\n <motion.aside\n {...props}\n ref={forwardedRef}\n initial={false}\n aria-label={ariaLabel}\n data-slot=\"sidebar\"\n data-state={collapsed ? \"collapsed\" : \"expanded\"}\n data-collapsible={collapsible}\n data-variant={variant}\n data-side={side}\n animate={{ width }}\n transition={context.reduce ? { duration: 0 } : SIDEBAR_MORPH_TRANSITION}\n style={style}\n className={cn(\n \"group/sidebar relative hidden h-auto shrink-0 will-change-[width] md:block\",\n \"peer\",\n side === \"right\" && \"order-last\",\n className,\n )}\n >\n <motion.div\n initial={false}\n animate={{\n opacity: offcanvas ? 0 : 1,\n x: offcanvas ? (side === \"left\" ? \"-100%\" : \"100%\") : \"0%\",\n }}\n transition={context.reduce ? REDUCED_TRANSITION : PANEL_TRANSITION}\n className={cn(\n \"sticky top-0 flex h-svh w-full flex-col overflow-hidden bg-background\",\n collapsible === \"offcanvas\" && \"w-(--sidebar-width)\",\n variant === \"sidebar\" &&\n (side === \"left\" ? \"border-border border-r\" : \"border-border border-l\"),\n variant === \"floating\" &&\n \"m-2 h-[calc(100svh-1rem)] rounded-2xl border border-border shadow-sm\",\n variant === \"inset\" && \"m-2 h-[calc(100svh-1rem)] rounded-2xl\",\n panelClassName,\n )}\n >\n <AnimatedSidebarPanelContext.Provider value={{ collapsed, collapsible, side }}>\n {children}\n </AnimatedSidebarPanelContext.Provider>\n </motion.div>\n </motion.aside>\n );\n },\n);\n\nexport interface AnimatedSidebarTriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {}\n\nexport const AnimatedSidebarTrigger = forwardRef<HTMLButtonElement, AnimatedSidebarTriggerProps>(\n function AnimatedSidebarTrigger({ className, onClick, type = \"button\", ...props }, forwardedRef) {\n const context = useAnimatedSidebar();\n const expanded = context.isMobile ? context.openMobile : context.open;\n\n return (\n <button\n {...props}\n ref={(node) => {\n context.triggerRef.current = node;\n if (typeof forwardedRef === \"function\") forwardedRef(node);\n else if (forwardedRef) forwardedRef.current = node;\n }}\n type={type}\n aria-label={props[\"aria-label\"] ?? \"Toggle sidebar\"}\n aria-expanded={expanded}\n data-slot=\"sidebar-trigger\"\n data-state={expanded ? \"expanded\" : \"collapsed\"}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) context.toggleSidebar();\n }}\n className={cn(\n \"inline-flex size-10 shrink-0 items-center justify-center rounded-xl outline-none\",\n \"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n className,\n )}\n />\n );\n },\n);\n\nexport interface AnimatedSidebarCloseProps extends ButtonHTMLAttributes<HTMLButtonElement> {}\n\nexport const AnimatedSidebarClose = forwardRef<HTMLButtonElement, AnimatedSidebarCloseProps>(\n function AnimatedSidebarClose({ className, onClick, type = \"button\", ...props }, forwardedRef) {\n const context = useAnimatedSidebar();\n\n return (\n <button\n {...props}\n ref={forwardedRef}\n type={type}\n aria-label={props[\"aria-label\"] ?? \"Close sidebar\"}\n onClick={(event) => {\n onClick?.(event);\n if (event.defaultPrevented) return;\n if (context.isMobile) context.setOpenMobile(false);\n else context.setOpen(false);\n }}\n className={cn(\n \"inline-flex size-10 shrink-0 items-center justify-center rounded-xl outline-none\",\n \"focus-visible:ring-2 focus-visible:ring-ring\",\n className,\n )}\n />\n );\n },\n);\n\nexport interface AnimatedSidebarRailProps extends ButtonHTMLAttributes<HTMLButtonElement> {}\n\nexport const AnimatedSidebarRail = forwardRef<HTMLButtonElement, AnimatedSidebarRailProps>(\n function AnimatedSidebarRail({ className, onClick, type = \"button\", ...props }, forwardedRef) {\n const context = useAnimatedSidebar();\n const panel = useAnimatedSidebarPanel();\n\n return (\n <button\n {...props}\n ref={forwardedRef}\n type={type}\n data-side={panel.side}\n aria-label={props[\"aria-label\"] ?? \"Toggle sidebar\"}\n title=\"Toggle sidebar\"\n tabIndex={-1}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) context.toggleSidebar();\n }}\n className={cn(\n \"absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 outline-none md:block\",\n \"after:absolute after:inset-y-0 after:left-1/2 after:w-px after:bg-transparent after:transition-colors hover:after:bg-border\",\n \"data-[side=right]:right-0 data-[side=left]:left-full data-[side=right]:translate-x-1/2\",\n className,\n )}\n />\n );\n },\n);\n\nexport interface AnimatedSidebarInsetProps extends HTMLMotionProps<\"main\"> {}\n\nexport const AnimatedSidebarInset = forwardRef<HTMLElement, AnimatedSidebarInsetProps>(\n function AnimatedSidebarInset({ className, ...props }, forwardedRef) {\n return (\n <motion.main\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-inset\"\n className={cn(\n \"relative flex min-h-svh min-w-0 flex-1 flex-col bg-background\",\n \"md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-2xl md:peer-data-[variant=inset]:shadow-sm\",\n className,\n )}\n />\n );\n },\n);\n\nexport const AnimatedSidebarHeader = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function AnimatedSidebarHeader({ className, ...props }, forwardedRef) {\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-header\"\n className={cn(\"flex shrink-0 flex-col gap-2 p-3\", className)}\n />\n );\n },\n);\n\nexport const AnimatedSidebarContent = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function AnimatedSidebarContent({ className, ...props }, forwardedRef) {\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-content\"\n className={cn(\n \"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overflow-x-hidden overscroll-contain px-2 py-2\",\n className,\n )}\n />\n );\n },\n);\n\nexport const AnimatedSidebarFooter = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function AnimatedSidebarFooter({ className, ...props }, forwardedRef) {\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-footer\"\n className={cn(\n \"flex shrink-0 flex-col gap-2 border-border border-t p-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]\",\n className,\n )}\n />\n );\n },\n);\n\nexport const AnimatedSidebarGroup = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function AnimatedSidebarGroup({ className, ...props }, forwardedRef) {\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-group\"\n className={cn(\"flex w-full min-w-0 flex-col px-1 py-1.5\", className)}\n />\n );\n },\n);\n\nexport const AnimatedSidebarGroupLabel = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function AnimatedSidebarGroupLabel({ children, className, ...props }, forwardedRef) {\n const { collapsed } = useAnimatedSidebarPanel();\n\n return (\n <div\n {...props}\n ref={forwardedRef}\n aria-hidden={collapsed}\n data-slot=\"sidebar-group-label\"\n className={cn(\n \"mb-1 h-7 overflow-hidden px-2 font-medium text-[10px] text-muted-foreground uppercase tracking-[0.14em] transition-opacity\",\n collapsed ? \"opacity-0\" : \"opacity-100\",\n className,\n )}\n >\n {children}\n </div>\n );\n },\n);\n\nexport const AnimatedSidebarGroupContent = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement>\n>(function AnimatedSidebarGroupContent({ className, ...props }, forwardedRef) {\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-group-content\"\n className={cn(\"w-full min-w-0\", className)}\n />\n );\n});\n\nexport const AnimatedSidebarMenu = forwardRef<HTMLUListElement, HTMLAttributes<HTMLUListElement>>(\n function AnimatedSidebarMenu({ children, className, ...props }, forwardedRef) {\n return (\n <SharedLayoutBg\n {...props}\n ref={forwardedRef as React.Ref<HTMLElement>}\n as=\"ul\"\n inset={0}\n pillClassName=\"rounded-xl bg-muted/70\"\n pillContainerClassName=\"inset-y-auto top-0 h-9\"\n data-slot=\"sidebar-menu\"\n className={cn(\"flex w-full min-w-0 list-none flex-col gap-0.5\", className)}\n >\n {children}\n </SharedLayoutBg>\n );\n },\n);\n\nexport const AnimatedSidebarMenuItem = forwardRef<HTMLLIElement, HTMLMotionProps<\"li\">>(\n function AnimatedSidebarMenuItem({ className, ...props }, forwardedRef) {\n return (\n <motion.li\n {...props}\n ref={forwardedRef}\n layout=\"position\"\n transition={SPRING_LAYOUT}\n data-slot=\"sidebar-menu-item\"\n className={cn(\"relative\", className)}\n />\n );\n },\n);\n\nexport interface AnimatedSidebarMenuSubProps extends Omit<HTMLMotionProps<\"ul\">, \"children\"> {\n open: boolean;\n children?: ReactNode;\n}\n\nexport const AnimatedSidebarMenuSub = forwardRef<HTMLUListElement, AnimatedSidebarMenuSubProps>(\n function AnimatedSidebarMenuSub({ open, children, className, ...props }, forwardedRef) {\n const context = useAnimatedSidebar();\n const panel = useAnimatedSidebarPanel();\n\n return (\n <AnimatePresence initial={false} mode=\"popLayout\">\n {open && !panel.collapsed ? (\n <motion.ul\n {...props}\n ref={forwardedRef}\n key=\"sidebar-submenu\"\n variants={context.reduce ? undefined : SUBMENU_VARIANTS}\n initial={context.reduce ? false : \"closed\"}\n animate={context.reduce ? { opacity: 1 } : \"open\"}\n exit={context.reduce ? { opacity: 0 } : \"closed\"}\n transition={context.reduce ? { duration: 0.12 } : undefined}\n data-slot=\"sidebar-menu-sub\"\n className={cn(\n \"relative mt-1 ml-5 flex min-w-0 flex-col gap-0.5 border-border border-l pl-3\",\n className,\n )}\n >\n {children}\n </motion.ul>\n ) : null}\n </AnimatePresence>\n );\n },\n);\n\nexport const AnimatedSidebarMenuSubItem = forwardRef<HTMLLIElement, HTMLMotionProps<\"li\">>(\n function AnimatedSidebarMenuSubItem({ className, ...props }, forwardedRef) {\n return (\n <motion.li\n {...props}\n ref={forwardedRef}\n variants={SUBMENU_ITEM_VARIANTS}\n data-slot=\"sidebar-menu-sub-item\"\n className={cn(\"relative min-w-0\", className)}\n />\n );\n },\n);\n\nexport interface AnimatedSidebarMenuSubButtonProps {\n children: ReactNode;\n icon?: ReactNode;\n href?: string;\n isActive?: boolean;\n disabled?: boolean;\n closeOnSelect?: boolean;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\";\n rel?: string;\n onSelect?: () => void;\n className?: string;\n}\n\nexport function AnimatedSidebarMenuSubButton({\n children,\n icon,\n href,\n isActive = false,\n disabled = false,\n closeOnSelect = true,\n target,\n rel,\n onSelect,\n className,\n}: AnimatedSidebarMenuSubButtonProps) {\n const context = useAnimatedSidebar();\n\n const select = (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n onSelect?.();\n if (context.isMobile && closeOnSelect) context.setOpenMobile(false);\n };\n\n const content = (\n <>\n <span aria-hidden=\"true\" className=\"grid size-4 shrink-0 place-items-center\">\n {icon ?? <span className=\"size-1 rounded-full bg-current\" />}\n </span>\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n </>\n );\n\n const interactiveClassName = cn(\n \"flex min-h-8 w-full min-w-0 items-center gap-2 rounded-lg px-2 text-left text-xs outline-none\",\n \"text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground\",\n \"focus-visible:bg-muted/70 focus-visible:ring-2 focus-visible:ring-ring\",\n isActive && \"bg-muted/70 text-foreground\",\n disabled && \"cursor-not-allowed opacity-40\",\n className,\n );\n\n return href ? (\n <motion.a\n href={href}\n target={target}\n rel={rel ?? (target === \"_blank\" ? \"noreferrer noopener\" : undefined)}\n aria-current={isActive ? \"page\" : undefined}\n aria-disabled={disabled || undefined}\n tabIndex={disabled ? -1 : undefined}\n onClick={select}\n whileTap={context.reduce || disabled ? undefined : { scale: 0.98 }}\n transition={SPRING_PRESS}\n className={interactiveClassName}\n >\n {content}\n </motion.a>\n ) : (\n <motion.button\n type=\"button\"\n disabled={disabled}\n aria-current={isActive ? \"page\" : undefined}\n onClick={select}\n whileTap={context.reduce || disabled ? undefined : { scale: 0.98 }}\n transition={SPRING_PRESS}\n className={interactiveClassName}\n >\n {content}\n </motion.button>\n );\n}\n\nexport interface AnimatedSidebarMenuButtonProps {\n children: ReactNode;\n icon?: ReactNode;\n badge?: ReactNode;\n href?: string;\n isActive?: boolean;\n ariaExpanded?: boolean;\n disabled?: boolean;\n closeOnSelect?: boolean;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\";\n rel?: string;\n onSelect?: () => void;\n className?: string;\n}\n\nexport function AnimatedSidebarMenuButton({\n children,\n icon,\n badge,\n href,\n isActive = false,\n ariaExpanded,\n disabled = false,\n closeOnSelect,\n target,\n rel,\n onSelect,\n className,\n}: AnimatedSidebarMenuButtonProps) {\n const context = useAnimatedSidebar();\n const panel = useAnimatedSidebarPanel();\n const textLabel = typeof children === \"string\" ? children : undefined;\n\n const select = (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n onSelect?.();\n const shouldCloseOnSelect = closeOnSelect ?? ariaExpanded === undefined;\n if (context.isMobile && shouldCloseOnSelect) {\n context.setOpenMobile(false);\n }\n // A submenu cannot render in the icon rail, so opening one from there\n // leaves its children unreachable — a pointer can still fall back to the\n // rail or the shortcut, a finger has nothing. Selecting a group unfolds\n // the panel that is about to hold it.\n if (ariaExpanded !== undefined && panel.collapsed && !context.isMobile) {\n context.setOpen(true);\n }\n };\n\n const content = (\n <>\n {isActive ? (\n <motion.span\n layoutId={context.layoutId}\n transition={context.reduce ? { duration: 0 } : SPRING_LAYOUT}\n className=\"absolute inset-0 rounded-xl bg-muted\"\n />\n ) : null}\n {icon ? (\n <span aria-hidden=\"true\" className=\"relative z-10 grid size-5 shrink-0 place-items-center\">\n {icon}\n </span>\n ) : null}\n <motion.span\n initial={false}\n animate={{\n opacity: panel.collapsed ? 0 : 1,\n x: panel.collapsed ? -4 : 0,\n }}\n transition={\n context.reduce\n ? REDUCED_TRANSITION\n : panel.collapsed\n ? LABEL_EXIT_TRANSITION\n : LABEL_ENTER_TRANSITION\n }\n aria-hidden={panel.collapsed}\n className={cn(\n \"relative z-10 min-w-0 flex-1 truncate\",\n panel.collapsed && \"pointer-events-none\",\n )}\n >\n {children}\n </motion.span>\n {badge && !panel.collapsed ? (\n <span className=\"relative z-10 shrink-0 text-muted-foreground text-xs\">{badge}</span>\n ) : null}\n {ariaExpanded !== undefined ? (\n <motion.span\n aria-hidden=\"true\"\n initial={false}\n animate={{\n opacity: panel.collapsed ? 0 : 1,\n rotate: ariaExpanded ? 90 : 0,\n x: panel.collapsed ? 4 : 0,\n }}\n transition={context.reduce ? { duration: 0 } : SPRING_LAYOUT}\n className=\"relative z-10 grid size-4 shrink-0 place-items-center text-muted-foreground\"\n >\n <ChevronRight className=\"size-3.5\" />\n </motion.span>\n ) : null}\n </>\n );\n\n const interactiveClassName = cn(\n \"relative flex min-h-9 w-full min-w-0 items-center gap-2.5 overflow-hidden rounded-xl px-3 text-left font-medium text-sm outline-none\",\n \"text-muted-foreground transition-colors hover:text-foreground\",\n \"focus-visible:bg-muted/70 focus-visible:ring-2 focus-visible:ring-ring\",\n isActive && \"text-foreground\",\n disabled && \"cursor-not-allowed opacity-40\",\n className,\n );\n\n return href ? (\n <motion.a\n href={href}\n target={target}\n rel={rel ?? (target === \"_blank\" ? \"noreferrer noopener\" : undefined)}\n aria-current={isActive ? \"page\" : undefined}\n aria-expanded={ariaExpanded}\n aria-disabled={disabled || undefined}\n aria-label={panel.collapsed ? textLabel : undefined}\n title={panel.collapsed ? textLabel : undefined}\n tabIndex={disabled ? -1 : undefined}\n onClick={select}\n whileTap={context.reduce || disabled ? undefined : { scale: 0.98 }}\n transition={SPRING_PRESS}\n className={interactiveClassName}\n >\n {content}\n </motion.a>\n ) : (\n <motion.button\n type=\"button\"\n disabled={disabled}\n aria-current={isActive ? \"page\" : undefined}\n aria-expanded={ariaExpanded}\n aria-label={panel.collapsed ? textLabel : undefined}\n title={panel.collapsed ? textLabel : undefined}\n onClick={select}\n whileTap={context.reduce || disabled ? undefined : { scale: 0.98 }}\n transition={SPRING_PRESS}\n className={interactiveClassName}\n >\n {content}\n </motion.button>\n );\n}\n"],"mappings":";;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Y;EACZ,WAAW;EAEV,UAAA;CACO,CAAA,IAEV,oBAAC,OAAO,QAAR;EACE,MAAK;EACK;EACV,gBAAc,WAAW,SAAS,KAAA;EAClC,iBAAe;EACf,cAAY,MAAM,YAAY,YAAY,KAAA;EAC1C,OAAO,MAAM,YAAY,YAAY,KAAA;EACrC,SAAS;EACT,UAAU,QAAQ,UAAU,WAAW,KAAA,IAAY,EAAE,OAAO,IAAK;EACjE,YAAY;EACZ,WAAW;EAEV,UAAA;CACY,CAAA;AAEnB"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { EASE_OUT } from "../../lib/ease.js";
|
|
3
3
|
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { cn } from "@kumix/utils";
|
|
5
|
-
import { AlertCircle, Bell, Check, Info, LoaderCircle, X } from "lucide-react";
|
|
6
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
6
|
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
7
|
+
import { AlertCircle, Bell, Check, Info, LoaderCircle, X } from "lucide-react";
|
|
8
8
|
import { createPortal } from "react-dom";
|
|
9
9
|
//#region src/components/motion/animated-toast-stack.tsx
|
|
10
10
|
const STACK_SPRING = {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
//#region src/components/motion/arc-picker.d.ts
|
|
3
|
+
export type ArcPickerOption = {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type ArcPickerSide = "top" | "bottom" | "left" | "right";
|
|
9
|
+
export type ArcPickerProps = Omit<ComponentProps<"div">, "children" | "defaultValue" | "onChange"> & {
|
|
10
|
+
options: readonly ArcPickerOption[];
|
|
11
|
+
value?: string;
|
|
12
|
+
defaultValue?: string;
|
|
13
|
+
/** Called for each enabled choice crossed during scrolling, dragging and momentum. */
|
|
14
|
+
onValueChange?: (value: string) => void;
|
|
15
|
+
/** The side the arc bows toward. Top and bottom scroll horizontally. */
|
|
16
|
+
side?: ArcPickerSide;
|
|
17
|
+
/** Radius in pixels. Larger radii make a gentler curve. */
|
|
18
|
+
radius?: number;
|
|
19
|
+
/** Minimum spacing along the arc. Horizontal sides also make room for label widths. */
|
|
20
|
+
itemHeight?: number;
|
|
21
|
+
visibleCount?: number;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
name?: string;
|
|
24
|
+
};
|
|
25
|
+
/** A radial single-choice picker with drag momentum and native button controls. */
|
|
26
|
+
export declare function ArcPicker({ options, value, defaultValue, onValueChange, side, radius, itemHeight, visibleCount, disabled, name, className, style, onKeyDown, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, onLostPointerCapture, onFocusCapture, onBlurCapture, onClickCapture, "aria-label": label, "aria-describedby": describedBy, ...props }: ArcPickerProps): import("react").JSX.Element;
|
|
27
|
+
//#endregion
|
|
28
|
+
//# sourceMappingURL=arc-picker.d.ts.map
|