@kumix/ui 0.2.4 → 0.3.1
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 +45 -10
- package/dist/components/custom/confirm-dialog.d.ts +16 -0
- package/dist/components/custom/confirm-dialog.d.ts.map +1 -0
- package/dist/components/custom/confirm-dialog.js +93 -0
- package/dist/components/custom/confirm-dialog.js.map +1 -0
- package/dist/components/custom/toast.d.ts +20 -0
- package/dist/components/custom/toast.d.ts.map +1 -0
- package/dist/components/custom/toast.js +73 -0
- package/dist/components/custom/toast.js.map +1 -0
- package/dist/components/motion/action-swap-blur.d.ts +11 -0
- package/dist/components/motion/action-swap-blur.d.ts.map +1 -0
- package/dist/components/motion/action-swap-blur.js +26 -0
- package/dist/components/motion/action-swap-blur.js.map +1 -0
- package/dist/components/motion/action-swap-cascade.d.ts +11 -0
- package/dist/components/motion/action-swap-cascade.d.ts.map +1 -0
- package/dist/components/motion/action-swap-cascade.js +26 -0
- package/dist/components/motion/action-swap-cascade.js.map +1 -0
- package/dist/components/motion/action-swap-roll.d.ts +11 -0
- package/dist/components/motion/action-swap-roll.d.ts.map +1 -0
- package/dist/components/motion/action-swap-roll.js +26 -0
- package/dist/components/motion/action-swap-roll.js.map +1 -0
- package/dist/components/motion/action-swap.d.ts +41 -0
- package/dist/components/motion/action-swap.d.ts.map +1 -0
- package/dist/components/motion/action-swap.js +261 -0
- package/dist/components/motion/action-swap.js.map +1 -0
- package/dist/components/motion/animated-badge.d.ts +18 -0
- package/dist/components/motion/animated-badge.d.ts.map +1 -0
- package/dist/components/motion/animated-badge.js +206 -0
- package/dist/components/motion/animated-badge.js.map +1 -0
- package/dist/components/motion/animated-number.d.ts +12 -0
- package/dist/components/motion/animated-number.d.ts.map +1 -0
- package/dist/components/motion/animated-number.js +47 -0
- package/dist/components/motion/animated-number.js.map +1 -0
- package/dist/components/motion/animated-sidebar.d.ts +97 -0
- package/dist/components/motion/animated-sidebar.d.ts.map +1 -0
- package/dist/components/motion/animated-sidebar.js +611 -0
- package/dist/components/motion/animated-sidebar.js.map +1 -0
- package/dist/components/motion/animated-toast-stack.d.ts +65 -0
- package/dist/components/motion/animated-toast-stack.d.ts.map +1 -0
- package/dist/components/motion/animated-toast-stack.js +303 -0
- package/dist/components/motion/animated-toast-stack.js.map +1 -0
- package/dist/components/motion/attachment-upload.d.ts +47 -0
- package/dist/components/motion/attachment-upload.d.ts.map +1 -0
- package/dist/components/motion/attachment-upload.js +737 -0
- package/dist/components/motion/attachment-upload.js.map +1 -0
- package/dist/components/motion/availability-scheduler/copy-menu.d.ts +10 -0
- package/dist/components/motion/availability-scheduler/copy-menu.d.ts.map +1 -0
- package/dist/components/motion/availability-scheduler/copy-menu.js +3 -0
- package/dist/components/motion/availability-scheduler/day-row.d.ts +15 -0
- package/dist/components/motion/availability-scheduler/day-row.d.ts.map +1 -0
- package/dist/components/motion/availability-scheduler/day-row.js +181 -0
- package/dist/components/motion/availability-scheduler/day-row.js.map +1 -0
- package/dist/components/motion/availability-scheduler/icon-button.d.ts +15 -0
- package/dist/components/motion/availability-scheduler/icon-button.d.ts.map +1 -0
- package/dist/components/motion/availability-scheduler/icon-button.js +24 -0
- package/dist/components/motion/availability-scheduler/icon-button.js.map +1 -0
- package/dist/components/motion/availability-scheduler/index.d.ts +14 -0
- package/dist/components/motion/availability-scheduler/index.d.ts.map +1 -0
- package/dist/components/motion/availability-scheduler/index.js +59 -0
- package/dist/components/motion/availability-scheduler/index.js.map +1 -0
- package/dist/components/motion/availability-scheduler/time-select.d.ts +10 -0
- package/dist/components/motion/availability-scheduler/time-select.d.ts.map +1 -0
- package/dist/components/motion/availability-scheduler/time-select.js +26 -0
- package/dist/components/motion/availability-scheduler/time-select.js.map +1 -0
- package/dist/components/motion/bloom-menu.d.ts +17 -0
- package/dist/components/motion/bloom-menu.d.ts.map +1 -0
- package/dist/components/motion/bloom-menu.js +170 -0
- package/dist/components/motion/bloom-menu.js.map +1 -0
- package/dist/components/motion/bottom-sheet.d.ts +19 -0
- package/dist/components/motion/bottom-sheet.d.ts.map +1 -0
- package/dist/components/motion/bottom-sheet.js +146 -0
- package/dist/components/motion/bottom-sheet.js.map +1 -0
- package/dist/components/motion/bounce-sidebar.d.ts +26 -0
- package/dist/components/motion/bounce-sidebar.d.ts.map +1 -0
- package/dist/components/motion/bounce-sidebar.js +164 -0
- package/dist/components/motion/bounce-sidebar.js.map +1 -0
- package/dist/components/motion/bouncy-accordion.d.ts +32 -0
- package/dist/components/motion/bouncy-accordion.d.ts.map +1 -0
- package/dist/components/motion/bouncy-accordion.js +172 -0
- package/dist/components/motion/bouncy-accordion.js.map +1 -0
- package/dist/components/motion/button/base.d.ts +17 -0
- package/dist/components/motion/button/base.d.ts.map +1 -0
- package/dist/components/motion/button/base.js +86 -0
- package/dist/components/motion/button/base.js.map +1 -0
- package/dist/components/motion/button/index.d.ts +4 -0
- package/dist/components/motion/button/index.js +5 -0
- package/dist/components/motion/button/magnetic.d.ts +12 -0
- package/dist/components/motion/button/magnetic.d.ts.map +1 -0
- package/dist/components/motion/button/magnetic.js +21 -0
- package/dist/components/motion/button/magnetic.js.map +1 -0
- package/dist/components/motion/button/stateful.d.ts +16 -0
- package/dist/components/motion/button/stateful.d.ts.map +1 -0
- package/dist/components/motion/button/stateful.js +190 -0
- package/dist/components/motion/button/stateful.js.map +1 -0
- package/dist/components/motion/center-morph-modal.d.ts +43 -0
- package/dist/components/motion/center-morph-modal.d.ts.map +1 -0
- package/dist/components/motion/center-morph-modal.js +238 -0
- package/dist/components/motion/center-morph-modal.js.map +1 -0
- package/dist/components/motion/checkbox.d.ts +15 -0
- package/dist/components/motion/checkbox.d.ts.map +1 -0
- package/dist/components/motion/checkbox.js +81 -0
- package/dist/components/motion/checkbox.js.map +1 -0
- package/dist/components/motion/chromatic-text-reveal.d.ts +31 -0
- package/dist/components/motion/chromatic-text-reveal.d.ts.map +1 -0
- package/dist/components/motion/chromatic-text-reveal.js +132 -0
- package/dist/components/motion/chromatic-text-reveal.js.map +1 -0
- package/dist/components/motion/command-palette.d.ts +26 -0
- package/dist/components/motion/command-palette.d.ts.map +1 -0
- package/dist/components/motion/command-palette.js +246 -0
- package/dist/components/motion/command-palette.js.map +1 -0
- package/dist/components/motion/context-menu.d.ts +71 -0
- package/dist/components/motion/context-menu.d.ts.map +1 -0
- package/dist/components/motion/context-menu.js +454 -0
- package/dist/components/motion/context-menu.js.map +1 -0
- package/dist/components/motion/cylinder-carousel.d.ts +40 -0
- package/dist/components/motion/cylinder-carousel.d.ts.map +1 -0
- package/dist/components/motion/cylinder-carousel.js +274 -0
- package/dist/components/motion/cylinder-carousel.js.map +1 -0
- package/dist/components/motion/dock.d.ts +24 -0
- package/dist/components/motion/dock.d.ts.map +1 -0
- package/dist/components/motion/dock.js +62 -0
- package/dist/components/motion/dock.js.map +1 -0
- package/dist/components/motion/drawer.d.ts +19 -0
- package/dist/components/motion/drawer.d.ts.map +1 -0
- package/dist/components/motion/drawer.js +58 -0
- package/dist/components/motion/drawer.js.map +1 -0
- package/dist/components/motion/dynamic-island.d.ts +22 -0
- package/dist/components/motion/dynamic-island.d.ts.map +1 -0
- package/dist/components/motion/dynamic-island.js +143 -0
- package/dist/components/motion/dynamic-island.js.map +1 -0
- package/dist/components/motion/expandable-action-bar.d.ts +52 -0
- package/dist/components/motion/expandable-action-bar.d.ts.map +1 -0
- package/dist/components/motion/expandable-action-bar.js +191 -0
- package/dist/components/motion/expandable-action-bar.js.map +1 -0
- package/dist/components/motion/expandable-tabs.d.ts +33 -0
- package/dist/components/motion/expandable-tabs.d.ts.map +1 -0
- package/dist/components/motion/expandable-tabs.js +291 -0
- package/dist/components/motion/expandable-tabs.js.map +1 -0
- package/dist/components/motion/feedback-widget.d.ts +18 -0
- package/dist/components/motion/feedback-widget.d.ts.map +1 -0
- package/dist/components/motion/feedback-widget.js +413 -0
- package/dist/components/motion/feedback-widget.js.map +1 -0
- package/dist/components/motion/file-upload.d.ts +48 -0
- package/dist/components/motion/file-upload.d.ts.map +1 -0
- package/dist/components/motion/file-upload.js +382 -0
- package/dist/components/motion/file-upload.js.map +1 -0
- package/dist/components/motion/hold-action-button.d.ts +17 -0
- package/dist/components/motion/hold-action-button.d.ts.map +1 -0
- package/dist/components/motion/hold-action-button.js +158 -0
- package/dist/components/motion/hold-action-button.js.map +1 -0
- package/dist/components/motion/infinite-masonry.d.ts +31 -0
- package/dist/components/motion/infinite-masonry.d.ts.map +1 -0
- package/dist/components/motion/infinite-masonry.js +223 -0
- package/dist/components/motion/infinite-masonry.js.map +1 -0
- package/dist/components/motion/input.d.ts +29 -0
- package/dist/components/motion/input.d.ts.map +1 -0
- package/dist/components/motion/input.js +126 -0
- package/dist/components/motion/input.js.map +1 -0
- package/dist/components/motion/loader.d.ts +17 -0
- package/dist/components/motion/loader.d.ts.map +1 -0
- package/dist/components/motion/loader.js +791 -0
- package/dist/components/motion/loader.js.map +1 -0
- package/dist/components/motion/magnetic.d.ts +11 -0
- package/dist/components/motion/magnetic.d.ts.map +1 -0
- package/dist/components/motion/magnetic.js +44 -0
- package/dist/components/motion/magnetic.js.map +1 -0
- package/dist/components/motion/marquee.d.ts +15 -0
- package/dist/components/motion/marquee.d.ts.map +1 -0
- package/dist/components/motion/marquee.js +35 -0
- package/dist/components/motion/marquee.js.map +1 -0
- package/dist/components/motion/morphing-modal.d.ts +15 -0
- package/dist/components/motion/morphing-modal.d.ts.map +1 -0
- package/dist/components/motion/morphing-modal.js +117 -0
- package/dist/components/motion/morphing-modal.js.map +1 -0
- package/dist/components/motion/not-found/glitch.d.ts +6 -0
- package/dist/components/motion/not-found/glitch.d.ts.map +1 -0
- package/dist/components/motion/not-found/glitch.js +90 -0
- package/dist/components/motion/not-found/glitch.js.map +1 -0
- package/dist/components/motion/not-found/magnetic.d.ts +6 -0
- package/dist/components/motion/not-found/magnetic.d.ts.map +1 -0
- package/dist/components/motion/not-found/magnetic.js +47 -0
- package/dist/components/motion/not-found/magnetic.js.map +1 -0
- package/dist/components/motion/not-found/shared.d.ts +32 -0
- package/dist/components/motion/not-found/shared.d.ts.map +1 -0
- package/dist/components/motion/not-found/shared.js +52 -0
- package/dist/components/motion/not-found/shared.js.map +1 -0
- package/dist/components/motion/not-found/spotlight.d.ts +6 -0
- package/dist/components/motion/not-found/spotlight.d.ts.map +1 -0
- package/dist/components/motion/not-found/spotlight.js +70 -0
- package/dist/components/motion/not-found/spotlight.js.map +1 -0
- package/dist/components/motion/not-found/stacked.d.ts +6 -0
- package/dist/components/motion/not-found/stacked.d.ts.map +1 -0
- package/dist/components/motion/not-found/stacked.js +95 -0
- package/dist/components/motion/not-found/stacked.js.map +1 -0
- package/dist/components/motion/not-found/terminal.d.ts +6 -0
- package/dist/components/motion/not-found/terminal.d.ts.map +1 -0
- package/dist/components/motion/not-found/terminal.js +90 -0
- package/dist/components/motion/not-found/terminal.js.map +1 -0
- package/dist/components/motion/notification-stack.d.ts +35 -0
- package/dist/components/motion/notification-stack.d.ts.map +1 -0
- package/dist/components/motion/notification-stack.js +187 -0
- package/dist/components/motion/notification-stack.js.map +1 -0
- package/dist/components/motion/number-ticker.d.ts +26 -0
- package/dist/components/motion/number-ticker.d.ts.map +1 -0
- package/dist/components/motion/number-ticker.js +129 -0
- package/dist/components/motion/number-ticker.js.map +1 -0
- package/dist/components/motion/otp-input.d.ts +32 -0
- package/dist/components/motion/otp-input.d.ts.map +1 -0
- package/dist/components/motion/otp-input.js +272 -0
- package/dist/components/motion/otp-input.js.map +1 -0
- package/dist/components/motion/overflow-actions.d.ts +39 -0
- package/dist/components/motion/overflow-actions.d.ts.map +1 -0
- package/dist/components/motion/overflow-actions.js +220 -0
- package/dist/components/motion/overflow-actions.js.map +1 -0
- package/dist/components/motion/parallax.d.ts +21 -0
- package/dist/components/motion/parallax.d.ts.map +1 -0
- package/dist/components/motion/parallax.js +35 -0
- package/dist/components/motion/parallax.js.map +1 -0
- package/dist/components/motion/popover-morph.d.ts +38 -0
- package/dist/components/motion/popover-morph.d.ts.map +1 -0
- package/dist/components/motion/popover-morph.js +167 -0
- package/dist/components/motion/popover-morph.js.map +1 -0
- package/dist/components/motion/popover.d.ts +40 -0
- package/dist/components/motion/popover.d.ts.map +1 -0
- package/dist/components/motion/popover.js +393 -0
- package/dist/components/motion/popover.js.map +1 -0
- package/dist/components/motion/preview-rail.d.ts +26 -0
- package/dist/components/motion/preview-rail.d.ts.map +1 -0
- package/dist/components/motion/preview-rail.js +134 -0
- package/dist/components/motion/preview-rail.js.map +1 -0
- package/dist/components/motion/pull-to-refresh.d.ts +28 -0
- package/dist/components/motion/pull-to-refresh.d.ts.map +1 -0
- package/dist/components/motion/pull-to-refresh.js +389 -0
- package/dist/components/motion/pull-to-refresh.js.map +1 -0
- package/dist/components/motion/radio.d.ts +22 -0
- package/dist/components/motion/radio.d.ts.map +1 -0
- package/dist/components/motion/radio.js +79 -0
- package/dist/components/motion/radio.js.map +1 -0
- package/dist/components/motion/range-slider-bubble.d.ts +16 -0
- package/dist/components/motion/range-slider-bubble.d.ts.map +1 -0
- package/dist/components/motion/range-slider-bubble.js +117 -0
- package/dist/components/motion/range-slider-bubble.js.map +1 -0
- package/dist/components/motion/range-slider-fluid.d.ts +18 -0
- package/dist/components/motion/range-slider-fluid.d.ts.map +1 -0
- package/dist/components/motion/range-slider-fluid.js +63 -0
- package/dist/components/motion/range-slider-fluid.js.map +1 -0
- package/dist/components/motion/range-slider-ruler.d.ts +19 -0
- package/dist/components/motion/range-slider-ruler.d.ts.map +1 -0
- package/dist/components/motion/range-slider-ruler.js +142 -0
- package/dist/components/motion/range-slider-ruler.js.map +1 -0
- package/dist/components/motion/range-slider-wave.d.ts +16 -0
- package/dist/components/motion/range-slider-wave.d.ts.map +1 -0
- package/dist/components/motion/range-slider-wave.js +57 -0
- package/dist/components/motion/range-slider-wave.js.map +1 -0
- package/dist/components/motion/range-slider.d.ts +11 -0
- package/dist/components/motion/range-slider.d.ts.map +1 -0
- package/dist/components/motion/range-slider.js +63 -0
- package/dist/components/motion/range-slider.js.map +1 -0
- package/dist/components/motion/scroll-progress.d.ts +29 -0
- package/dist/components/motion/scroll-progress.d.ts.map +1 -0
- package/dist/components/motion/scroll-progress.js +71 -0
- package/dist/components/motion/scroll-progress.js.map +1 -0
- package/dist/components/motion/scroll-reveal.d.ts +23 -0
- package/dist/components/motion/scroll-reveal.d.ts.map +1 -0
- package/dist/components/motion/scroll-reveal.js +42 -0
- package/dist/components/motion/scroll-reveal.js.map +1 -0
- package/dist/components/motion/scroll-to.d.ts +21 -0
- package/dist/components/motion/scroll-to.d.ts.map +1 -0
- package/dist/components/motion/scroll-to.js +27 -0
- package/dist/components/motion/scroll-to.js.map +1 -0
- package/dist/components/motion/select-morph.d.ts +41 -0
- package/dist/components/motion/select-morph.d.ts.map +1 -0
- package/dist/components/motion/select-morph.js +251 -0
- package/dist/components/motion/select-morph.js.map +1 -0
- package/dist/components/motion/select.d.ts +36 -0
- package/dist/components/motion/select.d.ts.map +1 -0
- package/dist/components/motion/select.js +319 -0
- package/dist/components/motion/select.js.map +1 -0
- package/dist/components/motion/shader-background.d.ts +38 -0
- package/dist/components/motion/shader-background.d.ts.map +1 -0
- package/dist/components/motion/shader-background.js +49 -0
- package/dist/components/motion/shader-background.js.map +1 -0
- package/dist/components/motion/shared-layout-bg.d.ts +17 -0
- package/dist/components/motion/shared-layout-bg.d.ts.map +1 -0
- package/dist/components/motion/shared-layout-bg.js +88 -0
- package/dist/components/motion/shared-layout-bg.js.map +1 -0
- package/dist/components/motion/slide-action-button.d.ts +15 -0
- package/dist/components/motion/slide-action-button.d.ts.map +1 -0
- package/dist/components/motion/slide-action-button.js +146 -0
- package/dist/components/motion/slide-action-button.js.map +1 -0
- package/dist/components/motion/smooth-scroll.d.ts +47 -0
- package/dist/components/motion/smooth-scroll.d.ts.map +1 -0
- package/dist/components/motion/smooth-scroll.js +182 -0
- package/dist/components/motion/smooth-scroll.js.map +1 -0
- package/dist/components/motion/swipeable-list.d.ts +60 -0
- package/dist/components/motion/swipeable-list.d.ts.map +1 -0
- package/dist/components/motion/swipeable-list.js +254 -0
- package/dist/components/motion/swipeable-list.js.map +1 -0
- package/dist/components/motion/switch.d.ts +13 -0
- package/dist/components/motion/switch.d.ts.map +1 -0
- package/dist/components/motion/switch.js +76 -0
- package/dist/components/motion/switch.js.map +1 -0
- package/dist/components/motion/table/editable-cell.d.ts +9 -0
- package/dist/components/motion/table/editable-cell.d.ts.map +1 -0
- package/dist/components/motion/table/editable-cell.js +17 -0
- package/dist/components/motion/table/editable-cell.js.map +1 -0
- package/dist/components/motion/table/index.d.ts +6 -0
- package/dist/components/motion/table/index.d.ts.map +1 -0
- package/dist/components/motion/table/index.js +420 -0
- package/dist/components/motion/table/index.js.map +1 -0
- package/dist/components/motion/table/row-handle.d.ts +15 -0
- package/dist/components/motion/table/row-handle.d.ts.map +1 -0
- package/dist/components/motion/table/row-handle.js +51 -0
- package/dist/components/motion/table/row-handle.js.map +1 -0
- package/dist/components/motion/table/skeleton-rows.d.ts +11 -0
- package/dist/components/motion/table/skeleton-rows.d.ts.map +1 -0
- package/dist/components/motion/table/skeleton-rows.js +23 -0
- package/dist/components/motion/table/skeleton-rows.js.map +1 -0
- package/dist/components/motion/table/table-header.d.ts +35 -0
- package/dist/components/motion/table/table-header.d.ts.map +1 -0
- package/dist/components/motion/table/table-header.js +167 -0
- package/dist/components/motion/table/table-header.js.map +1 -0
- package/dist/components/motion/table/table-menu.d.ts +17 -0
- package/dist/components/motion/table/table-menu.d.ts.map +1 -0
- package/dist/components/motion/table/table-menu.js +92 -0
- package/dist/components/motion/table/table-menu.js.map +1 -0
- package/dist/components/motion/tabs.d.ts +29 -0
- package/dist/components/motion/tabs.d.ts.map +1 -0
- package/dist/components/motion/tabs.js +125 -0
- package/dist/components/motion/tabs.js.map +1 -0
- package/dist/components/motion/text-cascade.d.ts +15 -0
- package/dist/components/motion/text-cascade.d.ts.map +1 -0
- package/dist/components/motion/text-cascade.js +21 -0
- package/dist/components/motion/text-cascade.js.map +1 -0
- package/dist/components/motion/text-reveal.d.ts +25 -0
- package/dist/components/motion/text-reveal.d.ts.map +1 -0
- package/dist/components/motion/text-reveal.js +94 -0
- package/dist/components/motion/text-reveal.js.map +1 -0
- package/dist/components/motion/text-shimmer.d.ts +12 -0
- package/dist/components/motion/text-shimmer.d.ts.map +1 -0
- package/dist/components/motion/text-shimmer.js +15 -0
- package/dist/components/motion/text-shimmer.js.map +1 -0
- package/dist/components/motion/theme-toggle.d.ts +23 -0
- package/dist/components/motion/theme-toggle.d.ts.map +1 -0
- package/dist/components/motion/theme-toggle.js +160 -0
- package/dist/components/motion/theme-toggle.js.map +1 -0
- package/dist/components/motion/tilt-card.d.ts +12 -0
- package/dist/components/motion/tilt-card.d.ts.map +1 -0
- package/dist/components/motion/tilt-card.js +56 -0
- package/dist/components/motion/tilt-card.js.map +1 -0
- package/dist/components/motion/tooltip.d.ts +17 -0
- package/dist/components/motion/tooltip.d.ts.map +1 -0
- package/dist/components/motion/tooltip.js +194 -0
- package/dist/components/motion/tooltip.js.map +1 -0
- package/dist/components/motion/wheel-picker.d.ts +24 -0
- package/dist/components/motion/wheel-picker.d.ts.map +1 -0
- package/dist/components/motion/wheel-picker.js +442 -0
- package/dist/components/motion/wheel-picker.js.map +1 -0
- package/dist/components/reui/alert.d.ts +1 -1
- package/dist/components/reui/autocomplete.js +1 -1
- package/dist/components/reui/badge.d.ts +2 -2
- package/dist/components/reui/badge.js +10 -9
- package/dist/components/reui/badge.js.map +1 -1
- package/dist/components/reui/data-grid/data-grid-column-filter.js +2 -2
- package/dist/components/reui/data-grid/data-grid-column-header.js +1 -1
- package/dist/components/reui/data-grid/data-grid-pagination.js +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd.js +22 -20
- 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 +1 -1
- package/dist/components/reui/data-grid/data-grid-table-virtual.js +1 -1
- package/dist/components/reui/data-grid/data-grid-table.js +5 -3
- package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
- package/dist/components/reui/date-selector.js +2 -2
- package/dist/components/reui/event-calendar/event-calendar-agenda-view.js +3 -2
- package/dist/components/reui/event-calendar/event-calendar-agenda-view.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-content.js +8 -7
- package/dist/components/reui/event-calendar/event-calendar-content.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-dnd.js +7 -4
- package/dist/components/reui/event-calendar/event-calendar-dnd.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-event.js +50 -48
- package/dist/components/reui/event-calendar/event-calendar-event.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-lib.js +3 -2
- package/dist/components/reui/event-calendar/event-calendar-lib.js.map +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 +38 -32
- package/dist/components/reui/event-calendar/event-calendar-nav.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-time-grid.js +2 -1
- package/dist/components/reui/event-calendar/event-calendar-time-grid.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar.js +2 -1
- package/dist/components/reui/event-calendar/event-calendar.js.map +1 -1
- package/dist/components/reui/filters.js +6 -4
- package/dist/components/reui/filters.js.map +1 -1
- package/dist/components/reui/frame.d.ts +1 -1
- package/dist/components/reui/gantt/gantt-bar.js +53 -52
- package/dist/components/reui/gantt/gantt-bar.js.map +1 -1
- package/dist/components/reui/gantt/gantt-lib.js +3 -2
- package/dist/components/reui/gantt/gantt-lib.js.map +1 -1
- package/dist/components/reui/gantt/gantt-nav.js +35 -31
- package/dist/components/reui/gantt/gantt-nav.js.map +1 -1
- package/dist/components/reui/gantt/gantt-recurrence.js +2 -2
- package/dist/components/reui/gantt/gantt-recurrence.js.map +1 -1
- package/dist/components/reui/gantt/gantt-view.js +177 -173
- package/dist/components/reui/gantt/gantt-view.js.map +1 -1
- package/dist/components/reui/icon-tile.d.ts +1 -1
- package/dist/components/reui/icon-tile.js +12 -11
- package/dist/components/reui/icon-tile.js.map +1 -1
- package/dist/components/reui/kanban.js +42 -37
- 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 +2 -2
- package/dist/components/reui/rating.js +1 -1
- package/dist/components/reui/sortable.js +10 -9
- package/dist/components/reui/sortable.js.map +1 -1
- package/dist/components/reui/stepper.js +16 -16
- package/dist/components/reui/stepper.js.map +1 -1
- package/dist/components/reui/timeline.js +45 -38
- package/dist/components/reui/timeline.js.map +1 -1
- package/dist/components/reui/tree.js +3 -2
- package/dist/components/reui/tree.js.map +1 -1
- package/dist/components/ui/accordion.js +1 -1
- package/dist/components/ui/alert-dialog.js +1 -1
- package/dist/components/ui/attachment.d.ts +2 -2
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/breadcrumb.js +1 -1
- package/dist/components/ui/bubble.d.ts +1 -1
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button.d.ts +3 -3
- 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.d.ts +1 -1
- package/dist/components/ui/field.d.ts +1 -1
- package/dist/components/ui/input-otp.js +1 -1
- package/dist/components/ui/item.d.ts +1 -1
- package/dist/components/ui/marker.d.ts +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/select.js +1 -1
- package/dist/components/ui/sheet.js +1 -1
- package/dist/components/ui/sidebar.js +2 -2
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/sonner.js +1 -1
- package/dist/components/ui/spinner.js +1 -1
- package/dist/components/ui/toast.js +1 -1
- package/dist/copy-menu-BJ-MXnkN.js +201 -0
- package/dist/copy-menu-BJ-MXnkN.js.map +1 -0
- package/dist/hooks/use-hover-capable.d.ts +10 -0
- package/dist/hooks/use-hover-capable.d.ts.map +1 -0
- package/dist/hooks/use-hover-capable.js +24 -0
- package/dist/hooks/use-hover-capable.js.map +1 -0
- package/dist/hooks/use-mobile.js +1 -1
- package/dist/hooks/use-mobile.js.map +1 -1
- package/dist/hooks/use-slider.d.ts +58 -0
- package/dist/hooks/use-slider.d.ts.map +1 -0
- package/dist/hooks/use-slider.js +133 -0
- package/dist/hooks/use-slider.js.map +1 -0
- package/dist/lib/ease.d.ts +50 -0
- package/dist/lib/ease.d.ts.map +1 -0
- package/dist/lib/ease.js +66 -0
- package/dist/lib/ease.js.map +1 -0
- package/dist/lib/tick-sound.d.ts +17 -0
- package/dist/lib/tick-sound.d.ts.map +1 -0
- package/dist/lib/tick-sound.js +120 -0
- package/dist/lib/tick-sound.js.map +1 -0
- package/dist/popover-position-BUqYCq8X.js +54 -0
- package/dist/popover-position-BUqYCq8X.js.map +1 -0
- package/dist/types-Bah5NY44.d.ts +81 -0
- package/dist/types-Bah5NY44.d.ts.map +1 -0
- package/dist/types-smkWN_7x.d.ts +20 -0
- package/dist/types-smkWN_7x.d.ts.map +1 -0
- package/dist/utils-DQ7OpbYQ.js +25 -0
- package/dist/utils-DQ7OpbYQ.js.map +1 -0
- package/package.json +17 -6
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { EASE_OUT } from "../../lib/ease.js";
|
|
3
|
+
import { createContext, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { cn } from "@kumix/utils";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
7
|
+
//#region src/components/motion/dynamic-island.tsx
|
|
8
|
+
const IslandContext = createContext(null);
|
|
9
|
+
const SHELL_SPRING = {
|
|
10
|
+
type: "spring",
|
|
11
|
+
duration: .8,
|
|
12
|
+
bounce: .2
|
|
13
|
+
};
|
|
14
|
+
const CONTENT_SPRING = {
|
|
15
|
+
type: "spring",
|
|
16
|
+
duration: .8,
|
|
17
|
+
bounce: .35
|
|
18
|
+
};
|
|
19
|
+
const RADIUS = 32;
|
|
20
|
+
const PILL_WIDTH = 126;
|
|
21
|
+
const PILL_HEIGHT = 37;
|
|
22
|
+
/** Tracks the natural size of the content so the shell can spring to it. */
|
|
23
|
+
function useContentSize() {
|
|
24
|
+
const ref = useRef(null);
|
|
25
|
+
const [size, setSize] = useState(null);
|
|
26
|
+
useLayoutEffect(() => {
|
|
27
|
+
const el = ref.current;
|
|
28
|
+
if (!el) return;
|
|
29
|
+
setSize({
|
|
30
|
+
width: el.offsetWidth,
|
|
31
|
+
height: el.offsetHeight
|
|
32
|
+
});
|
|
33
|
+
}, []);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
const el = ref.current;
|
|
36
|
+
if (!el || typeof ResizeObserver === "undefined") return;
|
|
37
|
+
const observer = new ResizeObserver(() => {
|
|
38
|
+
setSize({
|
|
39
|
+
width: el.offsetWidth,
|
|
40
|
+
height: el.offsetHeight
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
observer.observe(el);
|
|
44
|
+
return () => observer.disconnect();
|
|
45
|
+
}, []);
|
|
46
|
+
return [ref, size];
|
|
47
|
+
}
|
|
48
|
+
function Slot({ keyId, children, className }) {
|
|
49
|
+
const reduce = useReducedMotion();
|
|
50
|
+
return /* @__PURE__ */ jsx(motion.div, {
|
|
51
|
+
initial: reduce ? {
|
|
52
|
+
opacity: 0,
|
|
53
|
+
filter: "blur(0px)"
|
|
54
|
+
} : {
|
|
55
|
+
opacity: 0,
|
|
56
|
+
scale: .9,
|
|
57
|
+
y: -8,
|
|
58
|
+
filter: "blur(5px)"
|
|
59
|
+
},
|
|
60
|
+
animate: reduce ? {
|
|
61
|
+
opacity: 1,
|
|
62
|
+
filter: "blur(0px)"
|
|
63
|
+
} : {
|
|
64
|
+
opacity: 1,
|
|
65
|
+
scale: 1,
|
|
66
|
+
y: 0,
|
|
67
|
+
filter: "blur(0px)"
|
|
68
|
+
},
|
|
69
|
+
exit: reduce ? {
|
|
70
|
+
opacity: 0,
|
|
71
|
+
filter: "blur(0px)",
|
|
72
|
+
transition: { duration: .1 }
|
|
73
|
+
} : {
|
|
74
|
+
opacity: 0,
|
|
75
|
+
scale: .9,
|
|
76
|
+
y: -6,
|
|
77
|
+
filter: "blur(0px)",
|
|
78
|
+
transition: {
|
|
79
|
+
duration: .08,
|
|
80
|
+
ease: EASE_OUT
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
transition: reduce ? { duration: .15 } : CONTENT_SPRING,
|
|
84
|
+
style: { transformOrigin: "top center" },
|
|
85
|
+
className: cn("flex items-center justify-center", className),
|
|
86
|
+
children
|
|
87
|
+
}, keyId);
|
|
88
|
+
}
|
|
89
|
+
function DynamicIsland({ view, compact, children, className }) {
|
|
90
|
+
const reduce = useReducedMotion();
|
|
91
|
+
const expanded = view !== null;
|
|
92
|
+
const [sizerRef, size] = useContentSize();
|
|
93
|
+
const contextValue = useMemo(() => ({ view }), [view]);
|
|
94
|
+
return /* @__PURE__ */ jsx(IslandContext.Provider, {
|
|
95
|
+
value: contextValue,
|
|
96
|
+
children: /* @__PURE__ */ jsx(motion.div, {
|
|
97
|
+
role: "status",
|
|
98
|
+
"aria-live": "polite",
|
|
99
|
+
initial: false,
|
|
100
|
+
animate: size ? {
|
|
101
|
+
width: size.width,
|
|
102
|
+
height: size.height
|
|
103
|
+
} : {
|
|
104
|
+
width: PILL_WIDTH,
|
|
105
|
+
height: PILL_HEIGHT
|
|
106
|
+
},
|
|
107
|
+
transition: reduce ? { duration: 0 } : SHELL_SPRING,
|
|
108
|
+
style: { borderRadius: RADIUS },
|
|
109
|
+
className: cn("relative inline-flex items-start justify-center overflow-hidden", "bg-foreground text-background shadow-2xl", className),
|
|
110
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
111
|
+
ref: sizerRef,
|
|
112
|
+
className: "w-max",
|
|
113
|
+
children: [/* @__PURE__ */ jsx(AnimatePresence, {
|
|
114
|
+
mode: "popLayout",
|
|
115
|
+
initial: false,
|
|
116
|
+
children: !expanded && compact ? /* @__PURE__ */ jsx(Slot, {
|
|
117
|
+
keyId: "compact",
|
|
118
|
+
className: "min-h-[37px] min-w-[126px] gap-2 px-4 py-1.5 font-medium text-xs",
|
|
119
|
+
children: compact
|
|
120
|
+
}) : null
|
|
121
|
+
}), children]
|
|
122
|
+
})
|
|
123
|
+
})
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function DynamicIslandView({ id, children, className }) {
|
|
127
|
+
const ctx = useContext(IslandContext);
|
|
128
|
+
if (!ctx) throw new Error("DynamicIslandView must be used inside <DynamicIsland>");
|
|
129
|
+
const active = ctx.view === id;
|
|
130
|
+
return /* @__PURE__ */ jsx(AnimatePresence, {
|
|
131
|
+
mode: "popLayout",
|
|
132
|
+
initial: false,
|
|
133
|
+
children: active ? /* @__PURE__ */ jsx(Slot, {
|
|
134
|
+
keyId: id,
|
|
135
|
+
className: cn("px-6 py-4", className),
|
|
136
|
+
children
|
|
137
|
+
}) : null
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
//#endregion
|
|
141
|
+
export { DynamicIsland, DynamicIslandView };
|
|
142
|
+
|
|
143
|
+
//# sourceMappingURL=dynamic-island.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamic-island.js","names":[],"sources":["../../../src/components/motion/dynamic-island.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n createContext,\n type ReactNode,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT } from \"../../lib/ease\";\n\ntype IslandContextValue = {\n view: string | null;\n};\n\nconst IslandContext = createContext<IslandContextValue | null>(null);\n\n// Shell physics in Apple's duration/bounce form one long perceptual glide with barely-there bounce, identical in\n// both directions. The shell animates real width/height (not transforms), so\n// slots are never scale-distorted.\nconst SHELL_SPRING = {\n type: \"spring\",\n duration: 0.8,\n bounce: 0.2,\n} as const;\n\n// Content gets a touch more life than the shell.\nconst CONTENT_SPRING = {\n type: \"spring\",\n duration: 0.8,\n bounce: 0.35,\n} as const;\n\n// Constant radius — never animated. The browser clamps it to half the shell\n// height, so the pill-to-rounded-rect morph falls out of the resize for free\n// with zero chance of corner glitches.\nconst RADIUS = 32;\n\n// iPhone pill dimensions. Also the shell's pre-measure animate target: if the\n// first commit already has a view active (e.g. a click replayed after\n// hydration), the shell blooms from the pill instead of rendering expanded\n// with no animation. Lives in `animate`, not `initial`, so server and client\n// markup agree.\nconst PILL_WIDTH = 126;\nconst PILL_HEIGHT = 37;\n\n/** Tracks the natural size of the content so the shell can spring to it. */\nfunction useContentSize() {\n const ref = useRef<HTMLDivElement | null>(null);\n const [size, setSize] = useState<{ width: number; height: number } | null>(null);\n\n // Synchronous mount measure: the shell must own explicit dimensions before\n // the first interaction. ResizeObserver fires async after mount — a quick\n // first press could beat it, leaving the shell auto-sized so the view\n // snapped open instead of springing.\n useLayoutEffect(() => {\n const el = ref.current;\n if (!el) return;\n setSize({ width: el.offsetWidth, height: el.offsetHeight });\n }, []);\n\n useEffect(() => {\n const el = ref.current;\n if (!el || typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(() => {\n setSize({ width: el.offsetWidth, height: el.offsetHeight });\n });\n observer.observe(el);\n return () => observer.disconnect();\n }, []);\n\n return [ref, size] as const;\n}\n\nfunction Slot({\n keyId,\n children,\n className,\n}: {\n keyId: string;\n children: ReactNode;\n className?: string;\n}) {\n const reduce = useReducedMotion();\n return (\n <motion.div\n key={keyId}\n initial={\n reduce\n ? { opacity: 0, filter: \"blur(0px)\" }\n : { opacity: 0, scale: 0.9, y: -8, filter: \"blur(5px)\" }\n }\n animate={\n reduce\n ? { opacity: 1, filter: \"blur(0px)\" }\n : { opacity: 1, scale: 1, y: 0, filter: \"blur(0px)\" }\n }\n // Exit gets sucked up into the pill — fast, blur-free, before the\n // shrinking shell can clip it.\n exit={\n reduce\n ? { opacity: 0, filter: \"blur(0px)\", transition: { duration: 0.1 } }\n : {\n opacity: 0,\n scale: 0.9,\n y: -6,\n filter: \"blur(0px)\",\n transition: { duration: 0.08, ease: EASE_OUT },\n }\n }\n // One spring drives transform, opacity and blur together — no per\n // property tweens, no delays. Content travels with the shell.\n transition={reduce ? { duration: 0.15 } : CONTENT_SPRING}\n // Anchored to the pill line: content unfurls downward out of it and is\n // sucked back up into it.\n style={{ transformOrigin: \"top center\" }}\n className={cn(\"flex items-center justify-center\", className)}\n >\n {children}\n </motion.div>\n );\n}\n\nexport interface DynamicIslandProps {\n /** Active view id. `null` shows the compact pill. */\n view: string | null;\n /** Compact pill content, shown when no view is active. */\n compact?: ReactNode;\n /** DynamicIslandView elements. */\n children?: ReactNode;\n className?: string;\n}\n\nexport function DynamicIsland({ view, compact, children, className }: DynamicIslandProps) {\n const reduce = useReducedMotion();\n const expanded = view !== null;\n const [sizerRef, size] = useContentSize();\n const contextValue = useMemo(() => ({ view }), [view]);\n\n return (\n <IslandContext.Provider value={contextValue}>\n <motion.div\n role=\"status\"\n aria-live=\"polite\"\n initial={false}\n animate={\n size\n ? { width: size.width, height: size.height }\n : { width: PILL_WIDTH, height: PILL_HEIGHT }\n }\n transition={reduce ? { duration: 0 } : SHELL_SPRING}\n style={{ borderRadius: RADIUS }}\n // items-start pins content to the top edge while the shell springs, so\n // expansion reads as unfurling downward out of the pill. Top-align the\n // island in its parent (like under a notch) to complete the effect.\n className={cn(\n \"relative inline-flex items-start justify-center overflow-hidden\",\n \"bg-foreground text-background shadow-2xl\",\n className,\n )}\n >\n {/* w-max keeps this at the natural size of the active content; the\n shell springs toward it. */}\n <div ref={sizerRef} className=\"w-max\">\n <AnimatePresence mode=\"popLayout\" initial={false}>\n {!expanded && compact ? (\n <Slot\n keyId=\"compact\"\n // iPhone pill proportions: ~126 x 37.\n className=\"min-h-[37px] min-w-[126px] gap-2 px-4 py-1.5 font-medium text-xs\"\n >\n {compact}\n </Slot>\n ) : null}\n </AnimatePresence>\n {children}\n </div>\n </motion.div>\n </IslandContext.Provider>\n );\n}\n\nexport interface DynamicIslandViewProps {\n /** Matches the parent `view` prop when active. */\n id: string;\n children: ReactNode;\n className?: string;\n}\n\nexport function DynamicIslandView({ id, children, className }: DynamicIslandViewProps) {\n const ctx = useContext(IslandContext);\n if (!ctx) throw new Error(\"DynamicIslandView must be used inside <DynamicIsland>\");\n const active = ctx.view === id;\n\n return (\n <AnimatePresence mode=\"popLayout\" initial={false}>\n {active ? (\n <Slot keyId={id} className={cn(\"px-6 py-4\", className)}>\n {children}\n </Slot>\n ) : null}\n </AnimatePresence>\n );\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/components/motion/expandable-action-bar.d.ts
|
|
3
|
+
type ExpandableActionBarSize = "sm" | "md";
|
|
4
|
+
type ExpandableActionBarItem = {
|
|
5
|
+
id: string;
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
icon: ReactNode;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
active?: boolean;
|
|
11
|
+
badge?: ReactNode;
|
|
12
|
+
shortcut?: ReactNode;
|
|
13
|
+
};
|
|
14
|
+
type ExpandableActionBarClassNames = {
|
|
15
|
+
root?: string;
|
|
16
|
+
track?: string;
|
|
17
|
+
item?: string;
|
|
18
|
+
activeItem?: string;
|
|
19
|
+
icon?: string;
|
|
20
|
+
label?: string;
|
|
21
|
+
badge?: string;
|
|
22
|
+
shortcut?: string;
|
|
23
|
+
};
|
|
24
|
+
interface ExpandableActionBarProps {
|
|
25
|
+
items: ExpandableActionBarItem[];
|
|
26
|
+
expanded?: boolean;
|
|
27
|
+
defaultExpanded?: boolean;
|
|
28
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
29
|
+
activeId?: string;
|
|
30
|
+
onAction?: (item: ExpandableActionBarItem) => void;
|
|
31
|
+
size?: ExpandableActionBarSize;
|
|
32
|
+
expandOnHover?: boolean;
|
|
33
|
+
expandOnFocus?: boolean;
|
|
34
|
+
collapseDelay?: number;
|
|
35
|
+
className?: string;
|
|
36
|
+
classNames?: ExpandableActionBarClassNames;
|
|
37
|
+
renderItem?: (item: ExpandableActionBarItem, state: {
|
|
38
|
+
expanded: boolean;
|
|
39
|
+
active: boolean;
|
|
40
|
+
}) => ReactNode;
|
|
41
|
+
}
|
|
42
|
+
declare function ExpandableActionBar({ items, expanded, defaultExpanded, onExpandedChange, activeId, onAction, size, expandOnHover, expandOnFocus, collapseDelay, className, classNames, renderItem }: ExpandableActionBarProps): import("react").JSX.Element;
|
|
43
|
+
declare function useExpandableActionBar(items: ExpandableActionBarItem[]): {
|
|
44
|
+
expanded: boolean;
|
|
45
|
+
setExpanded: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
46
|
+
activeId: string;
|
|
47
|
+
setActiveId: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
48
|
+
activeItem: ExpandableActionBarItem | undefined;
|
|
49
|
+
};
|
|
50
|
+
//#endregion
|
|
51
|
+
export { ExpandableActionBar, ExpandableActionBarClassNames, ExpandableActionBarItem, ExpandableActionBarProps, ExpandableActionBarSize, useExpandableActionBar };
|
|
52
|
+
//# sourceMappingURL=expandable-action-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expandable-action-bar.d.ts","names":[],"sources":["../../../src/components/motion/expandable-action-bar.tsx"],"mappings":";;KAiBY;KAEA;EACV;EACA,OAAO;EACP,MAAM;EACN;EACA;EACA;EACA,QAAQ;EACR,WAAW;;KAGD;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,OAAO;EACP;EACA;EACA,oBAAoB;EACpB;EACA,YAAY,MAAM;EAClB,OAAO;EACP;EACA;EACA;EACA;EACA,aAAa;EACb,cACE,MAAM,yBACN;IAAS;IAAmB;QACzB;;iBAwDS,sBACd,OACA,UACA,iBACA,kBACA,UACA,UACA,MACA,eACA,eACA,eACA,WACA,YACA,cACC,2CAAwB,IAAA;iBAmMX,uBAAuB,OAAO;;;;;cAAA"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { cn } from "@kumix/utils";
|
|
4
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { LayoutGroup, motion, useReducedMotion } from "motion/react";
|
|
6
|
+
//#region src/components/motion/expandable-action-bar.tsx
|
|
7
|
+
const ITEM_TRANSITION = {
|
|
8
|
+
type: "spring",
|
|
9
|
+
stiffness: 460,
|
|
10
|
+
damping: 34,
|
|
11
|
+
mass: .62
|
|
12
|
+
};
|
|
13
|
+
const LABEL_TRANSITION = {
|
|
14
|
+
type: "spring",
|
|
15
|
+
stiffness: 380,
|
|
16
|
+
damping: 32,
|
|
17
|
+
mass: .7
|
|
18
|
+
};
|
|
19
|
+
const SIZE_CLASS = {
|
|
20
|
+
sm: "min-h-9 gap-1 p-1 text-xs",
|
|
21
|
+
md: "min-h-11 gap-1.5 p-1.5 text-sm"
|
|
22
|
+
};
|
|
23
|
+
const ITEM_SIZE_CLASS = {
|
|
24
|
+
sm: "h-7 min-w-7 px-1.5",
|
|
25
|
+
md: "h-8 min-w-8 px-2"
|
|
26
|
+
};
|
|
27
|
+
const ICON_SIZE_CLASS = {
|
|
28
|
+
sm: "h-3.5 w-3.5",
|
|
29
|
+
md: "h-4 w-4"
|
|
30
|
+
};
|
|
31
|
+
function useControllableExpanded({ expanded, defaultExpanded, onExpandedChange }) {
|
|
32
|
+
const [internalExpanded, setInternalExpanded] = useState(defaultExpanded ?? false);
|
|
33
|
+
const isControlled = expanded !== void 0;
|
|
34
|
+
return [expanded ?? internalExpanded, useCallback((next) => {
|
|
35
|
+
if (!isControlled) setInternalExpanded(next);
|
|
36
|
+
onExpandedChange?.(next);
|
|
37
|
+
}, [isControlled, onExpandedChange])];
|
|
38
|
+
}
|
|
39
|
+
function ExpandableActionBar({ items, expanded, defaultExpanded = false, onExpandedChange, activeId, onAction, size = "md", expandOnHover = true, expandOnFocus = true, collapseDelay = 90, className, classNames, renderItem }) {
|
|
40
|
+
const reduce = useReducedMotion();
|
|
41
|
+
const layoutId = useId();
|
|
42
|
+
const [isExpanded, setIsExpanded] = useControllableExpanded({
|
|
43
|
+
expanded,
|
|
44
|
+
defaultExpanded,
|
|
45
|
+
onExpandedChange
|
|
46
|
+
});
|
|
47
|
+
const [hoveredId, setHoveredId] = useState(null);
|
|
48
|
+
const collapseTimer = useRef(null);
|
|
49
|
+
const clearCollapseTimer = useCallback(() => {
|
|
50
|
+
if (collapseTimer.current) window.clearTimeout(collapseTimer.current);
|
|
51
|
+
collapseTimer.current = null;
|
|
52
|
+
}, []);
|
|
53
|
+
const open = useCallback(() => {
|
|
54
|
+
clearCollapseTimer();
|
|
55
|
+
setIsExpanded(true);
|
|
56
|
+
}, [clearCollapseTimer, setIsExpanded]);
|
|
57
|
+
const close = useCallback(() => {
|
|
58
|
+
clearCollapseTimer();
|
|
59
|
+
const timer = window.setTimeout(() => {
|
|
60
|
+
setIsExpanded(false);
|
|
61
|
+
setHoveredId(null);
|
|
62
|
+
}, collapseDelay);
|
|
63
|
+
collapseTimer.current = timer;
|
|
64
|
+
}, [
|
|
65
|
+
clearCollapseTimer,
|
|
66
|
+
collapseDelay,
|
|
67
|
+
setIsExpanded
|
|
68
|
+
]);
|
|
69
|
+
useEffect(() => clearCollapseTimer, [clearCollapseTimer]);
|
|
70
|
+
const onRootMouseEnter = () => {
|
|
71
|
+
if (expandOnHover) open();
|
|
72
|
+
};
|
|
73
|
+
const onRootMouseLeave = () => {
|
|
74
|
+
setHoveredId(null);
|
|
75
|
+
if (expandOnHover) close();
|
|
76
|
+
};
|
|
77
|
+
const onRootFocus = () => {
|
|
78
|
+
if (expandOnFocus) open();
|
|
79
|
+
};
|
|
80
|
+
const onRootBlur = (event) => {
|
|
81
|
+
if (!event.currentTarget.contains(event.relatedTarget) && expandOnFocus) close();
|
|
82
|
+
};
|
|
83
|
+
const activeItemId = activeId ?? items.find((item) => item.active)?.id;
|
|
84
|
+
const highlightId = hoveredId ?? activeItemId;
|
|
85
|
+
return /* @__PURE__ */ jsx(LayoutGroup, {
|
|
86
|
+
id: layoutId,
|
|
87
|
+
children: /* @__PURE__ */ jsx(motion.div, {
|
|
88
|
+
layout: "size",
|
|
89
|
+
onMouseEnter: onRootMouseEnter,
|
|
90
|
+
onMouseLeave: onRootMouseLeave,
|
|
91
|
+
onFocus: onRootFocus,
|
|
92
|
+
onBlur: onRootBlur,
|
|
93
|
+
transition: ITEM_TRANSITION,
|
|
94
|
+
className: cn("inline-flex", classNames?.root, className),
|
|
95
|
+
children: /* @__PURE__ */ jsx(motion.div, {
|
|
96
|
+
layout: "size",
|
|
97
|
+
className: cn("relative inline-flex items-center overflow-hidden rounded-full border border-border bg-card/90 shadow-2xl backdrop-blur-xl", SIZE_CLASS[size], classNames?.track),
|
|
98
|
+
transition: ITEM_TRANSITION,
|
|
99
|
+
children: items.map((item) => {
|
|
100
|
+
const isActive = item.active || activeId === item.id;
|
|
101
|
+
const isHighlighted = highlightId === item.id;
|
|
102
|
+
return /* @__PURE__ */ jsxs(motion.button, {
|
|
103
|
+
layout: "position",
|
|
104
|
+
type: "button",
|
|
105
|
+
disabled: item.disabled,
|
|
106
|
+
title: typeof item.label === "string" ? item.label : void 0,
|
|
107
|
+
onMouseEnter: () => {
|
|
108
|
+
clearCollapseTimer();
|
|
109
|
+
setHoveredId(item.id);
|
|
110
|
+
},
|
|
111
|
+
onClick: (event) => {
|
|
112
|
+
event.currentTarget.blur();
|
|
113
|
+
item.onClick?.();
|
|
114
|
+
onAction?.(item);
|
|
115
|
+
},
|
|
116
|
+
whileTap: reduce || item.disabled ? void 0 : { scale: .96 },
|
|
117
|
+
transition: ITEM_TRANSITION,
|
|
118
|
+
className: cn("relative isolate inline-flex items-center justify-center overflow-hidden rounded-full font-medium text-muted-foreground outline-none transition-[color,background-color] duration-150 ease-out", "focus-visible:text-foreground disabled:pointer-events-none disabled:opacity-40", isHighlighted && "text-foreground", ITEM_SIZE_CLASS[size], classNames?.item, isActive && classNames?.activeItem),
|
|
119
|
+
children: [isHighlighted ? /* @__PURE__ */ jsx(motion.span, {
|
|
120
|
+
layoutId: "action-bar-highlight",
|
|
121
|
+
className: "absolute inset-0 -z-10 rounded-full bg-primary/[0.07]",
|
|
122
|
+
transition: ITEM_TRANSITION
|
|
123
|
+
}) : null, renderItem ? renderItem(item, {
|
|
124
|
+
expanded: isExpanded,
|
|
125
|
+
active: isActive
|
|
126
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
127
|
+
/* @__PURE__ */ jsx("span", {
|
|
128
|
+
className: cn("inline-flex shrink-0 items-center justify-center", ICON_SIZE_CLASS[size], classNames?.icon),
|
|
129
|
+
children: item.icon
|
|
130
|
+
}),
|
|
131
|
+
/* @__PURE__ */ jsx(motion.span, {
|
|
132
|
+
"aria-hidden": !isExpanded,
|
|
133
|
+
animate: reduce ? {
|
|
134
|
+
width: isExpanded ? "auto" : 0,
|
|
135
|
+
opacity: isExpanded ? 1 : 0,
|
|
136
|
+
marginLeft: isExpanded ? 8 : 0,
|
|
137
|
+
x: 0,
|
|
138
|
+
filter: "blur(0px)"
|
|
139
|
+
} : {
|
|
140
|
+
width: isExpanded ? "auto" : 0,
|
|
141
|
+
opacity: isExpanded ? 1 : 0,
|
|
142
|
+
x: isExpanded ? 0 : -4,
|
|
143
|
+
marginLeft: isExpanded ? 8 : 0,
|
|
144
|
+
filter: isExpanded ? "blur(0px)" : "blur(3px)"
|
|
145
|
+
},
|
|
146
|
+
transition: reduce ? { duration: 0 } : LABEL_TRANSITION,
|
|
147
|
+
className: cn("inline-block overflow-hidden whitespace-nowrap", classNames?.label),
|
|
148
|
+
children: item.label
|
|
149
|
+
}),
|
|
150
|
+
item.shortcut ? /* @__PURE__ */ jsx(motion.span, {
|
|
151
|
+
"aria-hidden": !isExpanded,
|
|
152
|
+
animate: {
|
|
153
|
+
width: isExpanded ? "auto" : 0,
|
|
154
|
+
opacity: isExpanded ? 1 : 0,
|
|
155
|
+
marginLeft: isExpanded ? 4 : 0
|
|
156
|
+
},
|
|
157
|
+
transition: LABEL_TRANSITION,
|
|
158
|
+
className: cn("hidden overflow-hidden whitespace-nowrap text-[10px] text-muted-foreground sm:inline-block", classNames?.shortcut),
|
|
159
|
+
children: item.shortcut
|
|
160
|
+
}) : null,
|
|
161
|
+
item.badge ? /* @__PURE__ */ jsx("span", {
|
|
162
|
+
className: cn("ml-0.5 inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-destructive px-1 text-[10px] text-primary-foreground leading-none", !isExpanded && "absolute top-0.5 right-0.5", classNames?.badge),
|
|
163
|
+
children: item.badge
|
|
164
|
+
}) : null
|
|
165
|
+
] })]
|
|
166
|
+
}, item.id);
|
|
167
|
+
})
|
|
168
|
+
})
|
|
169
|
+
})
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
function useExpandableActionBar(items) {
|
|
173
|
+
const [expanded, setExpanded] = useState(false);
|
|
174
|
+
const [activeId, setActiveId] = useState(items[0]?.id);
|
|
175
|
+
const activeItem = useMemo(() => items.find((item) => item.id === activeId), [activeId, items]);
|
|
176
|
+
return useMemo(() => ({
|
|
177
|
+
expanded,
|
|
178
|
+
setExpanded,
|
|
179
|
+
activeId,
|
|
180
|
+
setActiveId,
|
|
181
|
+
activeItem
|
|
182
|
+
}), [
|
|
183
|
+
activeId,
|
|
184
|
+
activeItem,
|
|
185
|
+
expanded
|
|
186
|
+
]);
|
|
187
|
+
}
|
|
188
|
+
//#endregion
|
|
189
|
+
export { ExpandableActionBar, useExpandableActionBar };
|
|
190
|
+
|
|
191
|
+
//# sourceMappingURL=expandable-action-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expandable-action-bar.js","names":[],"sources":["../../../src/components/motion/expandable-action-bar.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type FocusEvent,\n type MouseEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { LayoutGroup, motion, type Transition, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\n\nexport type ExpandableActionBarSize = \"sm\" | \"md\";\n\nexport type ExpandableActionBarItem = {\n id: string;\n label: ReactNode;\n icon: ReactNode;\n onClick?: () => void;\n disabled?: boolean;\n active?: boolean;\n badge?: ReactNode;\n shortcut?: ReactNode;\n};\n\nexport type ExpandableActionBarClassNames = {\n root?: string;\n track?: string;\n item?: string;\n activeItem?: string;\n icon?: string;\n label?: string;\n badge?: string;\n shortcut?: string;\n};\n\nexport interface ExpandableActionBarProps {\n items: ExpandableActionBarItem[];\n expanded?: boolean;\n defaultExpanded?: boolean;\n onExpandedChange?: (expanded: boolean) => void;\n activeId?: string;\n onAction?: (item: ExpandableActionBarItem) => void;\n size?: ExpandableActionBarSize;\n expandOnHover?: boolean;\n expandOnFocus?: boolean;\n collapseDelay?: number;\n className?: string;\n classNames?: ExpandableActionBarClassNames;\n renderItem?: (\n item: ExpandableActionBarItem,\n state: { expanded: boolean; active: boolean },\n ) => ReactNode;\n}\n\nconst ITEM_TRANSITION: Transition = {\n type: \"spring\",\n stiffness: 460,\n damping: 34,\n mass: 0.62,\n};\n\nconst LABEL_TRANSITION: Transition = {\n type: \"spring\",\n stiffness: 380,\n damping: 32,\n mass: 0.7,\n};\n\nconst SIZE_CLASS: Record<ExpandableActionBarSize, string> = {\n sm: \"min-h-9 gap-1 p-1 text-xs\",\n md: \"min-h-11 gap-1.5 p-1.5 text-sm\",\n};\n\nconst ITEM_SIZE_CLASS: Record<ExpandableActionBarSize, string> = {\n sm: \"h-7 min-w-7 px-1.5\",\n md: \"h-8 min-w-8 px-2\",\n};\n\nconst ICON_SIZE_CLASS: Record<ExpandableActionBarSize, string> = {\n sm: \"h-3.5 w-3.5\",\n md: \"h-4 w-4\",\n};\n\nfunction useControllableExpanded({\n expanded,\n defaultExpanded,\n onExpandedChange,\n}: {\n expanded?: boolean;\n defaultExpanded?: boolean;\n onExpandedChange?: (expanded: boolean) => void;\n}) {\n const [internalExpanded, setInternalExpanded] = useState(defaultExpanded ?? false);\n const isControlled = expanded !== undefined;\n const value = expanded ?? internalExpanded;\n\n const setValue = useCallback(\n (next: boolean) => {\n if (!isControlled) setInternalExpanded(next);\n onExpandedChange?.(next);\n },\n [isControlled, onExpandedChange],\n );\n\n return [value, setValue] as const;\n}\n\nexport function ExpandableActionBar({\n items,\n expanded,\n defaultExpanded = false,\n onExpandedChange,\n activeId,\n onAction,\n size = \"md\",\n expandOnHover = true,\n expandOnFocus = true,\n collapseDelay = 90,\n className,\n classNames,\n renderItem,\n}: ExpandableActionBarProps) {\n const reduce = useReducedMotion();\n const layoutId = useId();\n const [isExpanded, setIsExpanded] = useControllableExpanded({\n expanded,\n defaultExpanded,\n onExpandedChange,\n });\n const [hoveredId, setHoveredId] = useState<string | null>(null);\n const collapseTimer = useRef<number | null>(null);\n\n const clearCollapseTimer = useCallback(() => {\n if (collapseTimer.current) window.clearTimeout(collapseTimer.current);\n collapseTimer.current = null;\n }, []);\n\n const open = useCallback(() => {\n clearCollapseTimer();\n setIsExpanded(true);\n }, [clearCollapseTimer, setIsExpanded]);\n\n const close = useCallback(() => {\n clearCollapseTimer();\n const timer = window.setTimeout(() => {\n setIsExpanded(false);\n setHoveredId(null);\n }, collapseDelay);\n collapseTimer.current = timer;\n }, [clearCollapseTimer, collapseDelay, setIsExpanded]);\n\n useEffect(() => clearCollapseTimer, [clearCollapseTimer]);\n\n const onRootMouseEnter = () => {\n if (expandOnHover) open();\n };\n\n const onRootMouseLeave = () => {\n setHoveredId(null);\n if (expandOnHover) close();\n };\n\n const onRootFocus = () => {\n if (expandOnFocus) open();\n };\n\n const onRootBlur = (event: FocusEvent<HTMLDivElement>) => {\n if (!event.currentTarget.contains(event.relatedTarget as Node) && expandOnFocus) {\n close();\n }\n };\n\n const activeItemId = activeId ?? items.find((item) => item.active)?.id;\n const highlightId = hoveredId ?? activeItemId;\n\n return (\n <LayoutGroup id={layoutId}>\n <motion.div\n layout=\"size\"\n onMouseEnter={onRootMouseEnter}\n onMouseLeave={onRootMouseLeave}\n onFocus={onRootFocus}\n onBlur={onRootBlur}\n transition={ITEM_TRANSITION}\n className={cn(\"inline-flex\", classNames?.root, className)}\n >\n <motion.div\n layout=\"size\"\n className={cn(\n \"relative inline-flex items-center overflow-hidden rounded-full border border-border bg-card/90 shadow-2xl backdrop-blur-xl\",\n SIZE_CLASS[size],\n classNames?.track,\n )}\n transition={ITEM_TRANSITION}\n >\n {items.map((item) => {\n const isActive = item.active || activeId === item.id;\n const isHighlighted = highlightId === item.id;\n\n return (\n <motion.button\n key={item.id}\n layout=\"position\"\n type=\"button\"\n disabled={item.disabled}\n title={typeof item.label === \"string\" ? item.label : undefined}\n onMouseEnter={() => {\n clearCollapseTimer();\n setHoveredId(item.id);\n }}\n onClick={(event: MouseEvent<HTMLButtonElement>) => {\n event.currentTarget.blur();\n item.onClick?.();\n onAction?.(item);\n }}\n whileTap={reduce || item.disabled ? undefined : { scale: 0.96 }}\n transition={ITEM_TRANSITION}\n className={cn(\n \"relative isolate inline-flex items-center justify-center overflow-hidden rounded-full font-medium text-muted-foreground outline-none transition-[color,background-color] duration-150 ease-out\",\n \"focus-visible:text-foreground disabled:pointer-events-none disabled:opacity-40\",\n isHighlighted && \"text-foreground\",\n ITEM_SIZE_CLASS[size],\n classNames?.item,\n isActive && classNames?.activeItem,\n )}\n >\n {isHighlighted ? (\n <motion.span\n layoutId=\"action-bar-highlight\"\n className=\"absolute inset-0 -z-10 rounded-full bg-primary/[0.07]\"\n transition={ITEM_TRANSITION}\n />\n ) : null}\n\n {renderItem ? (\n renderItem(item, { expanded: isExpanded, active: isActive })\n ) : (\n <>\n <span\n className={cn(\n \"inline-flex shrink-0 items-center justify-center\",\n ICON_SIZE_CLASS[size],\n classNames?.icon,\n )}\n >\n {item.icon}\n </span>\n\n <motion.span\n aria-hidden={!isExpanded}\n animate={\n reduce\n ? {\n width: isExpanded ? \"auto\" : 0,\n opacity: isExpanded ? 1 : 0,\n marginLeft: isExpanded ? 8 : 0,\n x: 0,\n filter: \"blur(0px)\",\n }\n : {\n width: isExpanded ? \"auto\" : 0,\n opacity: isExpanded ? 1 : 0,\n x: isExpanded ? 0 : -4,\n marginLeft: isExpanded ? 8 : 0,\n filter: isExpanded ? \"blur(0px)\" : \"blur(3px)\",\n }\n }\n transition={reduce ? { duration: 0 } : LABEL_TRANSITION}\n className={cn(\n \"inline-block overflow-hidden whitespace-nowrap\",\n classNames?.label,\n )}\n >\n {item.label}\n </motion.span>\n\n {item.shortcut ? (\n <motion.span\n aria-hidden={!isExpanded}\n animate={{\n width: isExpanded ? \"auto\" : 0,\n opacity: isExpanded ? 1 : 0,\n marginLeft: isExpanded ? 4 : 0,\n }}\n transition={LABEL_TRANSITION}\n className={cn(\n \"hidden overflow-hidden whitespace-nowrap text-[10px] text-muted-foreground sm:inline-block\",\n classNames?.shortcut,\n )}\n >\n {item.shortcut}\n </motion.span>\n ) : null}\n\n {item.badge ? (\n <span\n className={cn(\n \"ml-0.5 inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-destructive px-1 text-[10px] text-primary-foreground leading-none\",\n !isExpanded && \"absolute top-0.5 right-0.5\",\n classNames?.badge,\n )}\n >\n {item.badge}\n </span>\n ) : null}\n </>\n )}\n </motion.button>\n );\n })}\n </motion.div>\n </motion.div>\n </LayoutGroup>\n );\n}\n\nexport function useExpandableActionBar(items: ExpandableActionBarItem[]) {\n const [expanded, setExpanded] = useState(false);\n const [activeId, setActiveId] = useState(items[0]?.id);\n\n const activeItem = useMemo(() => items.find((item) => item.id === activeId), [activeId, items]);\n\n return useMemo(\n () => ({ expanded, setExpanded, activeId, setActiveId, activeItem }),\n [activeId, activeItem, expanded],\n );\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/components/motion/expandable-tabs.d.ts
|
|
3
|
+
type ExpandableTabsItem = {
|
|
4
|
+
id: string;
|
|
5
|
+
/** String label — shown inside the active tab and used as the button's accessible name. */
|
|
6
|
+
label: string;
|
|
7
|
+
icon: ReactNode;
|
|
8
|
+
/** Panel shown above the bar when this tab is active. */
|
|
9
|
+
content: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
type ExpandableTabsClassNames = {
|
|
12
|
+
root?: string;
|
|
13
|
+
panel?: string;
|
|
14
|
+
bar?: string;
|
|
15
|
+
tab?: string;
|
|
16
|
+
activeTab?: string;
|
|
17
|
+
icon?: string;
|
|
18
|
+
label?: string;
|
|
19
|
+
pill?: string;
|
|
20
|
+
};
|
|
21
|
+
interface ExpandableTabsProps {
|
|
22
|
+
items: ExpandableTabsItem[];
|
|
23
|
+
/** Active tab id, or null/undefined for the closed (bar-only) state. */
|
|
24
|
+
value?: string | null;
|
|
25
|
+
defaultValue?: string | null;
|
|
26
|
+
onValueChange?: (id: string | null) => void;
|
|
27
|
+
className?: string;
|
|
28
|
+
classNames?: ExpandableTabsClassNames;
|
|
29
|
+
}
|
|
30
|
+
declare function ExpandableTabs({ items, value, defaultValue, onValueChange, className, classNames }: ExpandableTabsProps): import("react").JSX.Element;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { ExpandableTabs, ExpandableTabsClassNames, ExpandableTabsItem, ExpandableTabsProps };
|
|
33
|
+
//# sourceMappingURL=expandable-tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expandable-tabs.d.ts","names":[],"sources":["../../../src/components/motion/expandable-tabs.tsx"],"mappings":";;KAQY;EACV;;EAEA;EACA,MAAM;;EAEN,SAAS;;KAGC;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,OAAO;;EAEP;EACA;EACA,iBAAiB;EACjB;EACA,aAAa;;iBAqJC,iBACd,OACA,OACA,cACA,eACA,WACA,cACC,sCAAmB,IAAA"}
|