@kumix/ui 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -45
- package/dist/{cascader-types-DVT-znZ-.d.ts → cascader-types-zhnUQ4sP.d.ts} +11 -3
- package/dist/cascader-types-zhnUQ4sP.d.ts.map +1 -0
- package/dist/components/agents/agent-code.js +1 -1
- package/dist/components/agents/approval-card/index.d.ts +2 -0
- package/dist/components/agents/approval-card/index.d.ts.map +1 -1
- package/dist/components/agents/approval-card/index.js +2 -0
- package/dist/components/agents/approval-card/index.js.map +1 -1
- package/dist/components/agents/citations.d.ts +14 -2
- package/dist/components/agents/citations.d.ts.map +1 -1
- package/dist/components/agents/citations.js +11 -7
- package/dist/components/agents/citations.js.map +1 -1
- package/dist/components/agents/loading-states/reasoning-text.d.ts.map +1 -1
- package/dist/components/agents/loading-states/reasoning-text.js +3 -0
- package/dist/components/agents/loading-states/reasoning-text.js.map +1 -1
- package/dist/components/charts/bump-chart/context.js +1 -2
- package/dist/components/charts/bump-chart/plot.js +1 -2
- package/dist/components/charts/bump-chart/point.js +1 -1
- package/dist/components/charts/bump-chart/series.d.ts +1 -0
- package/dist/components/charts/candlestick-chart/context.d.ts +79 -0
- package/dist/components/charts/candlestick-chart/context.d.ts.map +1 -0
- package/dist/components/charts/candlestick-chart/context.js +69 -0
- package/dist/components/charts/candlestick-chart/context.js.map +1 -0
- package/dist/components/charts/candlestick-chart/legend.d.ts +12 -0
- package/dist/components/charts/candlestick-chart/legend.d.ts.map +1 -0
- package/dist/components/charts/candlestick-chart/legend.js +56 -0
- package/dist/components/charts/candlestick-chart/legend.js.map +1 -0
- package/dist/components/charts/candlestick-chart/plot.d.ts +9 -0
- package/dist/components/charts/candlestick-chart/plot.d.ts.map +1 -0
- package/dist/components/charts/candlestick-chart/plot.js +218 -0
- package/dist/components/charts/candlestick-chart/plot.js.map +1 -0
- package/dist/components/charts/candlestick-chart.d.ts +18 -0
- package/dist/components/charts/candlestick-chart.d.ts.map +1 -0
- package/dist/components/charts/candlestick-chart.js +34 -0
- package/dist/components/charts/candlestick-chart.js.map +1 -0
- package/dist/components/charts/composition-chart/context.js +1 -2
- package/dist/components/charts/composition-chart/plot.js +1 -1
- package/dist/components/charts/donut-chart/center.d.ts +16 -0
- package/dist/components/charts/donut-chart/center.d.ts.map +1 -0
- package/dist/components/charts/donut-chart/center.js +78 -0
- package/dist/components/charts/donut-chart/center.js.map +1 -0
- package/dist/components/charts/donut-chart/context.d.ts +68 -0
- package/dist/components/charts/donut-chart/context.d.ts.map +1 -0
- package/dist/components/charts/donut-chart/context.js +2 -0
- package/dist/components/charts/donut-chart/legend.d.ts +17 -0
- package/dist/components/charts/donut-chart/legend.d.ts.map +1 -0
- package/dist/components/charts/donut-chart/legend.js +85 -0
- package/dist/components/charts/donut-chart/legend.js.map +1 -0
- package/dist/components/charts/donut-chart/plot.d.ts +10 -0
- package/dist/components/charts/donut-chart/plot.d.ts.map +1 -0
- package/dist/components/charts/donut-chart/plot.js +108 -0
- package/dist/components/charts/donut-chart/plot.js.map +1 -0
- package/dist/components/charts/donut-chart.d.ts +22 -0
- package/dist/components/charts/donut-chart.d.ts.map +1 -0
- package/dist/components/charts/donut-chart.js +37 -0
- package/dist/components/charts/donut-chart.js.map +1 -0
- package/dist/components/charts/funnel-chart.d.ts.map +1 -1
- package/dist/components/charts/funnel-chart.js +1 -2
- package/dist/components/charts/funnel-chart.js.map +1 -1
- package/dist/components/charts/heat-calendar/tooltip.js +1 -1
- package/dist/components/charts/liquidity-heatmap.d.ts.map +1 -1
- package/dist/components/charts/liquidity-heatmap.js +1 -1
- package/dist/components/charts/order-book/depth-row.d.ts +8 -2
- package/dist/components/charts/order-book/depth-row.d.ts.map +1 -1
- package/dist/components/charts/order-book/depth-row.js +11 -3
- package/dist/components/charts/order-book/depth-row.js.map +1 -1
- package/dist/components/charts/order-book.d.ts +33 -1
- package/dist/components/charts/order-book.d.ts.map +1 -1
- package/dist/components/charts/order-book.js +92 -17
- package/dist/components/charts/order-book.js.map +1 -1
- package/dist/components/charts/price-target-fan/tooltip.js +1 -1
- package/dist/components/charts/returns-calendar/tooltip.js +1 -1
- package/dist/components/charts/status-bar/tooltip.js +1 -1
- package/dist/components/charts/treemap/tooltip.js +1 -1
- package/dist/components/charts/treemap.d.ts.map +1 -1
- package/dist/components/charts/volume-profile/tooltip.js +1 -1
- package/dist/components/charts/volume-profile.d.ts.map +1 -1
- package/dist/components/custom/confirm-dialog.d.ts +1 -0
- package/dist/components/custom/toast.d.ts +1 -0
- package/dist/components/motion/action-swap.d.ts +1 -1
- package/dist/components/motion/action-swap.d.ts.map +1 -1
- package/dist/components/motion/action-swap.js +46 -20
- package/dist/components/motion/action-swap.js.map +1 -1
- package/dist/components/motion/animated-badge.d.ts +1 -1
- package/dist/components/motion/animated-badge.d.ts.map +1 -1
- package/dist/components/motion/animated-badge.js +60 -101
- package/dist/components/motion/animated-badge.js.map +1 -1
- package/dist/components/motion/animated-sidebar.d.ts +1 -0
- package/dist/components/motion/animated-sidebar.js +1 -1
- package/dist/components/motion/animated-toast-stack.js +1 -1
- package/dist/components/motion/attachment-upload.d.ts.map +1 -1
- package/dist/components/motion/attachment-upload.js +2 -3
- package/dist/components/motion/attachment-upload.js.map +1 -1
- package/dist/components/motion/availability-scheduler/copy-menu.js +1 -2
- 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.d.ts +1 -0
- package/dist/components/motion/bloom-menu.d.ts.map +1 -1
- package/dist/components/motion/bloom-menu.js +73 -8
- package/dist/components/motion/bloom-menu.js.map +1 -1
- package/dist/components/motion/bottom-sheet.d.ts.map +1 -1
- package/dist/components/motion/bottom-sheet.js +6 -10
- package/dist/components/motion/bottom-sheet.js.map +1 -1
- package/dist/components/motion/bounce-sidebar.d.ts.map +1 -1
- package/dist/components/motion/bounce-sidebar.js +34 -42
- package/dist/components/motion/bounce-sidebar.js.map +1 -1
- package/dist/components/motion/bouncy-accordion.d.ts.map +1 -1
- package/dist/components/motion/bouncy-accordion.js +35 -22
- package/dist/components/motion/bouncy-accordion.js.map +1 -1
- package/dist/components/motion/button/stateful.d.ts.map +1 -1
- package/dist/components/motion/button/stateful.js +3 -0
- package/dist/components/motion/button/stateful.js.map +1 -1
- package/dist/components/motion/card.d.ts +44 -0
- package/dist/components/motion/card.d.ts.map +1 -0
- package/dist/components/motion/card.js +122 -0
- package/dist/components/motion/card.js.map +1 -0
- package/dist/components/motion/center-morph-modal.js +1 -1
- package/dist/components/motion/checkbox.d.ts +3 -1
- package/dist/components/motion/checkbox.d.ts.map +1 -1
- package/dist/components/motion/checkbox.js +18 -6
- package/dist/components/motion/checkbox.js.map +1 -1
- package/dist/components/motion/color-picker.d.ts +110 -0
- package/dist/components/motion/color-picker.d.ts.map +1 -0
- package/dist/components/motion/color-picker.js +1053 -0
- package/dist/components/motion/color-picker.js.map +1 -0
- package/dist/components/motion/color-selector.d.ts.map +1 -1
- package/dist/components/motion/color-selector.js +9 -2
- package/dist/components/motion/color-selector.js.map +1 -1
- package/dist/components/motion/combobox/content.d.ts +1 -0
- package/dist/components/motion/command-palette.js +3 -3
- package/dist/components/motion/command-palette.js.map +1 -1
- package/dist/components/motion/context-menu.d.ts +1 -0
- package/dist/components/motion/context-menu.js +1 -1
- package/dist/components/motion/date-range-picker.d.ts.map +1 -1
- package/dist/components/motion/digit-swap.d.ts +9 -1
- package/dist/components/motion/digit-swap.d.ts.map +1 -1
- package/dist/components/motion/digit-swap.js +18 -7
- package/dist/components/motion/digit-swap.js.map +1 -1
- package/dist/components/motion/drawer.d.ts +1 -1
- package/dist/components/motion/drawer.d.ts.map +1 -1
- package/dist/components/motion/drawer.js +10 -10
- package/dist/components/motion/drawer.js.map +1 -1
- package/dist/components/motion/expandable-action-bar.d.ts.map +1 -1
- package/dist/components/motion/expandable-control.d.ts +1 -0
- package/dist/components/motion/feedback-widget.js +4 -1
- package/dist/components/motion/feedback-widget.js.map +1 -1
- package/dist/components/motion/knockout-wheel.d.ts.map +1 -1
- package/dist/components/motion/knockout-wheel.js +1 -2
- package/dist/components/motion/knockout-wheel.js.map +1 -1
- package/dist/components/motion/morphing-lightbox.d.ts.map +1 -1
- package/dist/components/motion/morphing-lightbox.js +1 -1
- package/dist/components/motion/morphing-modal.d.ts +6 -1
- package/dist/components/motion/morphing-modal.d.ts.map +1 -1
- package/dist/components/motion/morphing-modal.js +37 -5
- package/dist/components/motion/morphing-modal.js.map +1 -1
- package/dist/components/motion/morphing-search-chips.d.ts +54 -0
- package/dist/components/motion/morphing-search-chips.d.ts.map +1 -0
- package/dist/components/motion/morphing-search-chips.js +599 -0
- package/dist/components/motion/morphing-search-chips.js.map +1 -0
- package/dist/components/motion/morphing-search.js +1 -1
- package/dist/components/motion/morphing-tabs.js +1 -1
- package/dist/components/motion/multi-select/content.d.ts +1 -0
- package/dist/components/motion/not-found/shared.d.ts +1 -0
- package/dist/components/motion/number-ticker.d.ts +6 -1
- package/dist/components/motion/number-ticker.d.ts.map +1 -1
- package/dist/components/motion/number-ticker.js +19 -9
- package/dist/components/motion/number-ticker.js.map +1 -1
- package/dist/components/motion/otp-input.js +19 -11
- package/dist/components/motion/otp-input.js.map +1 -1
- package/dist/components/motion/parallax.js.map +1 -1
- package/dist/components/motion/popover-morph.d.ts +5 -3
- package/dist/components/motion/popover-morph.d.ts.map +1 -1
- package/dist/components/motion/popover-morph.js +47 -52
- package/dist/components/motion/popover-morph.js.map +1 -1
- package/dist/components/motion/popover.d.ts +1 -0
- package/dist/components/motion/popover.js +7 -1
- package/dist/components/motion/popover.js.map +1 -1
- package/dist/components/motion/prediction-market-card.js +2 -3
- package/dist/components/motion/prediction-market-card.js.map +1 -1
- package/dist/components/motion/prediction-market.js +1 -1
- package/dist/components/motion/project-folder.js +1 -1
- package/dist/components/motion/radio.d.ts +8 -2
- package/dist/components/motion/radio.d.ts.map +1 -1
- package/dist/components/motion/radio.js +70 -10
- package/dist/components/motion/radio.js.map +1 -1
- package/dist/components/motion/scroll-progress.d.ts +1 -0
- package/dist/components/motion/select-morph.d.ts +1 -1
- package/dist/components/motion/select-morph.d.ts.map +1 -1
- package/dist/components/motion/select-morph.js +89 -21
- package/dist/components/motion/select-morph.js.map +1 -1
- package/dist/components/motion/select.d.ts.map +1 -1
- package/dist/components/motion/select.js +153 -135
- package/dist/components/motion/select.js.map +1 -1
- package/dist/components/motion/shader-background.d.ts +4 -2
- package/dist/components/motion/shader-background.d.ts.map +1 -1
- package/dist/components/motion/shader-background.js +9 -3
- package/dist/components/motion/shader-background.js.map +1 -1
- package/dist/components/motion/shared-layout-bg.d.ts.map +1 -1
- package/dist/components/motion/shared-layout-bg.js +17 -3
- package/dist/components/motion/shared-layout-bg.js.map +1 -1
- package/dist/components/motion/sortable-list.d.ts +1 -0
- package/dist/components/motion/sortable-stack.js +1 -2
- package/dist/components/motion/swipeable-list.d.ts.map +1 -1
- package/dist/components/motion/swipeable-list.js +61 -4
- package/dist/components/motion/swipeable-list.js.map +1 -1
- 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 +13 -3
- package/dist/components/motion/tabs.d.ts.map +1 -1
- package/dist/components/motion/tabs.js +248 -26
- package/dist/components/motion/tabs.js.map +1 -1
- package/dist/components/motion/text-reveal.d.ts +1 -0
- package/dist/components/motion/theme-toggle.js +1 -1
- package/dist/components/motion/tooltip/positioner.d.ts +8 -26
- package/dist/components/motion/tooltip/positioner.d.ts.map +1 -1
- package/dist/components/motion/tooltip/positioner.js +1 -2
- package/dist/components/motion/tooltip.d.ts +62 -20
- package/dist/components/motion/tooltip.d.ts.map +1 -1
- package/dist/components/motion/tooltip.js +1 -135
- package/dist/components/motion/wallet-card/account-avatar.js +1 -2
- package/dist/components/reui/alert.d.ts +1 -1
- package/dist/components/reui/autocomplete.d.ts.map +1 -1
- package/dist/components/reui/autocomplete.js +1 -1
- package/dist/components/reui/autocomplete.js.map +1 -1
- package/dist/components/reui/badge.d.ts +1 -1
- package/dist/components/reui/cascader/cascader-async.d.ts +21 -5
- package/dist/components/reui/cascader/cascader-async.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-async.js +61 -34
- package/dist/components/reui/cascader/cascader-async.js.map +1 -1
- package/dist/components/reui/cascader/cascader-columns.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-columns.js +5 -2
- package/dist/components/reui/cascader/cascader-columns.js.map +1 -1
- package/dist/components/reui/cascader/cascader-context.d.ts +3 -1
- 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-i18n.d.ts +1 -1
- package/dist/components/reui/cascader/cascader-item.d.ts +1 -1
- package/dist/components/reui/cascader/cascader-lib.d.ts +34 -8
- package/dist/components/reui/cascader/cascader-lib.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader-lib.js +145 -29
- 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-types.d.ts +1 -1
- package/dist/components/reui/cascader/cascader.d.ts +13 -8
- package/dist/components/reui/cascader/cascader.d.ts.map +1 -1
- package/dist/components/reui/cascader/cascader.js +31 -16
- package/dist/components/reui/cascader/cascader.js.map +1 -1
- package/dist/components/reui/code-block/code-block.d.ts.map +1 -1
- package/dist/components/reui/color-picker.d.ts +280 -0
- package/dist/components/reui/color-picker.d.ts.map +1 -0
- package/dist/components/reui/color-picker.js +2013 -0
- package/dist/components/reui/color-picker.js.map +1 -0
- package/dist/components/reui/data-grid/data-grid-cell-selection.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-cell-selection.js +1 -0
- package/dist/components/reui/data-grid/data-grid-cell-selection.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-filter.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-filter.js +1 -0
- 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 +6 -8
- 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 +50 -29
- package/dist/components/reui/data-grid/data-grid-column-header.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-visibility.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-visibility.js +1 -0
- package/dist/components/reui/data-grid/data-grid-column-visibility.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-pagination.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-pagination.js +2 -1
- 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 +10 -3
- package/dist/components/reui/data-grid/data-grid-scroll-area.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js +15 -10
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd.d.ts +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd.js +54 -14
- package/dist/components/reui/data-grid/data-grid-table-dnd.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-virtual.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table-virtual.js +37 -42
- 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 +174 -16
- package/dist/components/reui/data-grid/data-grid-table.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid-table.js +223 -89
- package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid.d.ts +55 -1
- package/dist/components/reui/data-grid/data-grid.d.ts.map +1 -1
- package/dist/components/reui/data-grid/data-grid.js +112 -22
- package/dist/components/reui/data-grid/data-grid.js.map +1 -1
- package/dist/components/reui/date-selector.d.ts +1 -0
- package/dist/components/reui/date-selector.d.ts.map +1 -1
- package/dist/components/reui/date-selector.js +22 -16
- package/dist/components/reui/date-selector.js.map +1 -1
- package/dist/components/reui/emoji-picker.d.ts +367 -0
- package/dist/components/reui/emoji-picker.d.ts.map +1 -0
- package/dist/components/reui/emoji-picker.js +1768 -0
- package/dist/components/reui/emoji-picker.js.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-agenda-view.js +3 -5
- package/dist/components/reui/event-calendar/event-calendar-agenda-view.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-i18n.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-nav.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-nav.js +4 -4
- package/dist/components/reui/event-calendar/event-calendar-nav.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar.js +34 -31
- package/dist/components/reui/event-calendar/event-calendar.js.map +1 -1
- package/dist/components/reui/file-type.d.ts +792 -0
- package/dist/components/reui/file-type.d.ts.map +1 -0
- package/dist/components/reui/file-type.js +1367 -0
- package/dist/components/reui/file-type.js.map +1 -0
- package/dist/components/reui/filters/filters-advanced.d.ts +1 -0
- package/dist/components/reui/filters/filters-advanced.js +1 -1
- 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-chip.d.ts +5 -1
- package/dist/components/reui/filters/filters-chip.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-chip.js +1 -1
- package/dist/components/reui/filters/filters-lib.d.ts +1 -1
- package/dist/components/reui/filters/filters-lib.d.ts.map +1 -1
- package/dist/components/reui/frame.d.ts.map +1 -1
- package/dist/components/reui/frame.js.map +1 -1
- package/dist/components/reui/gantt/gantt-nav.d.ts.map +1 -1
- package/dist/components/reui/gantt/gantt-nav.js +4 -4
- package/dist/components/reui/gantt/gantt-nav.js.map +1 -1
- package/dist/components/reui/gantt/gantt.d.ts.map +1 -1
- package/dist/components/reui/gantt/gantt.js +5 -2
- package/dist/components/reui/gantt/gantt.js.map +1 -1
- package/dist/components/reui/icon-tile.d.ts +1 -1
- package/dist/components/reui/icon-tile.js +8 -7
- package/dist/components/reui/icon-tile.js.map +1 -1
- package/dist/components/reui/kanban.d.ts.map +1 -1
- package/dist/components/reui/kanban.js +1 -1
- package/dist/components/reui/kanban.js.map +1 -1
- package/dist/components/reui/number-field.d.ts.map +1 -1
- package/dist/components/reui/number-field.js.map +1 -1
- package/dist/components/reui/phone-input.js +30 -27
- package/dist/components/reui/phone-input.js.map +1 -1
- package/dist/components/reui/scrollspy.d.ts +1 -0
- package/dist/components/reui/time-picker.js +1 -1
- package/dist/components/reui/time-picker.js.map +1 -1
- package/dist/components/ui/attachment.d.ts +1 -1
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/chart.d.ts.map +1 -1
- package/dist/components/ui/code-block.d.ts +29 -0
- package/dist/components/ui/code-block.d.ts.map +1 -0
- package/dist/components/ui/code-block.js +124 -0
- package/dist/components/ui/code-block.js.map +1 -0
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/direction.js +1 -2
- package/dist/components/ui/field.d.ts +1 -1
- package/dist/components/ui/field.js +1 -1
- package/dist/components/ui/input-group.d.ts +1 -1
- package/dist/components/ui/marker.d.ts +1 -1
- package/dist/components/ui/message-scroller.d.ts.map +1 -1
- package/dist/components/ui/questionnaire.d.ts.map +1 -1
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/trace.d.ts +21 -0
- package/dist/components/ui/trace.d.ts.map +1 -0
- package/dist/components/ui/trace.js +77 -0
- package/dist/components/ui/trace.js.map +1 -0
- package/dist/context-BYXeJQnz.d.ts.map +1 -1
- package/dist/context-tTdLKYNf.js +99 -0
- package/dist/context-tTdLKYNf.js.map +1 -0
- package/dist/{copy-menu-C5GaT4Z-.js → copy-menu-DOg9Jh-U.js} +2 -2
- package/dist/{copy-menu-C5GaT4Z-.js.map → copy-menu-DOg9Jh-U.js.map} +1 -1
- package/dist/hooks/use-copy-to-clipboard.d.ts +1 -0
- package/dist/hooks/use-focus-trap.d.ts +22 -0
- package/dist/hooks/use-focus-trap.d.ts.map +1 -0
- package/dist/hooks/use-focus-trap.js +80 -0
- package/dist/hooks/use-focus-trap.js.map +1 -0
- package/dist/hooks/use-highlighted-code.d.ts +5 -0
- package/dist/hooks/use-highlighted-code.d.ts.map +1 -0
- package/dist/hooks/use-highlighted-code.js +128 -0
- package/dist/hooks/use-highlighted-code.js.map +1 -0
- package/dist/hooks/use-hover-gesture.d.ts +1 -0
- package/dist/hooks/use-intersection-observer.d.ts +1 -0
- package/dist/hooks/use-listbox.d.ts +29 -0
- package/dist/hooks/use-listbox.d.ts.map +1 -0
- package/dist/hooks/use-listbox.js +75 -0
- package/dist/hooks/use-listbox.js.map +1 -0
- package/dist/hooks/use-scroll-position.d.ts +1 -0
- package/dist/hooks/use-slider-input.d.ts +1 -0
- package/dist/hooks/use-viewport.d.ts +1 -0
- package/dist/lib/tick-sound.d.ts +1 -0
- package/dist/model-NSIg2p7a.d.ts +20 -0
- package/dist/model-NSIg2p7a.d.ts.map +1 -0
- package/dist/model-_mRyI6V9.d.ts +18 -0
- package/dist/model-_mRyI6V9.d.ts.map +1 -0
- package/dist/{positioner-3mCqiebN.js → positioner-3r3cfkqT.js} +97 -33
- package/dist/positioner-3r3cfkqT.js.map +1 -0
- package/dist/tooltip-Bam5KeYe.js +535 -0
- package/dist/tooltip-Bam5KeYe.js.map +1 -0
- package/dist/tooltip-C01qUgsW.d.ts.map +1 -1
- package/dist/use-position-DOi1gVL0.d.ts +32 -0
- package/dist/use-position-DOi1gVL0.d.ts.map +1 -0
- package/package.json +11 -11
- package/dist/cascader-types-DVT-znZ-.d.ts.map +0 -1
- package/dist/components/motion/tooltip.js.map +0 -1
- package/dist/model-DfeFradZ.d.ts +0 -9
- package/dist/model-DfeFradZ.d.ts.map +0 -1
- package/dist/positioner-3mCqiebN.js.map +0 -1
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { EASE_OUT, SPRING_PRESS, SPRING_SWAP } from "../../lib/ease.js";
|
|
2
|
+
import { EASE_OUT, SPRING_LAYOUT, SPRING_PRESS, SPRING_SWAP } from "../../lib/ease.js";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { cn } from "@kumix/utils";
|
|
5
5
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
7
7
|
//#region src/components/motion/action-swap.tsx
|
|
8
|
-
const BLUR_TRANSITION =
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const BLUR_TRANSITION = SPRING_SWAP;
|
|
9
|
+
const BLUR_EXIT_TRANSITION = {
|
|
10
|
+
duration: .16,
|
|
11
|
+
ease: EASE_OUT
|
|
11
12
|
};
|
|
12
13
|
const ROLL_TRANSITION = SPRING_SWAP;
|
|
13
14
|
const ROLL_EXIT_TRANSITION = {
|
|
14
15
|
duration: .14,
|
|
15
16
|
ease: EASE_OUT
|
|
16
17
|
};
|
|
17
|
-
const SWAP_BLUR = "blur(
|
|
18
|
+
const SWAP_BLUR = "blur(2px)";
|
|
18
19
|
const ROLL_BLUR = "blur(3px)";
|
|
19
20
|
const CASCADE_STAGGER = .025;
|
|
20
21
|
const CASCADE_LETTER_VARIANTS = {
|
|
@@ -47,7 +48,7 @@ const TEXT_VARIANTS = {
|
|
|
47
48
|
blur: {
|
|
48
49
|
initial: {
|
|
49
50
|
opacity: 0,
|
|
50
|
-
scale: .
|
|
51
|
+
scale: .9,
|
|
51
52
|
filter: SWAP_BLUR
|
|
52
53
|
},
|
|
53
54
|
animate: {
|
|
@@ -58,9 +59,9 @@ const TEXT_VARIANTS = {
|
|
|
58
59
|
},
|
|
59
60
|
exit: {
|
|
60
61
|
opacity: 0,
|
|
61
|
-
scale: .
|
|
62
|
+
scale: .96,
|
|
62
63
|
filter: SWAP_BLUR,
|
|
63
|
-
transition:
|
|
64
|
+
transition: BLUR_EXIT_TRANSITION
|
|
64
65
|
}
|
|
65
66
|
},
|
|
66
67
|
roll: {
|
|
@@ -100,7 +101,7 @@ const ICON_VARIANTS = {
|
|
|
100
101
|
opacity: 0,
|
|
101
102
|
scale: .25,
|
|
102
103
|
filter: SWAP_BLUR,
|
|
103
|
-
transition:
|
|
104
|
+
transition: BLUR_EXIT_TRANSITION
|
|
104
105
|
}
|
|
105
106
|
},
|
|
106
107
|
roll: {
|
|
@@ -167,6 +168,9 @@ function ActionSwapText({ value, children, animation = "blur", className }) {
|
|
|
167
168
|
children: label.split("").map((char, i) => /* @__PURE__ */ jsx(motion.span, {
|
|
168
169
|
custom: i * CASCADE_STAGGER,
|
|
169
170
|
variants: CASCADE_LETTER_VARIANTS,
|
|
171
|
+
initial: "initial",
|
|
172
|
+
animate: "animate",
|
|
173
|
+
exit: "exit",
|
|
170
174
|
className: "inline-block whitespace-pre will-change-[opacity,filter,transform]",
|
|
171
175
|
children: char
|
|
172
176
|
}, i))
|
|
@@ -214,7 +218,7 @@ function ActionSwapIcon({ value, children, animation = "blur", className }) {
|
|
|
214
218
|
})
|
|
215
219
|
});
|
|
216
220
|
}
|
|
217
|
-
function ActionSwapButton({ items, value, defaultValue, onValueChange, variant = "secondary", size = "md", animation = "blur", iconOnly = size === "icon", cycle = true, className, disabled, onClick, ...rest }) {
|
|
221
|
+
function ActionSwapButton({ items, value, defaultValue, onValueChange, variant = "secondary", size = "md", animation = "blur", iconOnly = size === "icon", cycle = true, className, disabled, onClick, style, ...rest }) {
|
|
218
222
|
const reduce = useReducedMotion();
|
|
219
223
|
const [internalValue, setInternalValue] = useState(defaultValue ?? items[0]?.id);
|
|
220
224
|
const currentValue = value ?? internalValue;
|
|
@@ -224,11 +228,21 @@ function ActionSwapButton({ items, value, defaultValue, onValueChange, variant =
|
|
|
224
228
|
const nextItem = cycle && items.length > 0 ? items[(activeIndex + 1) % items.length] : void 0;
|
|
225
229
|
if (!activeItem) return null;
|
|
226
230
|
const accessibleLabel = activeItem.ariaLabel ?? (iconOnly && typeof activeItem.label === "string" ? activeItem.label : void 0);
|
|
231
|
+
const layoutTransition = reduce ? { duration: 0 } : SPRING_LAYOUT;
|
|
227
232
|
return /* @__PURE__ */ jsxs(motion.button, {
|
|
228
233
|
type: "button",
|
|
229
234
|
disabled,
|
|
235
|
+
layout: true,
|
|
236
|
+
layoutDependency: activeItem.id,
|
|
230
237
|
whileTap: reduce || disabled ? void 0 : { scale: .97 },
|
|
231
|
-
transition:
|
|
238
|
+
transition: {
|
|
239
|
+
...SPRING_PRESS,
|
|
240
|
+
layout: layoutTransition
|
|
241
|
+
},
|
|
242
|
+
style: {
|
|
243
|
+
borderRadius: 9999,
|
|
244
|
+
...style
|
|
245
|
+
},
|
|
232
246
|
className: cn("inline-flex items-center justify-center overflow-hidden font-medium transition-colors", "disabled:pointer-events-none disabled:opacity-50", VARIANT_CLASS[variant], SIZE_CLASS[size], className),
|
|
233
247
|
"aria-label": accessibleLabel,
|
|
234
248
|
onClick: (event) => {
|
|
@@ -238,15 +252,27 @@ function ActionSwapButton({ items, value, defaultValue, onValueChange, variant =
|
|
|
238
252
|
onValueChange?.(nextItem.id, nextItem);
|
|
239
253
|
},
|
|
240
254
|
...rest,
|
|
241
|
-
children: [hasIcon ? /* @__PURE__ */ jsx(
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
255
|
+
children: [hasIcon ? /* @__PURE__ */ jsx(motion.span, {
|
|
256
|
+
layout: "position",
|
|
257
|
+
layoutDependency: activeItem.id,
|
|
258
|
+
transition: layoutTransition,
|
|
259
|
+
className: "inline-flex shrink-0",
|
|
260
|
+
children: /* @__PURE__ */ jsx(ActionSwapIcon, {
|
|
261
|
+
value: activeItem.id,
|
|
262
|
+
animation,
|
|
263
|
+
className: "h-4 w-4",
|
|
264
|
+
children: activeItem.icon ?? null
|
|
265
|
+
})
|
|
266
|
+
}) : null, !iconOnly ? /* @__PURE__ */ jsx(motion.span, {
|
|
267
|
+
layout: "position",
|
|
268
|
+
layoutDependency: activeItem.id,
|
|
269
|
+
transition: layoutTransition,
|
|
270
|
+
className: "inline-flex min-w-0 max-w-full",
|
|
271
|
+
children: /* @__PURE__ */ jsx(ActionSwapText, {
|
|
272
|
+
value: activeItem.id,
|
|
273
|
+
animation,
|
|
274
|
+
children: activeItem.label
|
|
275
|
+
})
|
|
250
276
|
}) : null]
|
|
251
277
|
});
|
|
252
278
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-swap.js","names":[],"sources":["../../../src/components/motion/action-swap.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { useState } from \"react\";\nimport {\n AnimatePresence,\n type HTMLMotionProps,\n motion,\n useReducedMotion,\n type Variants,\n} from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT, SPRING_PRESS, SPRING_SWAP } from \"../../lib/ease\";\n\nexport type ActionSwapItem = {\n id: string;\n label: ReactNode;\n icon?: ReactNode;\n ariaLabel?: string;\n};\n\nexport type ActionSwapButtonVariant = \"primary\" | \"secondary\" | \"outline\" | \"ghost\";\nexport type ActionSwapButtonSize = \"sm\" | \"md\" | \"lg\" | \"icon\";\nexport type ActionSwapAnimation = \"blur\" | \"roll\" | \"cascade\";\n\n/** Animations with a single-element variant set (cascade animates per letter). */\ntype CoreAnimation = \"blur\" | \"roll\";\n\nexport interface ActionSwapButtonProps\n extends Omit<HTMLMotionProps<\"button\">, \"children\" | \"onChange\"> {\n items: ActionSwapItem[];\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string, item: ActionSwapItem) => void;\n variant?: ActionSwapButtonVariant;\n size?: ActionSwapButtonSize;\n animation?: ActionSwapAnimation;\n iconOnly?: boolean;\n cycle?: boolean;\n}\n\nexport interface ActionSwapTextProps {\n value: string;\n children: ReactNode;\n animation?: ActionSwapAnimation;\n className?: string;\n}\n\nexport interface ActionSwapIconProps {\n value: string;\n children: ReactNode;\n animation?: ActionSwapAnimation;\n className?: string;\n}\n\nconst BLUR_TRANSITION = { duration: 0.2, ease: \"easeInOut\" } as const;\nconst ROLL_TRANSITION = SPRING_SWAP;\nconst ROLL_EXIT_TRANSITION = { duration: 0.14, ease: EASE_OUT } as const;\nconst SWAP_BLUR = \"blur(8px)\";\nconst ROLL_BLUR = \"blur(3px)\";\n\n// Cascade rolls the label one letter at a time, left to right. The leaving\n// and landing strings overlap as independent layers (no shared cells), so\n// proportional glyph widths never jitter. Exits cascade at half the enter\n// stagger so the tail of the old label lingers briefly.\nconst CASCADE_STAGGER = 0.025;\n\nconst CASCADE_LETTER_VARIANTS: Variants = {\n initial: { opacity: 0, y: \"105%\", filter: ROLL_BLUR },\n animate: (delay: number = 0) => ({\n opacity: 1,\n y: \"0%\",\n filter: \"blur(0px)\",\n transition: { ...SPRING_SWAP, delay },\n }),\n exit: (delay: number = 0) => ({\n opacity: 0,\n y: \"-105%\",\n filter: ROLL_BLUR,\n transition: { duration: 0.16, ease: EASE_OUT, delay: delay * 0.5 },\n }),\n};\n\nconst TEXT_VARIANTS: Record<CoreAnimation, Variants> = {\n blur: {\n initial: { opacity: 0, scale: 0.94, filter: SWAP_BLUR },\n animate: {\n opacity: 1,\n scale: 1,\n filter: \"blur(0px)\",\n transition: BLUR_TRANSITION,\n },\n exit: {\n opacity: 0,\n scale: 0.94,\n filter: SWAP_BLUR,\n transition: BLUR_TRANSITION,\n },\n },\n roll: {\n initial: { opacity: 0, y: \"90%\", filter: ROLL_BLUR },\n animate: {\n opacity: 1,\n y: \"0%\",\n filter: \"blur(0px)\",\n transition: ROLL_TRANSITION,\n },\n exit: {\n opacity: 0,\n y: \"-90%\",\n filter: ROLL_BLUR,\n transition: ROLL_EXIT_TRANSITION,\n },\n },\n};\n\nconst ICON_VARIANTS: Record<CoreAnimation, Variants> = {\n blur: {\n initial: { opacity: 0, scale: 0.25, filter: SWAP_BLUR },\n animate: {\n opacity: 1,\n scale: 1,\n filter: \"blur(0px)\",\n transition: BLUR_TRANSITION,\n },\n exit: {\n opacity: 0,\n scale: 0.25,\n filter: SWAP_BLUR,\n transition: BLUR_TRANSITION,\n },\n },\n roll: {\n initial: { opacity: 0, y: 12, filter: ROLL_BLUR },\n animate: {\n opacity: 1,\n y: 0,\n filter: \"blur(0px)\",\n transition: ROLL_TRANSITION,\n },\n exit: {\n opacity: 0,\n y: -12,\n filter: ROLL_BLUR,\n transition: ROLL_EXIT_TRANSITION,\n },\n },\n};\n\nconst VARIANT_CLASS: Record<ActionSwapButtonVariant, string> = {\n primary: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n secondary: \"border border-border bg-card text-foreground hover:border-border\",\n outline: \"border border-border bg-transparent text-foreground hover:bg-muted/60\",\n ghost: \"text-muted-foreground hover:bg-muted/60 hover:text-foreground\",\n};\n\nconst SIZE_CLASS: Record<ActionSwapButtonSize, string> = {\n sm: \"h-8 gap-1.5 rounded-full px-3 text-xs\",\n md: \"h-10 gap-2 rounded-full px-4 text-sm\",\n lg: \"h-12 gap-2.5 rounded-full px-5 text-base\",\n icon: \"h-10 w-10 rounded-full\",\n};\n\nexport function ActionSwapText({\n value,\n children,\n animation = \"blur\",\n className,\n}: ActionSwapTextProps) {\n const reduce = useReducedMotion();\n\n // Cascade needs a plain string to split into letters; non-string content\n // and reduced motion fall back to the closest single-element animation.\n const label = typeof children === \"string\" ? children : null;\n const cascade = animation === \"cascade\" && label !== null && !reduce;\n const coreAnimation: CoreAnimation = animation === \"cascade\" ? \"roll\" : animation;\n\n return (\n <span\n className={cn(\n \"relative -my-[0.08em] inline-block max-w-full whitespace-nowrap py-[0.08em] align-bottom\",\n className,\n )}\n style={{\n clipPath: \"inset(0 -999px)\",\n WebkitClipPath: \"inset(0 -999px)\",\n }}\n >\n <span aria-hidden className=\"invisible inline-block whitespace-nowrap\">\n {cascade\n ? label.split(\"\").map((char, index) => (\n <span key={index} className=\"inline-block whitespace-pre\">\n {char}\n </span>\n ))\n : children}\n </span>\n {cascade ? (\n <>\n {/* Letters are decorative fragments; readers get the whole label. */}\n <span className=\"sr-only\">{label}</span>\n <AnimatePresence initial={false}>\n <motion.span\n key={`cascade-${value}`}\n aria-hidden\n initial=\"initial\"\n animate=\"animate\"\n exit=\"exit\"\n className=\"absolute top-[0.08em] left-0 inline-block whitespace-pre\"\n >\n {label.split(\"\").map((char, i) => (\n <motion.span\n key={i}\n custom={i * CASCADE_STAGGER}\n variants={CASCADE_LETTER_VARIANTS}\n className=\"inline-block whitespace-pre will-change-[opacity,filter,transform]\"\n >\n {char}\n </motion.span>\n ))}\n </motion.span>\n </AnimatePresence>\n </>\n ) : (\n <AnimatePresence initial={false}>\n <motion.span\n key={`${animation}-${value}`}\n variants={TEXT_VARIANTS[coreAnimation]}\n initial={reduce ? false : \"initial\"}\n animate={reduce ? { opacity: 1, filter: \"blur(0px)\", scale: 1, y: 0 } : \"animate\"}\n exit={reduce ? undefined : \"exit\"}\n // Truncation lives on the layer that holds the text — the layer\n // moves as a whole, so clipping it never eats the roll.\n className=\"absolute top-[0.08em] left-0 inline-block max-w-full truncate will-change-[opacity,filter,transform]\"\n >\n {children}\n </motion.span>\n </AnimatePresence>\n )}\n </span>\n );\n}\n\nexport function ActionSwapIcon({\n value,\n children,\n animation = \"blur\",\n className,\n}: ActionSwapIconProps) {\n const reduce = useReducedMotion();\n // Icons are single elements — cascade maps to its closest motion, roll.\n const coreAnimation: CoreAnimation = animation === \"cascade\" ? \"roll\" : animation;\n\n return (\n <span\n className={cn(\"relative inline-grid shrink-0 place-items-center overflow-hidden\", className)}\n >\n <AnimatePresence mode=\"popLayout\" initial={false}>\n <motion.span\n key={`${animation}-${value}`}\n aria-hidden\n variants={ICON_VARIANTS[coreAnimation]}\n initial={reduce ? false : \"initial\"}\n animate={reduce ? { opacity: 1, filter: \"blur(0px)\", scale: 1, y: 0 } : \"animate\"}\n exit={reduce ? undefined : \"exit\"}\n className=\"col-start-1 row-start-1 inline-flex items-center justify-center will-change-[opacity,filter,transform]\"\n >\n {children}\n </motion.span>\n </AnimatePresence>\n </span>\n );\n}\n\nexport function ActionSwapButton({\n items,\n value,\n defaultValue,\n onValueChange,\n variant = \"secondary\",\n size = \"md\",\n animation = \"blur\",\n iconOnly = size === \"icon\",\n cycle = true,\n className,\n disabled,\n onClick,\n ...rest\n}: ActionSwapButtonProps) {\n const reduce = useReducedMotion();\n const [internalValue, setInternalValue] = useState(defaultValue ?? items[0]?.id);\n const currentValue = value ?? internalValue;\n const activeIndex = Math.max(\n 0,\n items.findIndex((item) => item.id === currentValue),\n );\n const activeItem = items[activeIndex] ?? items[0];\n const hasIcon = items.some((item) => item.icon);\n const nextItem = cycle && items.length > 0 ? items[(activeIndex + 1) % items.length] : undefined;\n\n if (!activeItem) return null;\n\n const accessibleLabel =\n activeItem.ariaLabel ??\n (iconOnly && typeof activeItem.label === \"string\" ? activeItem.label : undefined);\n\n return (\n <motion.button\n type=\"button\"\n disabled={disabled}\n whileTap={reduce || disabled ? undefined : { scale: 0.97 }}\n transition={SPRING_PRESS}\n className={cn(\n \"inline-flex items-center justify-center overflow-hidden font-medium transition-colors\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n VARIANT_CLASS[variant],\n SIZE_CLASS[size],\n className,\n )}\n aria-label={accessibleLabel}\n onClick={(event) => {\n onClick?.(event);\n if (event.defaultPrevented || disabled || !cycle || !nextItem) return;\n if (value === undefined) setInternalValue(nextItem.id);\n onValueChange?.(nextItem.id, nextItem);\n }}\n {...rest}\n >\n {hasIcon ? (\n <ActionSwapIcon value={activeItem.id} animation={animation} className=\"h-4 w-4\">\n {activeItem.icon ?? null}\n </ActionSwapIcon>\n ) : null}\n {!iconOnly ? (\n <ActionSwapText value={activeItem.id} animation={animation}>\n {activeItem.label}\n </ActionSwapText>\n ) : null}\n </motion.button>\n );\n}\n"],"mappings":";;;;;;;AAwDA,MAAM,kBAAkB;CAAE,UAAU;CAAK,MAAM;AAAY;AAC3D,MAAM,kBAAkB;AACxB,MAAM,uBAAuB;CAAE,UAAU;CAAM,MAAM;AAAS;AAC9D,MAAM,YAAY;AAClB,MAAM,YAAY;AAMlB,MAAM,kBAAkB;AAExB,MAAM,0BAAoC;CACxC,SAAS;EAAE,SAAS;EAAG,GAAG;EAAQ,QAAQ;CAAU;CACpD,UAAU,QAAgB,OAAO;EAC/B,SAAS;EACT,GAAG;EACH,QAAQ;EACR,YAAY;GAAE,GAAG;GAAa;EAAM;CACtC;CACA,OAAO,QAAgB,OAAO;EAC5B,SAAS;EACT,GAAG;EACH,QAAQ;EACR,YAAY;GAAE,UAAU;GAAM,MAAM;GAAU,OAAO,QAAQ;EAAI;CACnE;AACF;AAEA,MAAM,gBAAiD;CACrD,MAAM;EACJ,SAAS;GAAE,SAAS;GAAG,OAAO;GAAM,QAAQ;EAAU;EACtD,SAAS;GACP,SAAS;GACT,OAAO;GACP,QAAQ;GACR,YAAY;EACd;EACA,MAAM;GACJ,SAAS;GACT,OAAO;GACP,QAAQ;GACR,YAAY;EACd;CACF;CACA,MAAM;EACJ,SAAS;GAAE,SAAS;GAAG,GAAG;GAAO,QAAQ;EAAU;EACnD,SAAS;GACP,SAAS;GACT,GAAG;GACH,QAAQ;GACR,YAAY;EACd;EACA,MAAM;GACJ,SAAS;GACT,GAAG;GACH,QAAQ;GACR,YAAY;EACd;CACF;AACF;AAEA,MAAM,gBAAiD;CACrD,MAAM;EACJ,SAAS;GAAE,SAAS;GAAG,OAAO;GAAM,QAAQ;EAAU;EACtD,SAAS;GACP,SAAS;GACT,OAAO;G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AAS,KAAK,OAAO,YAAY,CACpD;CACA,MAAM,aAAa,MAAM,gBAAgB,MAAM;CAC/C,MAAM,UAAU,MAAM,MAAM,SAAS,KAAK,IAAI;CAC9C,MAAM,WAAW,SAAS,MAAM,SAAS,IAAI,OAAO,cAAc,KAAK,MAAM,UAAU,KAAA;CAEvF,IAAI,CAAC,YAAY,OAAO;CAExB,MAAM,kBACJ,WAAW,cACV,YAAY,OAAO,WAAW,UAAU,WAAW,WAAW,QAAQ,KAAA;CAEzE,OACE,qBAAC,OAAO,QAAR;EACE,MAAK;EACK;EACV,UAAU,UAAU,WAAW,KAAA,IAAY,EAAE,OAAO,IAAK;EACzD,YAAY;EACZ,WAAW,GACT,yFACA,oDACA,cAAc,UACd,WAAW,OACX,SACF;EACA,cAAY;EACZ,UAAU,UAAU;GAClB,UAAU,KAAK;GACf,IAAI,MAAM,oBAAoB,YAAY,CAAC,SAAS,CAAC,UAAU;GAC/D,IAAI,UAAU,KAAA,GAAW,iBAAiB,SAAS,EAAE;GACrD,gBAAgB,SAAS,IAAI,QAAQ;EACvC;EACA,GAAI;EAnBN,UAAA,CAqBG,UACC,oBAAC,gBAAD;GAAgB,OAAO,WAAW;GAAe;GAAW,WAAU;GACnE,UAAA,WAAW,QAAQ;EACN,CAAA,IACd,MACH,CAAC,WACA,oBAAC,gBAAD;GAAgB,OAAO,WAAW;GAAe;GAC9C,UAAA,WAAW;EACE,CAAA,IACd,IACS;;AAEnB"}
|
|
1
|
+
{"version":3,"file":"action-swap.js","names":[],"sources":["../../../src/components/motion/action-swap.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { useState } from \"react\";\nimport {\n AnimatePresence,\n type HTMLMotionProps,\n motion,\n useReducedMotion,\n type Variants,\n} from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT, SPRING_LAYOUT, SPRING_PRESS, SPRING_SWAP } from \"../../lib/ease\";\n\nexport type ActionSwapItem = {\n id: string;\n label: ReactNode;\n icon?: ReactNode;\n ariaLabel?: string;\n};\n\nexport type ActionSwapButtonVariant = \"primary\" | \"secondary\" | \"outline\" | \"ghost\";\nexport type ActionSwapButtonSize = \"sm\" | \"md\" | \"lg\" | \"icon\";\nexport type ActionSwapAnimation = \"blur\" | \"roll\" | \"cascade\";\n\n/** Animations with a single-element variant set (cascade animates per letter). */\ntype CoreAnimation = \"blur\" | \"roll\";\n\nexport interface ActionSwapButtonProps\n extends Omit<HTMLMotionProps<\"button\">, \"children\" | \"onChange\"> {\n items: ActionSwapItem[];\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string, item: ActionSwapItem) => void;\n variant?: ActionSwapButtonVariant;\n size?: ActionSwapButtonSize;\n animation?: ActionSwapAnimation;\n iconOnly?: boolean;\n cycle?: boolean;\n}\n\nexport interface ActionSwapTextProps {\n value: string;\n children: ReactNode;\n animation?: ActionSwapAnimation;\n className?: string;\n}\n\nexport interface ActionSwapIconProps {\n value: string;\n children: ReactNode;\n animation?: ActionSwapAnimation;\n className?: string;\n}\n\n// The arriving layer springs in, so a second press mid-swap bends it toward\n// the new target instead of restarting. The leaving layer is a little quicker,\n// still long enough to cross the arrival so the swap reads as one morph.\nconst BLUR_TRANSITION = SPRING_SWAP;\nconst BLUR_EXIT_TRANSITION = { duration: 0.16, ease: EASE_OUT } as const;\nconst ROLL_TRANSITION = SPRING_SWAP;\nconst ROLL_EXIT_TRANSITION = { duration: 0.14, ease: EASE_OUT } as const;\n// A light blur softens the crossing without smearing small glyphs.\nconst SWAP_BLUR = \"blur(2px)\";\nconst ROLL_BLUR = \"blur(3px)\";\n\n// Cascade rolls the label one letter at a time, left to right. The leaving\n// and landing strings overlap as independent layers (no shared cells), so\n// proportional glyph widths never jitter. Exits cascade at half the enter\n// stagger so the tail of the old label lingers briefly.\nconst CASCADE_STAGGER = 0.025;\n\nconst CASCADE_LETTER_VARIANTS: Variants = {\n initial: { opacity: 0, y: \"105%\", filter: ROLL_BLUR },\n animate: (delay: number = 0) => ({\n opacity: 1,\n y: \"0%\",\n filter: \"blur(0px)\",\n transition: { ...SPRING_SWAP, delay },\n }),\n exit: (delay: number = 0) => ({\n opacity: 0,\n y: \"-105%\",\n filter: ROLL_BLUR,\n transition: { duration: 0.16, ease: EASE_OUT, delay: delay * 0.5 },\n }),\n};\n\nconst TEXT_VARIANTS: Record<CoreAnimation, Variants> = {\n blur: {\n initial: { opacity: 0, scale: 0.9, filter: SWAP_BLUR },\n animate: {\n opacity: 1,\n scale: 1,\n filter: \"blur(0px)\",\n transition: BLUR_TRANSITION,\n },\n exit: {\n opacity: 0,\n scale: 0.96,\n filter: SWAP_BLUR,\n transition: BLUR_EXIT_TRANSITION,\n },\n },\n roll: {\n initial: { opacity: 0, y: \"90%\", filter: ROLL_BLUR },\n animate: {\n opacity: 1,\n y: \"0%\",\n filter: \"blur(0px)\",\n transition: ROLL_TRANSITION,\n },\n exit: {\n opacity: 0,\n y: \"-90%\",\n filter: ROLL_BLUR,\n transition: ROLL_EXIT_TRANSITION,\n },\n },\n};\n\nconst ICON_VARIANTS: Record<CoreAnimation, Variants> = {\n blur: {\n initial: { opacity: 0, scale: 0.25, filter: SWAP_BLUR },\n animate: {\n opacity: 1,\n scale: 1,\n filter: \"blur(0px)\",\n transition: BLUR_TRANSITION,\n },\n exit: {\n opacity: 0,\n scale: 0.25,\n filter: SWAP_BLUR,\n transition: BLUR_EXIT_TRANSITION,\n },\n },\n roll: {\n initial: { opacity: 0, y: 12, filter: ROLL_BLUR },\n animate: {\n opacity: 1,\n y: 0,\n filter: \"blur(0px)\",\n transition: ROLL_TRANSITION,\n },\n exit: {\n opacity: 0,\n y: -12,\n filter: ROLL_BLUR,\n transition: ROLL_EXIT_TRANSITION,\n },\n },\n};\n\nconst VARIANT_CLASS: Record<ActionSwapButtonVariant, string> = {\n primary: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n secondary: \"border border-border bg-card text-foreground hover:border-border\",\n outline: \"border border-border bg-transparent text-foreground hover:bg-muted/60\",\n ghost: \"text-muted-foreground hover:bg-muted/60 hover:text-foreground\",\n};\n\nconst SIZE_CLASS: Record<ActionSwapButtonSize, string> = {\n sm: \"h-8 gap-1.5 rounded-full px-3 text-xs\",\n md: \"h-10 gap-2 rounded-full px-4 text-sm\",\n lg: \"h-12 gap-2.5 rounded-full px-5 text-base\",\n icon: \"h-10 w-10 rounded-full\",\n};\n\nexport function ActionSwapText({\n value,\n children,\n animation = \"blur\",\n className,\n}: ActionSwapTextProps) {\n const reduce = useReducedMotion();\n\n // Cascade needs a plain string to split into letters; non-string content\n // and reduced motion fall back to the closest single-element animation.\n const label = typeof children === \"string\" ? children : null;\n const cascade = animation === \"cascade\" && label !== null && !reduce;\n const coreAnimation: CoreAnimation = animation === \"cascade\" ? \"roll\" : animation;\n\n return (\n <span\n className={cn(\n \"relative -my-[0.08em] inline-block max-w-full whitespace-nowrap py-[0.08em] align-bottom\",\n className,\n )}\n style={{\n clipPath: \"inset(0 -999px)\",\n WebkitClipPath: \"inset(0 -999px)\",\n }}\n >\n <span aria-hidden className=\"invisible inline-block whitespace-nowrap\">\n {cascade\n ? label.split(\"\").map((char, index) => (\n <span key={index} className=\"inline-block whitespace-pre\">\n {char}\n </span>\n ))\n : children}\n </span>\n {cascade ? (\n <>\n {/* Letters are decorative fragments; readers get the whole label. */}\n <span className=\"sr-only\">{label}</span>\n <AnimatePresence initial={false}>\n <motion.span\n key={`cascade-${value}`}\n aria-hidden\n initial=\"initial\"\n animate=\"animate\"\n exit=\"exit\"\n className=\"absolute top-[0.08em] left-0 inline-block whitespace-pre\"\n >\n {label.split(\"\").map((char, i) => (\n <motion.span\n key={i}\n custom={i * CASCADE_STAGGER}\n variants={CASCADE_LETTER_VARIANTS}\n // Own states: a label that swaps away and straight back\n // re-enters mid-exit, and only owned targets are restored.\n initial=\"initial\"\n animate=\"animate\"\n exit=\"exit\"\n className=\"inline-block whitespace-pre will-change-[opacity,filter,transform]\"\n >\n {char}\n </motion.span>\n ))}\n </motion.span>\n </AnimatePresence>\n </>\n ) : (\n <AnimatePresence initial={false}>\n <motion.span\n key={`${animation}-${value}`}\n variants={TEXT_VARIANTS[coreAnimation]}\n initial={reduce ? false : \"initial\"}\n animate={reduce ? { opacity: 1, filter: \"blur(0px)\", scale: 1, y: 0 } : \"animate\"}\n exit={reduce ? undefined : \"exit\"}\n // Truncation lives on the layer that holds the text — the layer\n // moves as a whole, so clipping it never eats the roll.\n className=\"absolute top-[0.08em] left-0 inline-block max-w-full truncate will-change-[opacity,filter,transform]\"\n >\n {children}\n </motion.span>\n </AnimatePresence>\n )}\n </span>\n );\n}\n\nexport function ActionSwapIcon({\n value,\n children,\n animation = \"blur\",\n className,\n}: ActionSwapIconProps) {\n const reduce = useReducedMotion();\n // Icons are single elements — cascade maps to its closest motion, roll.\n const coreAnimation: CoreAnimation = animation === \"cascade\" ? \"roll\" : animation;\n\n return (\n <span\n className={cn(\"relative inline-grid shrink-0 place-items-center overflow-hidden\", className)}\n >\n <AnimatePresence mode=\"popLayout\" initial={false}>\n <motion.span\n key={`${animation}-${value}`}\n aria-hidden\n variants={ICON_VARIANTS[coreAnimation]}\n initial={reduce ? false : \"initial\"}\n animate={reduce ? { opacity: 1, filter: \"blur(0px)\", scale: 1, y: 0 } : \"animate\"}\n exit={reduce ? undefined : \"exit\"}\n className=\"col-start-1 row-start-1 inline-flex items-center justify-center will-change-[opacity,filter,transform]\"\n >\n {children}\n </motion.span>\n </AnimatePresence>\n </span>\n );\n}\n\nexport function ActionSwapButton({\n items,\n value,\n defaultValue,\n onValueChange,\n variant = \"secondary\",\n size = \"md\",\n animation = \"blur\",\n iconOnly = size === \"icon\",\n cycle = true,\n className,\n disabled,\n onClick,\n style,\n ...rest\n}: ActionSwapButtonProps) {\n const reduce = useReducedMotion();\n const [internalValue, setInternalValue] = useState(defaultValue ?? items[0]?.id);\n const currentValue = value ?? internalValue;\n const activeIndex = Math.max(\n 0,\n items.findIndex((item) => item.id === currentValue),\n );\n const activeItem = items[activeIndex] ?? items[0];\n const hasIcon = items.some((item) => item.icon);\n const nextItem = cycle && items.length > 0 ? items[(activeIndex + 1) % items.length] : undefined;\n\n if (!activeItem) return null;\n\n const accessibleLabel =\n activeItem.ariaLabel ??\n (iconOnly && typeof activeItem.label === \"string\" ? activeItem.label : undefined);\n const layoutTransition = reduce ? { duration: 0 } : SPRING_LAYOUT;\n\n return (\n <motion.button\n type=\"button\"\n disabled={disabled}\n // A label of a different length resizes the button: glide the width on\n // the soft layout spring, and only when the value changes, so unrelated\n // page reflow never animates the button.\n layout\n layoutDependency={activeItem.id}\n whileTap={reduce || disabled ? undefined : { scale: 0.97 }}\n transition={{ ...SPRING_PRESS, layout: layoutTransition }}\n // Layout animations only correct a radius set inline.\n style={{ borderRadius: 9999, ...style }}\n className={cn(\n \"inline-flex items-center justify-center overflow-hidden font-medium transition-colors\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n VARIANT_CLASS[variant],\n SIZE_CLASS[size],\n className,\n )}\n aria-label={accessibleLabel}\n onClick={(event) => {\n onClick?.(event);\n if (event.defaultPrevented || disabled || !cycle || !nextItem) return;\n if (value === undefined) setInternalValue(nextItem.id);\n onValueChange?.(nextItem.id, nextItem);\n }}\n {...rest}\n >\n {/* Position-only layout keeps the contents from stretching with the\n button while its width glides. */}\n {hasIcon ? (\n <motion.span\n layout=\"position\"\n layoutDependency={activeItem.id}\n transition={layoutTransition}\n className=\"inline-flex shrink-0\"\n >\n <ActionSwapIcon value={activeItem.id} animation={animation} className=\"h-4 w-4\">\n {activeItem.icon ?? null}\n </ActionSwapIcon>\n </motion.span>\n ) : null}\n {!iconOnly ? (\n <motion.span\n layout=\"position\"\n layoutDependency={activeItem.id}\n transition={layoutTransition}\n className=\"inline-flex min-w-0 max-w-full\"\n >\n <ActionSwapText value={activeItem.id} animation={animation}>\n {activeItem.label}\n </ActionSwapText>\n </motion.span>\n ) : null}\n </motion.button>\n );\n}\n"],"mappings":";;;;;;;AA2DA,MAAM,kBAAkB;AACxB,MAAM,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AK,MAAM,UAAU,KAAA;CAEvF,IAAI,CAAC,YAAY,OAAO;CAExB,MAAM,kBACJ,WAAW,cACV,YAAY,OAAO,WAAW,UAAU,WAAW,WAAW,QAAQ,KAAA;CACzE,MAAM,mBAAmB,SAAS,EAAE,UAAU,EAAE,IAAI;CAEpD,OACE,qBAAC,OAAO,QAAR;EACE,MAAK;EACK;EAIV,QAAA;EACA,kBAAkB,WAAW;EAC7B,UAAU,UAAU,WAAW,KAAA,IAAY,EAAE,OAAO,IAAK;EACzD,YAAY;GAAE,GAAG;GAAc,QAAQ;EAAiB;EAExD,OAAO;GAAE,cAAc;GAAM,GAAG;EAAM;EACtC,WAAW,GACT,yFACA,oDACA,cAAc,UACd,WAAW,OACX,SACF;EACA,cAAY;EACZ,UAAU,UAAU;GAClB,UAAU,KAAK;GACf,IAAI,MAAM,oBAAoB,YAAY,CAAC,SAAS,CAAC,UAAU;GAC/D,IAAI,UAAU,KAAA,GAAW,iBAAiB,SAAS,EAAE;GACrD,gBAAgB,SAAS,IAAI,QAAQ;EACvC;EACA,GAAI;EA1BN,UAAA,CA8BG,UACC,oBAAC,OAAO,MAAR;GACE,QAAO;GACP,kBAAkB,WAAW;GAC7B,YAAY;GACZ,WAAU;GAEV,UAAA,oBAAC,gBAAD;IAAgB,OAAO,WAAW;IAAe;IAAW,WAAU;IACnE,UAAA,WAAW,QAAQ;GACN,CAAA;EACL,CAAA,IACX,MACH,CAAC,WACA,oBAAC,OAAO,MAAR;GACE,QAAO;GACP,kBAAkB,WAAW;GAC7B,YAAY;GACZ,WAAU;GAEV,UAAA,oBAAC,gBAAD;IAAgB,OAAO,WAAW;IAAe;IAC9C,UAAA,WAAW;GACE,CAAA;EACL,CAAA,IACX,IACS;;AAEnB"}
|
|
@@ -12,6 +12,6 @@ export interface AnimatedBadgeProps extends Omit<HTMLMotionProps<"span">, "child
|
|
|
12
12
|
pulse?: boolean;
|
|
13
13
|
contentKey?: string | number;
|
|
14
14
|
}
|
|
15
|
-
export declare function AnimatedBadge({ status, size, children, icon, showIcon, pulse, contentKey, className, ...rest }: AnimatedBadgeProps): import("react").JSX.Element;
|
|
15
|
+
export declare function AnimatedBadge({ status, size, children, icon, showIcon, pulse, contentKey, className, style, ...rest }: AnimatedBadgeProps): import("react").JSX.Element;
|
|
16
16
|
//#endregion
|
|
17
17
|
//# sourceMappingURL=animated-badge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animated-badge.d.ts","names":[],"sources":["../../../src/components/motion/animated-badge.tsx"],"mappings":";;;YAeY;YAEA;iBAEK,2BAA2B,KAAK;EAC/C,SAAS;EACT,OAAO;EACP,WAAW;EACX,OAAO;EACP;EACA;EACA;;
|
|
1
|
+
{"version":3,"file":"animated-badge.d.ts","names":[],"sources":["../../../src/components/motion/animated-badge.tsx"],"mappings":";;;YAeY;YAEA;iBAEK,2BAA2B,KAAK;EAC/C,SAAS;EACT,OAAO;EACP,WAAW;EACX,OAAO;EACP;EACA;EACA;;wBA2Ec,gBACd,QACA,MACA,UACA,MACA,UACA,OACA,YACA,WACA,UACG,QACF,qCAAkB,IAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { EASE_OUT } from "../../lib/ease.js";
|
|
2
|
+
import { EASE_OUT, SPRING_LAYOUT, SPRING_SWAP } from "../../lib/ease.js";
|
|
3
3
|
import { cn } from "@kumix/utils";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
@@ -29,134 +29,90 @@ const ICONS = {
|
|
|
29
29
|
danger: X,
|
|
30
30
|
loading: LoaderCircle
|
|
31
31
|
};
|
|
32
|
+
const ROLL_EXIT_TRANSITION = {
|
|
33
|
+
duration: .14,
|
|
34
|
+
ease: EASE_OUT
|
|
35
|
+
};
|
|
36
|
+
const ROLL_BLUR = "blur(3px)";
|
|
32
37
|
const ICON_ROLL_VARIANTS = {
|
|
33
38
|
initial: {
|
|
34
|
-
opacity:
|
|
35
|
-
y:
|
|
36
|
-
|
|
37
|
-
rotate: -8,
|
|
38
|
-
filter: "blur(6px)"
|
|
39
|
+
opacity: 0,
|
|
40
|
+
y: 12,
|
|
41
|
+
filter: ROLL_BLUR
|
|
39
42
|
},
|
|
40
43
|
animate: {
|
|
41
44
|
opacity: 1,
|
|
42
|
-
y:
|
|
43
|
-
scale: 1,
|
|
44
|
-
rotate: 0,
|
|
45
|
+
y: 0,
|
|
45
46
|
filter: "blur(0px)",
|
|
46
|
-
transition:
|
|
47
|
-
y: {
|
|
48
|
-
type: "spring",
|
|
49
|
-
stiffness: 210,
|
|
50
|
-
damping: 24,
|
|
51
|
-
mass: .85
|
|
52
|
-
},
|
|
53
|
-
scale: {
|
|
54
|
-
type: "spring",
|
|
55
|
-
stiffness: 250,
|
|
56
|
-
damping: 24,
|
|
57
|
-
mass: .75
|
|
58
|
-
},
|
|
59
|
-
rotate: {
|
|
60
|
-
duration: .28,
|
|
61
|
-
ease: EASE_OUT
|
|
62
|
-
},
|
|
63
|
-
opacity: {
|
|
64
|
-
duration: .28,
|
|
65
|
-
ease: EASE_OUT
|
|
66
|
-
},
|
|
67
|
-
filter: {
|
|
68
|
-
duration: .42,
|
|
69
|
-
ease: EASE_OUT
|
|
70
|
-
}
|
|
71
|
-
}
|
|
47
|
+
transition: SPRING_SWAP
|
|
72
48
|
},
|
|
73
49
|
exit: {
|
|
74
|
-
opacity:
|
|
75
|
-
y:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
filter: "blur(6px)",
|
|
79
|
-
transition: {
|
|
80
|
-
duration: .22,
|
|
81
|
-
ease: EASE_OUT
|
|
82
|
-
}
|
|
50
|
+
opacity: 0,
|
|
51
|
+
y: -12,
|
|
52
|
+
filter: ROLL_BLUR,
|
|
53
|
+
transition: ROLL_EXIT_TRANSITION
|
|
83
54
|
}
|
|
84
55
|
};
|
|
85
56
|
const TEXT_ROLL_VARIANTS = {
|
|
86
57
|
initial: {
|
|
87
|
-
opacity:
|
|
88
|
-
y: "
|
|
89
|
-
filter:
|
|
58
|
+
opacity: 0,
|
|
59
|
+
y: "90%",
|
|
60
|
+
filter: ROLL_BLUR
|
|
90
61
|
},
|
|
91
62
|
animate: {
|
|
92
63
|
opacity: 1,
|
|
93
64
|
y: "0%",
|
|
94
65
|
filter: "blur(0px)",
|
|
95
|
-
transition:
|
|
96
|
-
y: {
|
|
97
|
-
type: "spring",
|
|
98
|
-
stiffness: 210,
|
|
99
|
-
damping: 24,
|
|
100
|
-
mass: .85
|
|
101
|
-
},
|
|
102
|
-
opacity: {
|
|
103
|
-
duration: .3,
|
|
104
|
-
ease: EASE_OUT
|
|
105
|
-
},
|
|
106
|
-
filter: {
|
|
107
|
-
duration: .42,
|
|
108
|
-
ease: EASE_OUT
|
|
109
|
-
}
|
|
110
|
-
}
|
|
66
|
+
transition: SPRING_SWAP
|
|
111
67
|
},
|
|
112
68
|
exit: {
|
|
113
|
-
opacity:
|
|
114
|
-
y: "-
|
|
115
|
-
filter:
|
|
116
|
-
transition:
|
|
117
|
-
duration: .2,
|
|
118
|
-
ease: EASE_OUT
|
|
119
|
-
}
|
|
69
|
+
opacity: 0,
|
|
70
|
+
y: "-90%",
|
|
71
|
+
filter: ROLL_BLUR,
|
|
72
|
+
transition: ROLL_EXIT_TRANSITION
|
|
120
73
|
}
|
|
121
74
|
};
|
|
122
|
-
|
|
75
|
+
const REST = {
|
|
76
|
+
opacity: 1,
|
|
77
|
+
y: 0,
|
|
78
|
+
filter: "blur(0px)"
|
|
79
|
+
};
|
|
80
|
+
const REST_EXIT = {
|
|
81
|
+
opacity: 0,
|
|
82
|
+
transition: { duration: 0 }
|
|
83
|
+
};
|
|
84
|
+
function AnimatedBadge({ status = "neutral", size = "md", children, icon, showIcon = true, pulse = status === "loading", contentKey, className, style, ...rest }) {
|
|
123
85
|
const reduce = useReducedMotion();
|
|
86
|
+
const slotLayout = reduce ? false : "position";
|
|
124
87
|
const Icon = ICONS[status];
|
|
88
|
+
const hasLabel = children != null && typeof children !== "boolean" && children !== "";
|
|
125
89
|
const resolvedContentKey = contentKey ?? (typeof children === "string" || typeof children === "number" ? children : status);
|
|
126
90
|
return /* @__PURE__ */ jsxs(motion.span, {
|
|
127
|
-
layout:
|
|
128
|
-
transition:
|
|
129
|
-
|
|
130
|
-
stiffness: 420,
|
|
131
|
-
damping: 30,
|
|
132
|
-
mass: .7
|
|
133
|
-
},
|
|
91
|
+
layout: !reduce,
|
|
92
|
+
transition: SPRING_LAYOUT,
|
|
93
|
+
style,
|
|
134
94
|
className: cn("relative inline-flex shrink-0 items-center overflow-hidden whitespace-nowrap rounded-full border font-medium tabular-nums", "transition-colors duration-300", STATUS_CLASS[status], SIZE_CLASS[size], className),
|
|
135
95
|
...rest,
|
|
136
96
|
children: [
|
|
137
97
|
pulse && !reduce ? /* @__PURE__ */ jsx(motion.span, {
|
|
138
98
|
"aria-hidden": true,
|
|
139
|
-
className: "absolute inset-0 rounded-full bg-current
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
opacity: [
|
|
147
|
-
.08,
|
|
148
|
-
.16,
|
|
149
|
-
.08
|
|
150
|
-
]
|
|
151
|
-
},
|
|
99
|
+
className: "absolute inset-0 rounded-full bg-current",
|
|
100
|
+
initial: { opacity: .06 },
|
|
101
|
+
animate: { opacity: [
|
|
102
|
+
.06,
|
|
103
|
+
.18,
|
|
104
|
+
.06
|
|
105
|
+
] },
|
|
152
106
|
transition: {
|
|
153
107
|
duration: 1.6,
|
|
154
108
|
repeat: Infinity,
|
|
155
109
|
ease: "easeInOut"
|
|
156
110
|
}
|
|
157
111
|
}) : null,
|
|
158
|
-
showIcon ? /* @__PURE__ */ jsx(
|
|
159
|
-
|
|
112
|
+
showIcon ? /* @__PURE__ */ jsx(motion.span, {
|
|
113
|
+
layout: slotLayout,
|
|
114
|
+
transition: SPRING_LAYOUT,
|
|
115
|
+
className: "relative z-10 inline-grid shrink-0 place-items-center overflow-hidden",
|
|
160
116
|
children: /* @__PURE__ */ jsx(AnimatePresence, {
|
|
161
117
|
mode: "popLayout",
|
|
162
118
|
initial: false,
|
|
@@ -165,9 +121,9 @@ function AnimatedBadge({ status = "neutral", size = "md", children, icon, showIc
|
|
|
165
121
|
"data-badge-icon": true,
|
|
166
122
|
variants: ICON_ROLL_VARIANTS,
|
|
167
123
|
initial: reduce ? false : "initial",
|
|
168
|
-
animate: reduce ?
|
|
169
|
-
exit: reduce ?
|
|
170
|
-
className: "inline-flex
|
|
124
|
+
animate: reduce ? REST : "animate",
|
|
125
|
+
exit: reduce ? REST_EXIT : "exit",
|
|
126
|
+
className: "col-start-1 row-start-1 inline-flex items-center justify-center",
|
|
171
127
|
children: status === "loading" && !reduce && !icon ? /* @__PURE__ */ jsx(motion.span, {
|
|
172
128
|
animate: { rotate: 360 },
|
|
173
129
|
transition: {
|
|
@@ -181,8 +137,11 @@ function AnimatedBadge({ status = "neutral", size = "md", children, icon, showIc
|
|
|
181
137
|
}, status)
|
|
182
138
|
})
|
|
183
139
|
}) : null,
|
|
184
|
-
|
|
185
|
-
|
|
140
|
+
hasLabel ? /* @__PURE__ */ jsx(motion.span, {
|
|
141
|
+
layout: slotLayout,
|
|
142
|
+
transition: SPRING_LAYOUT,
|
|
143
|
+
className: "relative z-10 inline-flex",
|
|
144
|
+
style: { clipPath: "inset(0 -999px)" },
|
|
186
145
|
children: /* @__PURE__ */ jsx(AnimatePresence, {
|
|
187
146
|
mode: "popLayout",
|
|
188
147
|
initial: false,
|
|
@@ -190,9 +149,9 @@ function AnimatedBadge({ status = "neutral", size = "md", children, icon, showIc
|
|
|
190
149
|
"data-badge-label": true,
|
|
191
150
|
variants: TEXT_ROLL_VARIANTS,
|
|
192
151
|
initial: reduce ? false : "initial",
|
|
193
|
-
animate: reduce ?
|
|
194
|
-
exit: reduce ?
|
|
195
|
-
className: "inline-block
|
|
152
|
+
animate: reduce ? REST : "animate",
|
|
153
|
+
exit: reduce ? REST_EXIT : "exit",
|
|
154
|
+
className: "inline-block",
|
|
196
155
|
children
|
|
197
156
|
}, resolvedContentKey)
|
|
198
157
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animated-badge.js","names":[],"sources":["../../../src/components/motion/animated-badge.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { AlertTriangle, Check, Circle, Info, LoaderCircle, type LucideIcon, X } from \"lucide-react\";\nimport {\n AnimatePresence,\n type HTMLMotionProps,\n motion,\n useReducedMotion,\n type Variants,\n} from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT } from \"../../lib/ease\";\n\nexport type AnimatedBadgeStatus = \"neutral\" | \"info\" | \"success\" | \"warning\" | \"danger\" | \"loading\";\n\nexport type AnimatedBadgeSize = \"sm\" | \"md\";\n\nexport interface AnimatedBadgeProps extends Omit<HTMLMotionProps<\"span\">, \"children\"> {\n status?: AnimatedBadgeStatus;\n size?: AnimatedBadgeSize;\n children?: ReactNode;\n icon?: ReactNode;\n showIcon?: boolean;\n pulse?: boolean;\n contentKey?: string | number;\n}\n\nconst STATUS_CLASS: Record<AnimatedBadgeStatus, string> = {\n neutral: \"border-border bg-card text-muted-foreground\",\n info: \"border-primary/30 bg-muted text-primary\",\n success: \"border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400\",\n warning: \"border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400\",\n danger: \"border-destructive/30 bg-destructive/10 text-destructive\",\n loading: \"border-primary/30 bg-muted text-primary\",\n};\n\nconst SIZE_CLASS: Record<AnimatedBadgeSize, string> = {\n sm: \"h-6 gap-1.5 px-2 text-[11px]\",\n md: \"h-8 gap-2 px-3 text-xs\",\n};\n\nconst ICON_CLASS: Record<AnimatedBadgeSize, string> = {\n sm: \"h-3 w-3\",\n md: \"h-3.5 w-3.5\",\n};\n\nconst ICONS: Record<AnimatedBadgeStatus, LucideIcon> = {\n neutral: Circle,\n info: Info,\n success: Check,\n warning: AlertTriangle,\n danger: X,\n loading: LoaderCircle,\n};\n\
|
|
1
|
+
{"version":3,"file":"animated-badge.js","names":[],"sources":["../../../src/components/motion/animated-badge.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { AlertTriangle, Check, Circle, Info, LoaderCircle, type LucideIcon, X } from \"lucide-react\";\nimport {\n AnimatePresence,\n type HTMLMotionProps,\n motion,\n useReducedMotion,\n type Variants,\n} from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT, SPRING_LAYOUT, SPRING_SWAP } from \"../../lib/ease\";\n\nexport type AnimatedBadgeStatus = \"neutral\" | \"info\" | \"success\" | \"warning\" | \"danger\" | \"loading\";\n\nexport type AnimatedBadgeSize = \"sm\" | \"md\";\n\nexport interface AnimatedBadgeProps extends Omit<HTMLMotionProps<\"span\">, \"children\"> {\n status?: AnimatedBadgeStatus;\n size?: AnimatedBadgeSize;\n children?: ReactNode;\n icon?: ReactNode;\n showIcon?: boolean;\n pulse?: boolean;\n contentKey?: string | number;\n}\n\nconst STATUS_CLASS: Record<AnimatedBadgeStatus, string> = {\n neutral: \"border-border bg-card text-muted-foreground\",\n info: \"border-primary/30 bg-muted text-primary\",\n success: \"border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400\",\n warning: \"border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400\",\n danger: \"border-destructive/30 bg-destructive/10 text-destructive\",\n loading: \"border-primary/30 bg-muted text-primary\",\n};\n\nconst SIZE_CLASS: Record<AnimatedBadgeSize, string> = {\n sm: \"h-6 gap-1.5 px-2 text-[11px]\",\n md: \"h-8 gap-2 px-3 text-xs\",\n};\n\nconst ICON_CLASS: Record<AnimatedBadgeSize, string> = {\n sm: \"h-3 w-3\",\n md: \"h-3.5 w-3.5\",\n};\n\nconst ICONS: Record<AnimatedBadgeStatus, LucideIcon> = {\n neutral: Circle,\n info: Info,\n success: Check,\n warning: AlertTriangle,\n danger: X,\n loading: LoaderCircle,\n};\n\n// Status swaps roll like the action swap primitives: the leaving glyphs\n// slide up and out while the next ones slide in from below. Both fade from\n// fully transparent through a light blur, so the label never reads as a\n// solid smudge sitting on top of the badge, and the exit outruns the entry.\nconst ROLL_EXIT_TRANSITION = { duration: 0.14, ease: EASE_OUT } as const;\nconst ROLL_BLUR = \"blur(3px)\";\n\nconst ICON_ROLL_VARIANTS: Variants = {\n initial: { opacity: 0, y: 12, filter: ROLL_BLUR },\n animate: {\n opacity: 1,\n y: 0,\n filter: \"blur(0px)\",\n transition: SPRING_SWAP,\n },\n exit: {\n opacity: 0,\n y: -12,\n filter: ROLL_BLUR,\n transition: ROLL_EXIT_TRANSITION,\n },\n};\n\nconst TEXT_ROLL_VARIANTS: Variants = {\n initial: { opacity: 0, y: \"90%\", filter: ROLL_BLUR },\n animate: {\n opacity: 1,\n y: \"0%\",\n filter: \"blur(0px)\",\n transition: SPRING_SWAP,\n },\n exit: {\n opacity: 0,\n y: \"-90%\",\n filter: ROLL_BLUR,\n transition: ROLL_EXIT_TRANSITION,\n },\n};\n\n// Reduced motion swaps in place: the next content lands at rest and the\n// leaving content hides on its first frame instead of overlapping it.\nconst REST = { opacity: 1, y: 0, filter: \"blur(0px)\" } as const;\nconst REST_EXIT = { opacity: 0, transition: { duration: 0 } } as const;\n\nexport function AnimatedBadge({\n status = \"neutral\",\n size = \"md\",\n children,\n icon,\n showIcon = true,\n pulse = status === \"loading\",\n contentKey,\n className,\n style,\n ...rest\n}: AnimatedBadgeProps) {\n const reduce = useReducedMotion();\n // Reduced motion skips the layout projection altogether: a zero-duration\n // layout animation still paints one transformed frame.\n const slotLayout = reduce ? false : (\"position\" as const);\n const Icon = ICONS[status];\n // `0` is a real label; booleans and \"\" from conditional callers are not and\n // must not reserve the gap and an empty slot.\n const hasLabel = children != null && typeof children !== \"boolean\" && children !== \"\";\n const resolvedContentKey =\n contentKey ??\n (typeof children === \"string\" || typeof children === \"number\" ? children : status);\n\n return (\n <motion.span\n layout={!reduce}\n transition={SPRING_LAYOUT}\n style={style}\n className={cn(\n \"relative inline-flex shrink-0 items-center overflow-hidden whitespace-nowrap rounded-full border font-medium tabular-nums\",\n \"transition-colors duration-300\",\n STATUS_CLASS[status],\n SIZE_CLASS[size],\n className,\n )}\n {...rest}\n >\n {/* The pulse breathes through opacity alone. Scaling this layer would\n shrink it inside the pill and open a ring between fill and border. */}\n {pulse && !reduce ? (\n <motion.span\n aria-hidden\n className=\"absolute inset-0 rounded-full bg-current\"\n initial={{ opacity: 0.06 }}\n animate={{ opacity: [0.06, 0.18, 0.06] }}\n transition={{ duration: 1.6, repeat: Infinity, ease: \"easeInOut\" }}\n />\n ) : null}\n {/* The badge animates its width with a scale transform. Slots opt into\n position-only layout so motion counter-scales them and the glyphs\n keep their shape while the pill stretches around them. */}\n {showIcon ? (\n <motion.span\n layout={slotLayout}\n transition={SPRING_LAYOUT}\n className=\"relative z-10 inline-grid shrink-0 place-items-center overflow-hidden\"\n >\n <AnimatePresence mode=\"popLayout\" initial={false}>\n <motion.span\n key={status}\n aria-hidden\n data-badge-icon\n variants={ICON_ROLL_VARIANTS}\n initial={reduce ? false : \"initial\"}\n animate={reduce ? REST : \"animate\"}\n exit={reduce ? REST_EXIT : \"exit\"}\n className=\"col-start-1 row-start-1 inline-flex items-center justify-center\"\n >\n {status === \"loading\" && !reduce && !icon ? (\n <motion.span\n animate={{ rotate: 360 }}\n transition={{ duration: 1, repeat: Infinity, ease: \"linear\" }}\n className=\"inline-flex\"\n >\n <Icon className={ICON_CLASS[size]} />\n </motion.span>\n ) : (\n (icon ?? <Icon className={ICON_CLASS[size]} />)\n )}\n </motion.span>\n </AnimatePresence>\n </motion.span>\n ) : null}\n {hasLabel ? (\n // Clip the roll to the line box only; a longer leaving label may run\n // past the slot and is clipped by the pill instead of cut mid-glyph.\n <motion.span\n layout={slotLayout}\n transition={SPRING_LAYOUT}\n className=\"relative z-10 inline-flex\"\n style={{ clipPath: \"inset(0 -999px)\" }}\n >\n <AnimatePresence mode=\"popLayout\" initial={false}>\n <motion.span\n key={resolvedContentKey}\n data-badge-label\n variants={TEXT_ROLL_VARIANTS}\n initial={reduce ? false : \"initial\"}\n animate={reduce ? REST : \"animate\"}\n exit={reduce ? REST_EXIT : \"exit\"}\n className=\"inline-block\"\n >\n {children}\n </motion.span>\n </AnimatePresence>\n </motion.span>\n ) : null}\n </motion.span>\n );\n}\n"],"mappings":";;;;;;;AA6BA,MAAM,eAAoD;CACxD,SAAS;CACT,MAAM;CACN,SAAS;CACT,SAAS;CACT,QAAQ;CACR,SAAS;AACX;AAEA,MAAM,aAAgD;CACpD,IAAI;CACJ,IAAI;AACN;AAEA,MAAM,aAAgD;CACpD,IAAI;CACJ,IAAI;AACN;AAEA,MAAM,QAAiD;CACrD,SAAS;CACT,MAAM;CACN,SAAS;CACT,SAAS;CACT,QAAQ;CACR,SAAS;AACX;AAMA,MAAM,uBAAuB;CAAE,UAAU;CAAM,MAAM;AAAS;AAC9D,MAAM,YAAY;AAElB,MAAM,qBAA+B;CACnC,SAAS;EAAE,SAAS;EAAG,GAAG;EAAI,QAAQ;CAAU;CAChD,SAAS;EACP,SAAS;EACT,GAAG;EACH,QAAQ;EACR,YAAY;CACd;CACA,MAAM;EACJ,SAAS;EACT,GAAG;EACH,QAAQ;EACR,YAAY;CACd;AACF;AAEA,MAAM,qBAA+B;CACnC,SAAS;EAAE,SAAS;EAAG,GAAG;EAAO,QAAQ;CAAU;CACnD,SAAS;EACP,SAAS;EACT,GAAG;EACH,QAAQ;EACR,YAAY;CACd;CACA,MAAM;EACJ,SAAS;EACT,GAAG;EACH,QAAQ;EACR,YAAY;CACd;AACF;AAIA,MAAM,OAAO;CAAE,SAAS;CAAG,GAAG;CAAG,QAAQ;AAAY;AACrD,MAAM,YAAY;CAAE,SAAS;CAAG,YAAY,EAAE,UAAU,EAAE;AAAE;AAE5D,SAAgB,cAAc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ApBN,MAoBM;IACE,CAAA;GACN,CAAA,IACX;GACH,WAGC,oBAAC,OAAO,MAAR;IACE,QAAQ;IACR,YAAY;IACZ,WAAU;IACV,OAAO,EAAE,UAAU,kBAAkB;IAErC,UAAA,oBAAC,iBAAD;KAAiB,MAAK;KAAY,SAAS;KACzC,UAAA,oBAAC,OAAO,MAAR;MAEE,oBAAA;MACA,UAAU;MACV,SAAS,SAAS,QAAQ;MAC1B,SAAS,SAAS,OAAO;MACzB,MAAM,SAAS,YAAY;MAC3B,WAAU;MAET;KACU,GATN,kBASM;IACE,CAAA;GACN,CAAA,IACX;EACO;;AAEjB"}
|
|
@@ -93,4 +93,5 @@ export interface AnimatedSidebarMenuButtonProps {
|
|
|
93
93
|
}
|
|
94
94
|
export declare function AnimatedSidebarMenuButton({ children, icon, badge, href, isActive, ariaExpanded, disabled, closeOnSelect, target, rel, onSelect, className }: AnimatedSidebarMenuButtonProps): import("react").JSX.Element;
|
|
95
95
|
//#endregion
|
|
96
|
+
export {};
|
|
96
97
|
//# sourceMappingURL=animated-sidebar.d.ts.map
|
|
@@ -5,8 +5,8 @@ import { createContext, createElement, forwardRef, useCallback, useContext, useE
|
|
|
5
5
|
import { cn } from "@kumix/utils";
|
|
6
6
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
8
|
-
import { ChevronRight } from "lucide-react";
|
|
9
8
|
import { createPortal } from "react-dom";
|
|
9
|
+
import { ChevronRight } from "lucide-react";
|
|
10
10
|
//#region src/components/motion/animated-sidebar.tsx
|
|
11
11
|
const MOBILE_QUERY = "(max-width: 767px)";
|
|
12
12
|
const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
@@ -4,8 +4,8 @@ import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
|
4
4
|
import { cn } from "@kumix/utils";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
7
|
-
import { AlertCircle, Bell, Check, Info, LoaderCircle, X } from "lucide-react";
|
|
8
7
|
import { createPortal } from "react-dom";
|
|
8
|
+
import { AlertCircle, Bell, Check, Info, LoaderCircle, X } from "lucide-react";
|
|
9
9
|
//#region src/components/motion/animated-toast-stack.tsx
|
|
10
10
|
const STACK_SPRING = {
|
|
11
11
|
type: "spring",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment-upload.d.ts","names":[],"sources":["../../../src/components/motion/attachment-upload.tsx"],"mappings":";YA0BY;YACA;YACA;YAEA;EACV;EACA;EACA,MAAM;EACN;EACA;EACA;EACA;EACA;EACA,SAAS;EACT;EACA,OAAO;;YAGG;EACV;EACA;EACA;;iBAGe;EACf,QAAQ;EACR,eAAe;EACf,iBAAiB,OAAO;EACxB,gBAAgB,OAAO,wBAAwB,OAAO;EACtD,mBAAmB,OAAO,QAAQ,QAAQ;EAC1C,YAAY,MAAM;EAClB,WAAW,MAAM;EACjB;EACA,iBAAiB,MAAM;EACvB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,aAAa;;
|
|
1
|
+
{"version":3,"file":"attachment-upload.d.ts","names":[],"sources":["../../../src/components/motion/attachment-upload.tsx"],"mappings":";YA0BY;YACA;YACA;YAEA;EACV;EACA;EACA,MAAM;EACN;EACA;EACA;EACA;EACA;EACA,SAAS;EACT;EACA,OAAO;;YAGG;EACV;EACA;EACA;;iBAGe;EACf,QAAQ;EACR,eAAe;EACf,iBAAiB,OAAO;EACxB,gBAAgB,OAAO,wBAAwB,OAAO;EACtD,mBAAmB,OAAO,QAAQ,QAAQ;EAC1C,YAAY,MAAM;EAClB,WAAW,MAAM;EACjB;EACA,iBAAiB,MAAM;EACvB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,aAAa;;wBAskBC,mBACd,OACA,cACA,eACA,cACA,iBACA,UACA,SACA,WACA,eACA,QACA,UACA,UACA,aACA,UACA,OACA,aACA,kBACA,WACA,cACC,wCAAqB,IAAA"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { EASE_OUT, SPRING_LAYOUT, SPRING_PRESS } from "../../lib/ease.js";
|
|
3
|
-
import { Tooltip } from "
|
|
3
|
+
import { t as Tooltip } from "../../tooltip-Bam5KeYe.js";
|
|
4
4
|
import { t as PresenceGate } from "../../presence-gate-BekdC4Bo.js";
|
|
5
5
|
import { useCallback, useEffect, useId, useRef, useState } from "react";
|
|
6
6
|
import { cn } from "@kumix/utils";
|
|
7
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { AnimatePresence, LayoutGroup, motion, useReducedMotion } from "motion/react";
|
|
9
|
-
import { AlertCircle, Check, ExternalLink, FileImage, Link, LoaderCircle, Mic, Paperclip, Pause, Play, RotateCcw, Upload, X } from "lucide-react";
|
|
10
9
|
import { createPortal } from "react-dom";
|
|
10
|
+
import { AlertCircle, Check, ExternalLink, FileImage, Link, LoaderCircle, Mic, Paperclip, Pause, Play, RotateCcw, Upload, X } from "lucide-react";
|
|
11
11
|
//#region src/components/motion/attachment-upload.tsx
|
|
12
12
|
const ITEM_TRANSITION = {
|
|
13
13
|
duration: .2,
|
|
@@ -190,7 +190,6 @@ function ImageThumbnail({ item, layoutId, onPreview, reduce }) {
|
|
|
190
190
|
return /* @__PURE__ */ jsx(Tooltip, {
|
|
191
191
|
side: "top",
|
|
192
192
|
delay: 160,
|
|
193
|
-
wrapperClassName: "shrink-0",
|
|
194
193
|
className: "rounded-xl p-1 shadow-xl",
|
|
195
194
|
content: /* @__PURE__ */ jsxs("span", {
|
|
196
195
|
className: "block w-32",
|