@constructive-io/ui 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/button-D4vqTxhp.d.cts +20 -0
- package/dist/button-D4vqTxhp.d.ts +20 -0
- package/dist/components/alert-dialog.cjs +98 -302
- package/dist/components/alert-dialog.cjs.map +1 -1
- package/dist/components/alert-dialog.d.cts +22 -21
- package/dist/components/alert-dialog.d.ts +22 -21
- package/dist/components/alert-dialog.js +96 -281
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/alert.cjs +51 -108
- package/dist/components/alert.cjs.map +1 -1
- package/dist/components/alert.d.cts +13 -13
- package/dist/components/alert.d.ts +13 -13
- package/dist/components/alert.js +49 -87
- package/dist/components/alert.js.map +1 -1
- package/dist/components/app-bar.cjs +73 -359
- package/dist/components/app-bar.cjs.map +1 -1
- package/dist/components/app-bar.d.cts +21 -20
- package/dist/components/app-bar.d.ts +21 -20
- package/dist/components/app-bar.js +71 -338
- package/dist/components/app-bar.js.map +1 -1
- package/dist/components/app-shell.cjs +252 -1777
- package/dist/components/app-shell.cjs.map +1 -1
- package/dist/components/app-shell.d.cts +77 -85
- package/dist/components/app-shell.d.ts +77 -85
- package/dist/components/app-shell.js +249 -1756
- package/dist/components/app-shell.js.map +1 -1
- package/dist/components/autocomplete.cjs +146 -397
- package/dist/components/autocomplete.cjs.map +1 -1
- package/dist/components/autocomplete.d.cts +24 -24
- package/dist/components/autocomplete.d.ts +24 -24
- package/dist/components/autocomplete.js +146 -376
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/avatar.cjs +26 -38
- package/dist/components/avatar.cjs.map +1 -1
- package/dist/components/avatar.d.cts +11 -10
- package/dist/components/avatar.d.ts +11 -10
- package/dist/components/avatar.js +24 -37
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.cjs +42 -60
- package/dist/components/badge.cjs.map +1 -1
- package/dist/components/badge.d.cts +13 -13
- package/dist/components/badge.d.ts +13 -13
- package/dist/components/badge.js +39 -38
- package/dist/components/badge.js.map +1 -1
- package/dist/components/breadcrumb.cjs +65 -94
- package/dist/components/breadcrumb.cjs.map +1 -1
- package/dist/components/breadcrumb.d.cts +14 -13
- package/dist/components/breadcrumb.d.ts +14 -13
- package/dist/components/breadcrumb.js +63 -73
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button.cjs +68 -162
- package/dist/components/button.cjs.map +1 -1
- package/dist/components/button.d.cts +2 -20
- package/dist/components/button.d.ts +2 -20
- package/dist/components/button.js +65 -140
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar-rac.cjs +49 -62
- package/dist/components/calendar-rac.cjs.map +1 -1
- package/dist/components/calendar-rac.d.cts +8 -8
- package/dist/components/calendar-rac.d.ts +8 -8
- package/dist/components/calendar-rac.js +49 -61
- package/dist/components/calendar-rac.js.map +1 -1
- package/dist/components/card.cjs +61 -74
- package/dist/components/card.cjs.map +1 -1
- package/dist/components/card.d.cts +15 -16
- package/dist/components/card.d.ts +15 -16
- package/dist/components/card.js +58 -72
- package/dist/components/card.js.map +1 -1
- package/dist/components/checkbox-group.cjs +12 -11
- package/dist/components/checkbox-group.cjs.map +1 -1
- package/dist/components/checkbox-group.d.cts +5 -5
- package/dist/components/checkbox-group.d.ts +5 -5
- package/dist/components/checkbox-group.js +12 -10
- package/dist/components/checkbox-group.js.map +1 -1
- package/dist/components/checkbox.cjs +60 -114
- package/dist/components/checkbox.cjs.map +1 -1
- package/dist/components/checkbox.d.cts +6 -6
- package/dist/components/checkbox.d.ts +6 -6
- package/dist/components/checkbox.js +58 -93
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/collapsible.cjs +76 -113
- package/dist/components/collapsible.cjs.map +1 -1
- package/dist/components/collapsible.d.cts +16 -15
- package/dist/components/collapsible.d.ts +16 -15
- package/dist/components/collapsible.js +74 -92
- package/dist/components/collapsible.js.map +1 -1
- package/dist/components/combobox.cjs +213 -507
- package/dist/components/combobox.cjs.map +1 -1
- package/dist/components/combobox.d.cts +36 -35
- package/dist/components/combobox.d.ts +36 -35
- package/dist/components/combobox.js +229 -504
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/command.cjs +102 -199
- package/dist/components/command.cjs.map +1 -1
- package/dist/components/command.d.cts +22 -21
- package/dist/components/command.d.ts +22 -21
- package/dist/components/command.js +100 -198
- package/dist/components/command.js.map +1 -1
- package/dist/components/dialog.cjs +110 -402
- package/dist/components/dialog.cjs.map +1 -1
- package/dist/components/dialog.d.cts +27 -26
- package/dist/components/dialog.d.ts +27 -26
- package/dist/components/dialog.js +107 -380
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/dock.cjs +80 -111
- package/dist/components/dock.cjs.map +1 -1
- package/dist/components/dock.d.cts +25 -25
- package/dist/components/dock.d.ts +25 -25
- package/dist/components/dock.js +78 -106
- package/dist/components/dock.js.map +1 -1
- package/dist/components/drawer.cjs +77 -111
- package/dist/components/drawer.cjs.map +1 -1
- package/dist/components/drawer.d.cts +15 -14
- package/dist/components/drawer.d.ts +15 -14
- package/dist/components/drawer.js +75 -90
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown-menu.cjs +163 -238
- package/dist/components/dropdown-menu.cjs.map +1 -1
- package/dist/components/dropdown-menu.d.cts +44 -43
- package/dist/components/dropdown-menu.d.ts +44 -43
- package/dist/components/dropdown-menu.js +161 -217
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/empty.cjs +51 -85
- package/dist/components/empty.cjs.map +1 -1
- package/dist/components/empty.d.cts +13 -13
- package/dist/components/empty.d.ts +13 -13
- package/dist/components/empty.js +48 -83
- package/dist/components/empty.js.map +1 -1
- package/dist/components/field.cjs +150 -259
- package/dist/components/field.cjs.map +1 -1
- package/dist/components/field.d.cts +39 -39
- package/dist/components/field.d.ts +39 -39
- package/dist/components/field.js +148 -238
- package/dist/components/field.js.map +1 -1
- package/dist/components/flickering-grid.cjs +143 -166
- package/dist/components/flickering-grid.cjs.map +1 -1
- package/dist/components/flickering-grid.d.cts +14 -13
- package/dist/components/flickering-grid.d.ts +14 -13
- package/dist/components/flickering-grid.js +141 -161
- package/dist/components/flickering-grid.js.map +1 -1
- package/dist/components/flow-zoom-panel.cjs +56 -188
- package/dist/components/flow-zoom-panel.cjs.map +1 -1
- package/dist/components/flow-zoom-panel.d.cts +9 -9
- package/dist/components/flow-zoom-panel.d.ts +9 -9
- package/dist/components/flow-zoom-panel.js +56 -168
- package/dist/components/flow-zoom-panel.js.map +1 -1
- package/dist/components/form-control.cjs +58 -186
- package/dist/components/form-control.cjs.map +1 -1
- package/dist/components/form-control.d.cts +11 -10
- package/dist/components/form-control.d.ts +11 -10
- package/dist/components/form-control.js +56 -165
- package/dist/components/form-control.js.map +1 -1
- package/dist/components/form.cjs +78 -184
- package/dist/components/form.cjs.map +1 -1
- package/dist/components/form.d.cts +2 -36
- package/dist/components/form.d.ts +2 -36
- package/dist/components/form.js +76 -163
- package/dist/components/form.js.map +1 -1
- package/dist/components/input-group.cjs +51 -165
- package/dist/components/input-group.cjs.map +1 -1
- package/dist/components/input-group.d.cts +14 -15
- package/dist/components/input-group.d.ts +14 -15
- package/dist/components/input-group.js +51 -164
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/input.cjs +30 -55
- package/dist/components/input.cjs.map +1 -1
- package/dist/components/input.d.cts +2 -10
- package/dist/components/input.d.ts +2 -10
- package/dist/components/input.js +30 -54
- package/dist/components/input.js.map +1 -1
- package/dist/components/json-input.cjs +133 -337
- package/dist/components/json-input.cjs.map +1 -1
- package/dist/components/json-input.d.cts +20 -19
- package/dist/components/json-input.d.ts +20 -19
- package/dist/components/json-input.js +132 -317
- package/dist/components/json-input.js.map +1 -1
- package/dist/components/label.cjs +19 -21
- package/dist/components/label.cjs.map +1 -1
- package/dist/components/label.d.cts +6 -5
- package/dist/components/label.d.ts +6 -5
- package/dist/components/label.js +17 -20
- package/dist/components/label.js.map +1 -1
- package/dist/components/motion-grid.cjs +61 -101
- package/dist/components/motion-grid.cjs.map +1 -1
- package/dist/components/motion-grid.d.cts +15 -14
- package/dist/components/motion-grid.d.ts +15 -14
- package/dist/components/motion-grid.js +59 -80
- package/dist/components/motion-grid.js.map +1 -1
- package/dist/components/multi-select.cjs +563 -786
- package/dist/components/multi-select.cjs.map +1 -1
- package/dist/components/multi-select.d.cts +173 -173
- package/dist/components/multi-select.d.ts +173 -173
- package/dist/components/multi-select.js +561 -765
- package/dist/components/multi-select.js.map +1 -1
- package/dist/components/page-header.cjs +24 -13
- package/dist/components/page-header.cjs.map +1 -1
- package/dist/components/page-header.d.cts +11 -11
- package/dist/components/page-header.d.ts +11 -11
- package/dist/components/page-header.js +23 -11
- package/dist/components/page-header.js.map +1 -1
- package/dist/components/pagination.cjs +72 -272
- package/dist/components/pagination.cjs.map +1 -1
- package/dist/components/pagination.d.cts +15 -16
- package/dist/components/pagination.d.ts +15 -16
- package/dist/components/pagination.js +69 -250
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/popover.cjs +68 -111
- package/dist/components/popover.cjs.map +1 -1
- package/dist/components/popover.d.cts +31 -30
- package/dist/components/popover.d.ts +31 -30
- package/dist/components/popover.js +66 -90
- package/dist/components/popover.js.map +1 -1
- package/dist/components/portal.cjs +128 -81
- package/dist/components/portal.cjs.map +1 -1
- package/dist/components/portal.d.cts +24 -23
- package/dist/components/portal.d.ts +24 -23
- package/dist/components/portal.js +126 -60
- package/dist/components/portal.js.map +1 -1
- package/dist/components/progress.cjs +23 -24
- package/dist/components/progress.cjs.map +1 -1
- package/dist/components/progress.d.cts +8 -7
- package/dist/components/progress.d.ts +8 -7
- package/dist/components/progress.js +21 -23
- package/dist/components/progress.js.map +1 -1
- package/dist/components/progressive-blur-scroll-container.cjs +70 -138
- package/dist/components/progressive-blur-scroll-container.cjs.map +1 -1
- package/dist/components/progressive-blur-scroll-container.d.cts +19 -19
- package/dist/components/progressive-blur-scroll-container.d.ts +19 -19
- package/dist/components/progressive-blur-scroll-container.js +70 -137
- package/dist/components/progressive-blur-scroll-container.js.map +1 -1
- package/dist/components/progressive-blur.cjs +40 -64
- package/dist/components/progressive-blur.cjs.map +1 -1
- package/dist/components/progressive-blur.d.cts +15 -14
- package/dist/components/progressive-blur.d.ts +15 -14
- package/dist/components/progressive-blur.js +38 -63
- package/dist/components/progressive-blur.js.map +1 -1
- package/dist/components/radio-group.cjs +28 -42
- package/dist/components/radio-group.cjs.map +1 -1
- package/dist/components/radio-group.d.cts +8 -8
- package/dist/components/radio-group.d.ts +8 -8
- package/dist/components/radio-group.js +28 -41
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/record-picker.cjs +6 -418
- package/dist/components/record-picker.d.cts +13 -13
- package/dist/components/record-picker.d.ts +13 -13
- package/dist/components/record-picker.js +5 -397
- package/dist/components/resizable.cjs +32 -58
- package/dist/components/resizable.cjs.map +1 -1
- package/dist/components/resizable.d.cts +10 -9
- package/dist/components/resizable.d.ts +10 -9
- package/dist/components/resizable.js +29 -37
- package/dist/components/resizable.js.map +1 -1
- package/dist/components/responsive-diagram.cjs +50 -61
- package/dist/components/responsive-diagram.cjs.map +1 -1
- package/dist/components/responsive-diagram.d.cts +7 -7
- package/dist/components/responsive-diagram.d.ts +7 -7
- package/dist/components/responsive-diagram.js +50 -60
- package/dist/components/responsive-diagram.js.map +1 -1
- package/dist/components/scroll-area.cjs +37 -83
- package/dist/components/scroll-area.cjs.map +1 -1
- package/dist/components/scroll-area.d.cts +9 -8
- package/dist/components/scroll-area.d.ts +9 -8
- package/dist/components/scroll-area.js +35 -62
- package/dist/components/scroll-area.js.map +1 -1
- package/dist/components/select.cjs +175 -300
- package/dist/components/select.cjs.map +1 -1
- package/dist/components/select.d.cts +36 -35
- package/dist/components/select.d.ts +36 -35
- package/dist/components/select.js +172 -278
- package/dist/components/select.js.map +1 -1
- package/dist/components/separator.cjs +16 -19
- package/dist/components/separator.cjs.map +1 -1
- package/dist/components/separator.d.cts +2 -10
- package/dist/components/separator.d.ts +2 -10
- package/dist/components/separator.js +14 -18
- package/dist/components/separator.js.map +1 -1
- package/dist/components/sheet.cjs +17 -487
- package/dist/components/sheet.d.cts +85 -85
- package/dist/components/sheet.d.ts +85 -85
- package/dist/components/sheet.js +3 -453
- package/dist/components/sidebar.cjs +27 -1298
- package/dist/components/sidebar.d.cts +62 -65
- package/dist/components/sidebar.d.ts +62 -65
- package/dist/components/sidebar.js +3 -1254
- package/dist/components/skeleton.cjs +18 -30
- package/dist/components/skeleton.cjs.map +1 -1
- package/dist/components/skeleton.d.cts +6 -5
- package/dist/components/skeleton.d.ts +6 -5
- package/dist/components/skeleton.js +15 -28
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/sonner.cjs +17 -19
- package/dist/components/sonner.cjs.map +1 -1
- package/dist/components/sonner.d.cts +7 -7
- package/dist/components/sonner.d.ts +7 -7
- package/dist/components/sonner.js +17 -18
- package/dist/components/sonner.js.map +1 -1
- package/dist/components/stack/index.cjs +43 -1515
- package/dist/components/stack/index.d.cts +2 -672
- package/dist/components/stack/index.d.ts +2 -672
- package/dist/components/stack/index.js +3 -1455
- package/dist/components/stepper.cjs +131 -285
- package/dist/components/stepper.cjs.map +1 -1
- package/dist/components/stepper.d.cts +27 -26
- package/dist/components/stepper.d.ts +27 -26
- package/dist/components/stepper.js +130 -265
- package/dist/components/stepper.js.map +1 -1
- package/dist/components/switch.cjs +21 -32
- package/dist/components/switch.cjs.map +1 -1
- package/dist/components/switch.d.cts +7 -6
- package/dist/components/switch.d.ts +7 -6
- package/dist/components/switch.js +19 -31
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.cjs +58 -106
- package/dist/components/table.cjs.map +1 -1
- package/dist/components/table.d.cts +17 -16
- package/dist/components/table.d.ts +17 -16
- package/dist/components/table.js +55 -104
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.cjs +31 -35
- package/dist/components/tabs.cjs.map +1 -1
- package/dist/components/tabs.d.cts +9 -8
- package/dist/components/tabs.d.ts +9 -8
- package/dist/components/tabs.js +29 -34
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/tags.cjs +114 -433
- package/dist/components/tags.cjs.map +1 -1
- package/dist/components/tags.d.cts +24 -28
- package/dist/components/tags.d.ts +24 -28
- package/dist/components/tags.js +114 -413
- package/dist/components/tags.js.map +1 -1
- package/dist/components/textarea.cjs +27 -49
- package/dist/components/textarea.cjs.map +1 -1
- package/dist/components/textarea.d.cts +8 -7
- package/dist/components/textarea.d.ts +8 -7
- package/dist/components/textarea.js +27 -48
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/toast/index.cjs +9 -612
- package/dist/components/toast/index.d.cts +2 -52
- package/dist/components/toast/index.d.ts +2 -52
- package/dist/components/toast/index.js +3 -586
- package/dist/components/tooltip.cjs +47 -72
- package/dist/components/tooltip.cjs.map +1 -1
- package/dist/components/tooltip.d.cts +2 -28
- package/dist/components/tooltip.d.ts +2 -28
- package/dist/components/tooltip.js +45 -51
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/unlink-button.cjs +19 -192
- package/dist/components/unlink-button.cjs.map +1 -1
- package/dist/components/unlink-button.d.cts +11 -11
- package/dist/components/unlink-button.d.ts +11 -11
- package/dist/components/unlink-button.js +18 -170
- package/dist/components/unlink-button.js.map +1 -1
- package/dist/form-DgRTv7O7.d.ts +54 -0
- package/dist/form-DoZEWSzb.d.cts +54 -0
- package/dist/index-CjA4CENl.d.cts +684 -0
- package/dist/index-CjA4CENl.d.ts +684 -0
- package/dist/index-UnM04j0t.d.cts +58 -0
- package/dist/index-UnM04j0t.d.ts +58 -0
- package/dist/index.cjs +408 -8697
- package/dist/index.d.cts +224 -2136
- package/dist/index.d.ts +224 -2136
- package/dist/index.js +65 -8350
- package/dist/input-CBrCuMH8.d.cts +11 -0
- package/dist/input-CBrCuMH8.d.ts +11 -0
- package/dist/motion-config-COCFHq1L.cjs +271 -0
- package/dist/motion-config-COCFHq1L.cjs.map +1 -0
- package/dist/motion-config-COsZ6azM.js +241 -0
- package/dist/motion-config-COsZ6azM.js.map +1 -0
- package/dist/record-picker-BbxngCeV.js +162 -0
- package/dist/record-picker-BbxngCeV.js.map +1 -0
- package/dist/record-picker-Bz4FApxD.cjs +167 -0
- package/dist/record-picker-Bz4FApxD.cjs.map +1 -0
- package/dist/rolldown-runtime-D_qnwXdH.cjs +35 -0
- package/dist/separator-BQEsr0Rc.d.cts +11 -0
- package/dist/separator-BQEsr0Rc.d.ts +11 -0
- package/dist/sheet-BLHnhLRH.js +425 -0
- package/dist/sheet-BLHnhLRH.js.map +1 -0
- package/dist/sheet-BdA0rfIz.cjs +515 -0
- package/dist/sheet-BdA0rfIz.cjs.map +1 -0
- package/dist/sidebar-BavjjJp0.cjs +625 -0
- package/dist/sidebar-BavjjJp0.cjs.map +1 -0
- package/dist/sidebar-DeoL2ttp.js +481 -0
- package/dist/sidebar-DeoL2ttp.js.map +1 -0
- package/dist/slot-C-jEfihz.cjs +122 -0
- package/dist/slot-C-jEfihz.cjs.map +1 -0
- package/dist/slot-EL8zfLG0.js +97 -0
- package/dist/slot-EL8zfLG0.js.map +1 -0
- package/dist/stack-DKdvlOM6.cjs +1771 -0
- package/dist/stack-DKdvlOM6.cjs.map +1 -0
- package/dist/stack-jMdxDrex.js +1531 -0
- package/dist/stack-jMdxDrex.js.map +1 -0
- package/dist/toast-D6MqijT2.cjs +316 -0
- package/dist/toast-D6MqijT2.cjs.map +1 -0
- package/dist/toast-D_BOLzm3.js +287 -0
- package/dist/toast-D_BOLzm3.js.map +1 -0
- package/dist/tooltip-CTRQoN1A.d.cts +29 -0
- package/dist/tooltip-CTRQoN1A.d.ts +29 -0
- package/dist/utils-BkMLyah9.js +12 -0
- package/dist/utils-BkMLyah9.js.map +1 -0
- package/dist/utils-CzTQ3-VI.cjs +17 -0
- package/dist/utils-CzTQ3-VI.cjs.map +1 -0
- package/package.json +5 -5
- package/dist/components/record-picker.cjs.map +0 -1
- package/dist/components/record-picker.js.map +0 -1
- package/dist/components/sheet.cjs.map +0 -1
- package/dist/components/sheet.js.map +0 -1
- package/dist/components/sidebar.cjs.map +0 -1
- package/dist/components/sidebar.js.map +0 -1
- package/dist/components/stack/index.cjs.map +0 -1
- package/dist/components/stack/index.js.map +0 -1
- package/dist/components/toast/index.cjs.map +0 -1
- package/dist/components/toast/index.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/components/dock.cjs
CHANGED
|
@@ -1,121 +1,90 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
1
|
+
'use client';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_rolldown_runtime = require('../rolldown-runtime-D_qnwXdH.cjs');
|
|
5
|
+
const require_utils = require('../utils-CzTQ3-VI.cjs');
|
|
6
|
+
const require_motion_config = require('../motion-config-COCFHq1L.cjs');
|
|
7
|
+
let react = require("react");
|
|
8
|
+
react = require_rolldown_runtime.__toESM(react, 1);
|
|
9
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
|
+
let class_variance_authority = require("class-variance-authority");
|
|
11
|
+
let motion_react = require("motion/react");
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return React__default.default.Children.map(children, (child) => {
|
|
45
|
-
if (React__default.default.isValidElement(child) && child.type === DockIcon) {
|
|
46
|
-
return React__default.default.cloneElement(child, {
|
|
47
|
-
...child.props,
|
|
48
|
-
mouseX,
|
|
49
|
-
size: iconSize,
|
|
50
|
-
magnification: iconMagnification,
|
|
51
|
-
distance: iconDistance
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
return child;
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
58
|
-
react.motion.div,
|
|
59
|
-
{
|
|
60
|
-
ref,
|
|
61
|
-
onMouseMove: prefersReducedMotion ? void 0 : (event) => mouseX.set(event.pageX),
|
|
62
|
-
onMouseLeave: prefersReducedMotion ? void 0 : () => mouseX.set(Infinity),
|
|
63
|
-
...props,
|
|
64
|
-
className: cn(dockVariants({ className }), {
|
|
65
|
-
"items-start": direction === "top",
|
|
66
|
-
"items-center": direction === "middle",
|
|
67
|
-
"items-end": direction === "bottom"
|
|
68
|
-
}),
|
|
69
|
-
children: renderChildren()
|
|
70
|
-
}
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
);
|
|
13
|
+
//#region src/components/dock.tsx
|
|
14
|
+
const DEFAULT_SIZE = 40;
|
|
15
|
+
const DEFAULT_MAGNIFICATION = 60;
|
|
16
|
+
const DEFAULT_DISTANCE = 140;
|
|
17
|
+
const dockVariants = (0, class_variance_authority.cva)("mx-auto mt-8 flex h-[58px] w-max items-center justify-center gap-2 rounded-2xl bg-card p-2 shadow-card");
|
|
18
|
+
const Dock = react.default.forwardRef(({ className, children, iconSize = DEFAULT_SIZE, iconMagnification = DEFAULT_MAGNIFICATION, iconDistance = DEFAULT_DISTANCE, direction = "middle", ...props }, ref) => {
|
|
19
|
+
const mouseX = (0, motion_react.useMotionValue)(Infinity);
|
|
20
|
+
const prefersReducedMotion = (0, motion_react.useReducedMotion)();
|
|
21
|
+
const renderChildren = () => {
|
|
22
|
+
return react.default.Children.map(children, (child) => {
|
|
23
|
+
if (react.default.isValidElement(child) && child.type === DockIcon) return react.default.cloneElement(child, {
|
|
24
|
+
...child.props,
|
|
25
|
+
mouseX,
|
|
26
|
+
size: iconSize,
|
|
27
|
+
magnification: iconMagnification,
|
|
28
|
+
distance: iconDistance
|
|
29
|
+
});
|
|
30
|
+
return child;
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react.motion.div, {
|
|
34
|
+
ref,
|
|
35
|
+
onMouseMove: prefersReducedMotion ? void 0 : (event) => mouseX.set(event.pageX),
|
|
36
|
+
onMouseLeave: prefersReducedMotion ? void 0 : () => mouseX.set(Infinity),
|
|
37
|
+
...props,
|
|
38
|
+
className: require_utils.cn(dockVariants({ className }), {
|
|
39
|
+
"items-start": direction === "top",
|
|
40
|
+
"items-center": direction === "middle",
|
|
41
|
+
"items-end": direction === "bottom"
|
|
42
|
+
}),
|
|
43
|
+
children: renderChildren()
|
|
44
|
+
});
|
|
45
|
+
});
|
|
74
46
|
Dock.displayName = "Dock";
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
focus-visible:outline`,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
children
|
|
112
|
-
}
|
|
113
|
-
);
|
|
47
|
+
const DockIcon = ({ size = DEFAULT_SIZE, magnification = DEFAULT_MAGNIFICATION, distance = DEFAULT_DISTANCE, mouseX, className, children, ...props }) => {
|
|
48
|
+
const ref = (0, react.useRef)(null);
|
|
49
|
+
const prefersReducedMotion = (0, motion_react.useReducedMotion)();
|
|
50
|
+
const padding = Math.max(6, size * .2);
|
|
51
|
+
const defaultMouseX = (0, motion_react.useMotionValue)(Infinity);
|
|
52
|
+
const scaleSize = (0, motion_react.useSpring)((0, motion_react.useTransform)((0, motion_react.useTransform)(mouseX ?? defaultMouseX, (val) => {
|
|
53
|
+
const bounds = ref.current?.getBoundingClientRect() ?? {
|
|
54
|
+
x: 0,
|
|
55
|
+
width: 0
|
|
56
|
+
};
|
|
57
|
+
return val - bounds.x - bounds.width / 2;
|
|
58
|
+
}), [
|
|
59
|
+
-distance,
|
|
60
|
+
0,
|
|
61
|
+
distance
|
|
62
|
+
], [
|
|
63
|
+
size,
|
|
64
|
+
magnification,
|
|
65
|
+
size
|
|
66
|
+
]), {
|
|
67
|
+
mass: require_motion_config.springs.gentle.mass,
|
|
68
|
+
stiffness: require_motion_config.springs.gentle.stiffness,
|
|
69
|
+
damping: 12
|
|
70
|
+
});
|
|
71
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react.motion.div, {
|
|
72
|
+
ref,
|
|
73
|
+
style: {
|
|
74
|
+
width: prefersReducedMotion ? size : scaleSize,
|
|
75
|
+
height: prefersReducedMotion ? size : scaleSize,
|
|
76
|
+
padding
|
|
77
|
+
},
|
|
78
|
+
className: require_utils.cn("flex aspect-square cursor-pointer items-center justify-center rounded-full bg-transparent", `hover:bg-muted focus-visible:bg-muted/80 focus-visible:outline-ring transition-colors duration-200
|
|
79
|
+
focus-visible:outline`, className),
|
|
80
|
+
...props,
|
|
81
|
+
children
|
|
82
|
+
});
|
|
114
83
|
};
|
|
115
84
|
DockIcon.displayName = "DockIcon";
|
|
116
85
|
|
|
86
|
+
//#endregion
|
|
117
87
|
exports.Dock = Dock;
|
|
118
88
|
exports.DockIcon = DockIcon;
|
|
119
89
|
exports.dockVariants = dockVariants;
|
|
120
|
-
//# sourceMappingURL=dock.cjs.map
|
|
121
90
|
//# sourceMappingURL=dock.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/motion/motion-config.ts","../../src/lib/utils.ts","../../src/components/dock.tsx"],"names":["twMerge","clsx","cva","React","useMotionValue","useReducedMotion","jsx","motion","useRef","useTransform","useSpring"],"mappings":"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","file":"dock.cjs","sourcesContent":["import type { Transition } from 'motion/react';\n\n/**\n * Shared motion configuration for consistent animations across the app.\n * Based on practical animation tips from https://emilkowal.ski/ui/7-practical-animation-tips\n *\n * Key principles:\n * 1. Keep UI animations under 300ms\n * 2. Never animate from scale(0) - use 0.9+ for natural feel\n * 3. Use custom easing curves for more impactful animations\n * 4. Make animations origin-aware when possible\n * 5. Use blur to smooth transitions when needed\n */\n\n// =============================================================================\n// Easing Curves\n// =============================================================================\n\n/**\n * Standard easing curves for UI animations.\n * Reference: https://easings.co/\n */\nexport const easings = {\n\t/** Smooth deceleration - good for elements entering the screen */\n\teaseOut: [0.25, 0.1, 0.25, 1] as const,\n\n\t/** Smooth acceleration - good for elements leaving the screen */\n\teaseIn: [0.42, 0, 1, 1] as const,\n\n\t/** Smooth both ways - good for hover states and toggles */\n\teaseInOut: [0.42, 0, 0.58, 1] as const,\n\n\t/** Snappy entrance with soft landing - great for modals/dialogs */\n\tsnappy: [0.2, 0, 0, 1] as const,\n\n\t/** Bouncy feel - use sparingly for playful interactions */\n\tbounce: [0.34, 1.56, 0.64, 1] as const,\n\n\t/** Quick start, gradual stop - good for quick feedback */\n\temphasized: [0.4, 0, 0.2, 1] as const,\n\n\t/** Physical feel for exit animations */\n\tphysicalExit: [0.4, 0, 0.6, 1] as const,\n} as const;\n\n// =============================================================================\n// Duration Presets\n// =============================================================================\n\n/**\n * Duration presets in seconds.\n * Rule: UI animations should be under 300ms (0.3s)\n */\nexport const durations = {\n\t/** Instant feedback (button press, toggle) */\n\tinstant: 0.1,\n\n\t/** Quick transitions (tooltips, small elements) */\n\tfast: 0.15,\n\n\t/** Standard UI transitions (modals, panels) */\n\tnormal: 0.2,\n\n\t/** Deliberate animations (page transitions, complex reveals) */\n\tslow: 0.3,\n\n\t/** Maximum for UI - use rarely */\n\tdeliberate: 0.4,\n} as const;\n\n// =============================================================================\n// Spring Presets\n// =============================================================================\n\n/**\n * Spring configurations for physics-based animations.\n * These create more natural, organic motion.\n */\nexport const springs = {\n\t/** Snappy spring - good for quick interactions */\n\tsnappy: {\n\t\ttype: 'spring' as const,\n\t\tstiffness: 400,\n\t\tdamping: 30,\n\t\tmass: 0.8,\n\t},\n\n\t/** Bouncy spring - good for playful elements */\n\tbouncy: {\n\t\ttype: 'spring' as const,\n\t\tstiffness: 300,\n\t\tdamping: 20,\n\t\tmass: 0.6,\n\t},\n\n\t/** Gentle spring - good for large elements */\n\tgentle: {\n\t\ttype: 'spring' as const,\n\t\tstiffness: 150,\n\t\tdamping: 25,\n\t\tmass: 1,\n\t},\n\n\t/** Stiff spring - good for precise movements */\n\tstiff: {\n\t\ttype: 'spring' as const,\n\t\tstiffness: 500,\n\t\tdamping: 35,\n\t\tmass: 0.5,\n\t},\n\n\t/** Panel/sheet animations */\n\tpanel: {\n\t\ttype: 'spring' as const,\n\t\tstiffness: 150,\n\t\tdamping: 25,\n\t},\n} as const;\n\n// =============================================================================\n// Transition Presets\n// =============================================================================\n\n/**\n * Pre-configured transitions for common animation patterns.\n */\nexport const transitions = {\n\t/** Fast fade for overlays and simple elements */\n\tfade: {\n\t\tduration: durations.fast,\n\t\tease: easings.easeOut,\n\t} satisfies Transition,\n\n\t/** Standard enter/exit for UI elements */\n\tenterExit: {\n\t\tduration: durations.normal,\n\t\tease: easings.easeOut,\n\t} satisfies Transition,\n\n\t/** Snappy transition for interactive elements */\n\tsnappy: {\n\t\tduration: durations.fast,\n\t\tease: easings.snappy,\n\t} satisfies Transition,\n\n\t/** Panel slide transition */\n\tpanel: {\n\t\ttype: 'spring',\n\t\tstiffness: 150,\n\t\tdamping: 25,\n\t} satisfies Transition,\n\n\t/** Exit transition with physical feel */\n\texit: {\n\t\ttype: 'tween',\n\t\tduration: durations.normal,\n\t\tease: easings.physicalExit,\n\t} satisfies Transition,\n\n\t/** Layout animations */\n\tlayout: {\n\t\ttype: 'spring',\n\t\tstiffness: 300,\n\t\tdamping: 30,\n\t} satisfies Transition,\n} as const;\n\n// =============================================================================\n// Animation Variants\n// =============================================================================\n\n/**\n * Common animation variants for AnimatePresence patterns.\n * Follows the rule: never animate from scale(0), use 0.9+ instead.\n */\nexport const variants = {\n\t/** Fade with subtle scale - good for modals, cards */\n\tfadeScale: {\n\t\tinitial: { opacity: 0, scale: 0.95 },\n\t\tanimate: { opacity: 1, scale: 1 },\n\t\texit: { opacity: 0, scale: 0.95 },\n\t},\n\n\t/** Fade with subtle slide up - good for content reveals */\n\tfadeSlideUp: {\n\t\tinitial: { opacity: 0, y: 8 },\n\t\tanimate: { opacity: 1, y: 0 },\n\t\texit: { opacity: 0, y: -8 },\n\t},\n\n\t/** Fade with subtle slide down - good for dropdowns */\n\tfadeSlideDown: {\n\t\tinitial: { opacity: 0, y: -8 },\n\t\tanimate: { opacity: 1, y: 0 },\n\t\texit: { opacity: 0, y: 8 },\n\t},\n\n\t/** Simple fade - for overlays */\n\tfade: {\n\t\tinitial: { opacity: 0 },\n\t\tanimate: { opacity: 1 },\n\t\texit: { opacity: 0 },\n\t},\n\n\t/** Dock/floating element - scales from bottom */\n\tfloatUp: {\n\t\tinitial: { opacity: 0, y: 8, scale: 0.98 },\n\t\tanimate: { opacity: 1, y: 0, scale: 1 },\n\t\texit: { opacity: 0, y: 8, scale: 0.98 },\n\t},\n} as const;\n","import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","'use client';\n\nimport React, { PropsWithChildren, useRef } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n\tmotion,\n\tMotionProps,\n\tMotionValue,\n\tuseMotionValue,\n\tuseReducedMotion,\n\tuseSpring,\n\tuseTransform,\n} from 'motion/react';\n\nimport { springs } from '../lib/motion/motion-config';\nimport { cn } from '../lib/utils';\n\nexport interface DockProps extends VariantProps<typeof dockVariants> {\n\tclassName?: string;\n\ticonSize?: number;\n\ticonMagnification?: number;\n\ticonDistance?: number;\n\tdirection?: 'top' | 'middle' | 'bottom';\n\tchildren: React.ReactNode;\n}\n\nconst DEFAULT_SIZE = 40;\nconst DEFAULT_MAGNIFICATION = 60;\nconst DEFAULT_DISTANCE = 140;\n\nconst dockVariants = cva(\n\t// Solid themed surface (no glass/blur)\n\t'mx-auto mt-8 flex h-[58px] w-max items-center justify-center gap-2 rounded-2xl bg-card p-2 shadow-card',\n);\n\nconst Dock = React.forwardRef<HTMLDivElement, DockProps>(\n\t(\n\t\t{\n\t\t\tclassName,\n\t\t\tchildren,\n\t\t\ticonSize = DEFAULT_SIZE,\n\t\t\ticonMagnification = DEFAULT_MAGNIFICATION,\n\t\t\ticonDistance = DEFAULT_DISTANCE,\n\t\t\tdirection = 'middle',\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst mouseX = useMotionValue(Infinity);\n\t\tconst prefersReducedMotion = useReducedMotion();\n\n\t\tconst renderChildren = () => {\n\t\t\treturn React.Children.map(children, (child) => {\n\t\t\t\tif (React.isValidElement<DockIconProps>(child) && child.type === DockIcon) {\n\t\t\t\t\treturn React.cloneElement(child, {\n\t\t\t\t\t\t...child.props,\n\t\t\t\t\t\tmouseX: mouseX,\n\t\t\t\t\t\tsize: iconSize,\n\t\t\t\t\t\tmagnification: iconMagnification,\n\t\t\t\t\t\tdistance: iconDistance,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn child;\n\t\t\t});\n\t\t};\n\n\t\treturn (\n\t\t\t<motion.div\n\t\t\t\tref={ref}\n\t\t\t\tonMouseMove={prefersReducedMotion ? undefined : (event) => mouseX.set(event.pageX)}\n\t\t\t\tonMouseLeave={prefersReducedMotion ? undefined : () => mouseX.set(Infinity)}\n\t\t\t\t{...props}\n\t\t\t\tclassName={cn(dockVariants({ className }), {\n\t\t\t\t\t'items-start': direction === 'top',\n\t\t\t\t\t'items-center': direction === 'middle',\n\t\t\t\t\t'items-end': direction === 'bottom',\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{renderChildren()}\n\t\t\t</motion.div>\n\t\t);\n\t},\n);\n\nDock.displayName = 'Dock';\n\nexport interface DockIconProps extends Omit<MotionProps & React.HTMLAttributes<HTMLDivElement>, 'children'> {\n\tsize?: number;\n\tmagnification?: number;\n\tdistance?: number;\n\tmouseX?: MotionValue<number>;\n\tclassName?: string;\n\tchildren?: React.ReactNode;\n\tprops?: PropsWithChildren;\n}\n\nconst DockIcon = ({\n\tsize = DEFAULT_SIZE,\n\tmagnification = DEFAULT_MAGNIFICATION,\n\tdistance = DEFAULT_DISTANCE,\n\tmouseX,\n\tclassName,\n\tchildren,\n\t...props\n}: DockIconProps) => {\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst prefersReducedMotion = useReducedMotion();\n\tconst padding = Math.max(6, size * 0.2);\n\tconst defaultMouseX = useMotionValue(Infinity);\n\n\tconst distanceCalc = useTransform(mouseX ?? defaultMouseX, (val: number) => {\n\t\tconst bounds = ref.current?.getBoundingClientRect() ?? { x: 0, width: 0 };\n\t\treturn val - bounds.x - bounds.width / 2;\n\t});\n\n\tconst sizeTransform = useTransform(distanceCalc, [-distance, 0, distance], [size, magnification, size]);\n\n\tconst scaleSize = useSpring(sizeTransform, {\n\t\tmass: springs.gentle.mass,\n\t\tstiffness: springs.gentle.stiffness,\n\t\tdamping: 12,\n\t});\n\n\treturn (\n\t\t<motion.div\n\t\t\tref={ref}\n\t\t\tstyle={{ width: prefersReducedMotion ? size : scaleSize, height: prefersReducedMotion ? size : scaleSize, padding }}\n\t\t\tclassName={cn(\n\t\t\t\t// Solid hover target with theme-aware colors\n\t\t\t\t'flex aspect-square cursor-pointer items-center justify-center rounded-full bg-transparent',\n\t\t\t\t`hover:bg-muted focus-visible:bg-muted/80 focus-visible:outline-ring transition-colors duration-200\n\t\t\t\tfocus-visible:outline`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</motion.div>\n\t);\n};\n\nDockIcon.displayName = 'DockIcon';\n\nexport { Dock, DockIcon, dockVariants };\n"]}
|
|
1
|
+
{"version":3,"file":"dock.cjs","names":["React","motion","cn","springs"],"sources":["../../src/components/dock.tsx"],"sourcesContent":["'use client';\n\nimport React, { PropsWithChildren, useRef } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n\tmotion,\n\tMotionProps,\n\tMotionValue,\n\tuseMotionValue,\n\tuseReducedMotion,\n\tuseSpring,\n\tuseTransform,\n} from 'motion/react';\n\nimport { springs } from '../lib/motion/motion-config';\nimport { cn } from '../lib/utils';\n\nexport interface DockProps extends VariantProps<typeof dockVariants> {\n\tclassName?: string;\n\ticonSize?: number;\n\ticonMagnification?: number;\n\ticonDistance?: number;\n\tdirection?: 'top' | 'middle' | 'bottom';\n\tchildren: React.ReactNode;\n}\n\nconst DEFAULT_SIZE = 40;\nconst DEFAULT_MAGNIFICATION = 60;\nconst DEFAULT_DISTANCE = 140;\n\nconst dockVariants = cva(\n\t// Solid themed surface (no glass/blur)\n\t'mx-auto mt-8 flex h-[58px] w-max items-center justify-center gap-2 rounded-2xl bg-card p-2 shadow-card',\n);\n\nconst Dock = React.forwardRef<HTMLDivElement, DockProps>(\n\t(\n\t\t{\n\t\t\tclassName,\n\t\t\tchildren,\n\t\t\ticonSize = DEFAULT_SIZE,\n\t\t\ticonMagnification = DEFAULT_MAGNIFICATION,\n\t\t\ticonDistance = DEFAULT_DISTANCE,\n\t\t\tdirection = 'middle',\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst mouseX = useMotionValue(Infinity);\n\t\tconst prefersReducedMotion = useReducedMotion();\n\n\t\tconst renderChildren = () => {\n\t\t\treturn React.Children.map(children, (child) => {\n\t\t\t\tif (React.isValidElement<DockIconProps>(child) && child.type === DockIcon) {\n\t\t\t\t\treturn React.cloneElement(child, {\n\t\t\t\t\t\t...child.props,\n\t\t\t\t\t\tmouseX: mouseX,\n\t\t\t\t\t\tsize: iconSize,\n\t\t\t\t\t\tmagnification: iconMagnification,\n\t\t\t\t\t\tdistance: iconDistance,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn child;\n\t\t\t});\n\t\t};\n\n\t\treturn (\n\t\t\t<motion.div\n\t\t\t\tref={ref}\n\t\t\t\tonMouseMove={prefersReducedMotion ? undefined : (event) => mouseX.set(event.pageX)}\n\t\t\t\tonMouseLeave={prefersReducedMotion ? undefined : () => mouseX.set(Infinity)}\n\t\t\t\t{...props}\n\t\t\t\tclassName={cn(dockVariants({ className }), {\n\t\t\t\t\t'items-start': direction === 'top',\n\t\t\t\t\t'items-center': direction === 'middle',\n\t\t\t\t\t'items-end': direction === 'bottom',\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{renderChildren()}\n\t\t\t</motion.div>\n\t\t);\n\t},\n);\n\nDock.displayName = 'Dock';\n\nexport interface DockIconProps extends Omit<MotionProps & React.HTMLAttributes<HTMLDivElement>, 'children'> {\n\tsize?: number;\n\tmagnification?: number;\n\tdistance?: number;\n\tmouseX?: MotionValue<number>;\n\tclassName?: string;\n\tchildren?: React.ReactNode;\n\tprops?: PropsWithChildren;\n}\n\nconst DockIcon = ({\n\tsize = DEFAULT_SIZE,\n\tmagnification = DEFAULT_MAGNIFICATION,\n\tdistance = DEFAULT_DISTANCE,\n\tmouseX,\n\tclassName,\n\tchildren,\n\t...props\n}: DockIconProps) => {\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst prefersReducedMotion = useReducedMotion();\n\tconst padding = Math.max(6, size * 0.2);\n\tconst defaultMouseX = useMotionValue(Infinity);\n\n\tconst distanceCalc = useTransform(mouseX ?? defaultMouseX, (val: number) => {\n\t\tconst bounds = ref.current?.getBoundingClientRect() ?? { x: 0, width: 0 };\n\t\treturn val - bounds.x - bounds.width / 2;\n\t});\n\n\tconst sizeTransform = useTransform(distanceCalc, [-distance, 0, distance], [size, magnification, size]);\n\n\tconst scaleSize = useSpring(sizeTransform, {\n\t\tmass: springs.gentle.mass,\n\t\tstiffness: springs.gentle.stiffness,\n\t\tdamping: 12,\n\t});\n\n\treturn (\n\t\t<motion.div\n\t\t\tref={ref}\n\t\t\tstyle={{ width: prefersReducedMotion ? size : scaleSize, height: prefersReducedMotion ? size : scaleSize, padding }}\n\t\t\tclassName={cn(\n\t\t\t\t// Solid hover target with theme-aware colors\n\t\t\t\t'flex aspect-square cursor-pointer items-center justify-center rounded-full bg-transparent',\n\t\t\t\t`hover:bg-muted focus-visible:bg-muted/80 focus-visible:outline-ring transition-colors duration-200\n\t\t\t\tfocus-visible:outline`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</motion.div>\n\t);\n};\n\nDockIcon.displayName = 'DockIcon';\n\nexport { Dock, DockIcon, dockVariants };\n"],"mappings":";;;;;;;;;;;;;AA0BA,MAAM,eAAe;AACrB,MAAM,wBAAwB;AAC9B,MAAM,mBAAmB;AAEzB,MAAM,iDAEL,wGACD;AAEA,MAAM,OAAOA,cAAM,YAEjB,EACC,WACA,UACA,WAAW,cACX,oBAAoB,uBACpB,eAAe,kBACf,YAAY,UACZ,GAAG,SAEJ,QACI;CACJ,MAAM,0CAAwB,QAAQ;CACtC,MAAM,0DAAwC;CAE9C,MAAM,uBAAuB;EAC5B,OAAOA,cAAM,SAAS,IAAI,WAAW,UAAU;GAC9C,IAAIA,cAAM,eAA8B,KAAK,KAAK,MAAM,SAAS,UAChE,OAAOA,cAAM,aAAa,OAAO;IAChC,GAAG,MAAM;IACD;IACR,MAAM;IACN,eAAe;IACf,UAAU;GACX,CAAC;GAEF,OAAO;EACR,CAAC;CACF;CAEA,OACC,2CAACC,oBAAO,KAAR;EACM;EACL,aAAa,uBAAuB,UAAa,UAAU,OAAO,IAAI,MAAM,KAAK;EACjF,cAAc,uBAAuB,eAAkB,OAAO,IAAI,QAAQ;EAC1E,GAAI;EACJ,WAAWC,iBAAG,aAAa,EAAE,UAAU,CAAC,GAAG;GAC1C,eAAe,cAAc;GAC7B,gBAAgB,cAAc;GAC9B,aAAa,cAAc;EAC5B,CAAC;YAEA,eAAe;CACL;AAEd,CACD;AAEA,KAAK,cAAc;AAYnB,MAAM,YAAY,EACjB,OAAO,cACP,gBAAgB,uBAChB,WAAW,kBACX,QACA,WACA,UACA,GAAG,YACiB;CACpB,MAAM,wBAA6B,IAAI;CACvC,MAAM,0DAAwC;CAC9C,MAAM,UAAU,KAAK,IAAI,GAAG,OAAO,EAAG;CACtC,MAAM,iDAA+B,QAAQ;CAS7C,MAAM,sGAP4B,UAAU,gBAAgB,QAAgB;EAC3E,MAAM,SAAS,IAAI,SAAS,sBAAsB,KAAK;GAAE,GAAG;GAAG,OAAO;EAAE;EACxE,OAAO,MAAM,OAAO,IAAI,OAAO,QAAQ;CACxC,CAE8C,GAAG;EAAC,CAAC;EAAU;EAAG;CAAQ,GAAG;EAAC;EAAM;EAAe;CAAI,CAE7D,GAAG;EAC1C,MAAMC,8BAAQ,OAAO;EACrB,WAAWA,8BAAQ,OAAO;EAC1B,SAAS;CACV,CAAC;CAED,OACC,2CAACF,oBAAO,KAAR;EACM;EACL,OAAO;GAAE,OAAO,uBAAuB,OAAO;GAAW,QAAQ,uBAAuB,OAAO;GAAW;EAAQ;EAClH,WAAWC,iBAEV,6FACA;4BAEA,SACD;EACA,GAAI;EAEH;CACU;AAEd;AAEA,SAAS,cAAc"}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import React, { PropsWithChildren } from "react";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { MotionProps, MotionValue } from "motion/react";
|
|
4
|
+
//#region src/components/dock.d.ts
|
|
6
5
|
interface DockProps extends VariantProps<typeof dockVariants> {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
className?: string;
|
|
7
|
+
iconSize?: number;
|
|
8
|
+
iconMagnification?: number;
|
|
9
|
+
iconDistance?: number;
|
|
10
|
+
direction?: 'top' | 'middle' | 'bottom';
|
|
11
|
+
children: React.ReactNode;
|
|
13
12
|
}
|
|
14
|
-
declare const dockVariants: (props?:
|
|
15
|
-
declare const Dock:
|
|
16
|
-
interface DockIconProps extends Omit<MotionProps &
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
declare const dockVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
14
|
+
declare const Dock: React.ForwardRefExoticComponent<DockProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
interface DockIconProps extends Omit<MotionProps & React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
16
|
+
size?: number;
|
|
17
|
+
magnification?: number;
|
|
18
|
+
distance?: number;
|
|
19
|
+
mouseX?: MotionValue<number>;
|
|
20
|
+
className?: string;
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
props?: PropsWithChildren;
|
|
24
23
|
}
|
|
25
24
|
declare const DockIcon: {
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
({ size, magnification, distance, mouseX, className, children, ...props }: DockIconProps): React.JSX.Element;
|
|
26
|
+
displayName: string;
|
|
28
27
|
};
|
|
29
|
-
|
|
30
|
-
export { Dock, DockIcon,
|
|
28
|
+
//#endregion
|
|
29
|
+
export { Dock, DockIcon, DockIconProps, DockProps, dockVariants };
|
|
30
|
+
//# sourceMappingURL=dock.d.cts.map
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import React, { PropsWithChildren } from "react";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { MotionProps, MotionValue } from "motion/react";
|
|
4
|
+
//#region src/components/dock.d.ts
|
|
6
5
|
interface DockProps extends VariantProps<typeof dockVariants> {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
className?: string;
|
|
7
|
+
iconSize?: number;
|
|
8
|
+
iconMagnification?: number;
|
|
9
|
+
iconDistance?: number;
|
|
10
|
+
direction?: 'top' | 'middle' | 'bottom';
|
|
11
|
+
children: React.ReactNode;
|
|
13
12
|
}
|
|
14
|
-
declare const dockVariants: (props?:
|
|
15
|
-
declare const Dock:
|
|
16
|
-
interface DockIconProps extends Omit<MotionProps &
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
declare const dockVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
14
|
+
declare const Dock: React.ForwardRefExoticComponent<DockProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
interface DockIconProps extends Omit<MotionProps & React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
16
|
+
size?: number;
|
|
17
|
+
magnification?: number;
|
|
18
|
+
distance?: number;
|
|
19
|
+
mouseX?: MotionValue<number>;
|
|
20
|
+
className?: string;
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
props?: PropsWithChildren;
|
|
24
23
|
}
|
|
25
24
|
declare const DockIcon: {
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
({ size, magnification, distance, mouseX, className, children, ...props }: DockIconProps): React.JSX.Element;
|
|
26
|
+
displayName: string;
|
|
28
27
|
};
|
|
29
|
-
|
|
30
|
-
export { Dock, DockIcon,
|
|
28
|
+
//#endregion
|
|
29
|
+
export { Dock, DockIcon, DockIconProps, DockProps, dockVariants };
|
|
30
|
+
//# sourceMappingURL=dock.d.ts.map
|
package/dist/components/dock.js
CHANGED
|
@@ -1,113 +1,85 @@
|
|
|
1
|
-
|
|
2
|
-
import React, { useRef } from 'react';
|
|
3
|
-
import { cva } from 'class-variance-authority';
|
|
4
|
-
import { useMotionValue, useReducedMotion, motion, useTransform, useSpring } from 'motion/react';
|
|
5
|
-
import { clsx } from 'clsx';
|
|
6
|
-
import { twMerge } from 'tailwind-merge';
|
|
7
|
-
import { jsx } from 'react/jsx-runtime';
|
|
1
|
+
'use client';
|
|
8
2
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
return /* @__PURE__ */ jsx(
|
|
52
|
-
motion.div,
|
|
53
|
-
{
|
|
54
|
-
ref,
|
|
55
|
-
onMouseMove: prefersReducedMotion ? void 0 : (event) => mouseX.set(event.pageX),
|
|
56
|
-
onMouseLeave: prefersReducedMotion ? void 0 : () => mouseX.set(Infinity),
|
|
57
|
-
...props,
|
|
58
|
-
className: cn(dockVariants({ className }), {
|
|
59
|
-
"items-start": direction === "top",
|
|
60
|
-
"items-center": direction === "middle",
|
|
61
|
-
"items-end": direction === "bottom"
|
|
62
|
-
}),
|
|
63
|
-
children: renderChildren()
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
);
|
|
3
|
+
import { t as cn } from "../utils-BkMLyah9.js";
|
|
4
|
+
import { r as springs } from "../motion-config-COsZ6azM.js";
|
|
5
|
+
import React, { useRef } from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { cva } from "class-variance-authority";
|
|
8
|
+
import { motion, useMotionValue, useReducedMotion, useSpring, useTransform } from "motion/react";
|
|
9
|
+
|
|
10
|
+
//#region src/components/dock.tsx
|
|
11
|
+
const DEFAULT_SIZE = 40;
|
|
12
|
+
const DEFAULT_MAGNIFICATION = 60;
|
|
13
|
+
const DEFAULT_DISTANCE = 140;
|
|
14
|
+
const dockVariants = cva("mx-auto mt-8 flex h-[58px] w-max items-center justify-center gap-2 rounded-2xl bg-card p-2 shadow-card");
|
|
15
|
+
const Dock = React.forwardRef(({ className, children, iconSize = DEFAULT_SIZE, iconMagnification = DEFAULT_MAGNIFICATION, iconDistance = DEFAULT_DISTANCE, direction = "middle", ...props }, ref) => {
|
|
16
|
+
const mouseX = useMotionValue(Infinity);
|
|
17
|
+
const prefersReducedMotion = useReducedMotion();
|
|
18
|
+
const renderChildren = () => {
|
|
19
|
+
return React.Children.map(children, (child) => {
|
|
20
|
+
if (React.isValidElement(child) && child.type === DockIcon) return React.cloneElement(child, {
|
|
21
|
+
...child.props,
|
|
22
|
+
mouseX,
|
|
23
|
+
size: iconSize,
|
|
24
|
+
magnification: iconMagnification,
|
|
25
|
+
distance: iconDistance
|
|
26
|
+
});
|
|
27
|
+
return child;
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ jsx(motion.div, {
|
|
31
|
+
ref,
|
|
32
|
+
onMouseMove: prefersReducedMotion ? void 0 : (event) => mouseX.set(event.pageX),
|
|
33
|
+
onMouseLeave: prefersReducedMotion ? void 0 : () => mouseX.set(Infinity),
|
|
34
|
+
...props,
|
|
35
|
+
className: cn(dockVariants({ className }), {
|
|
36
|
+
"items-start": direction === "top",
|
|
37
|
+
"items-center": direction === "middle",
|
|
38
|
+
"items-end": direction === "bottom"
|
|
39
|
+
}),
|
|
40
|
+
children: renderChildren()
|
|
41
|
+
});
|
|
42
|
+
});
|
|
68
43
|
Dock.displayName = "Dock";
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
focus-visible:outline`,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
children
|
|
106
|
-
}
|
|
107
|
-
);
|
|
44
|
+
const DockIcon = ({ size = DEFAULT_SIZE, magnification = DEFAULT_MAGNIFICATION, distance = DEFAULT_DISTANCE, mouseX, className, children, ...props }) => {
|
|
45
|
+
const ref = useRef(null);
|
|
46
|
+
const prefersReducedMotion = useReducedMotion();
|
|
47
|
+
const padding = Math.max(6, size * .2);
|
|
48
|
+
const defaultMouseX = useMotionValue(Infinity);
|
|
49
|
+
const scaleSize = useSpring(useTransform(useTransform(mouseX ?? defaultMouseX, (val) => {
|
|
50
|
+
const bounds = ref.current?.getBoundingClientRect() ?? {
|
|
51
|
+
x: 0,
|
|
52
|
+
width: 0
|
|
53
|
+
};
|
|
54
|
+
return val - bounds.x - bounds.width / 2;
|
|
55
|
+
}), [
|
|
56
|
+
-distance,
|
|
57
|
+
0,
|
|
58
|
+
distance
|
|
59
|
+
], [
|
|
60
|
+
size,
|
|
61
|
+
magnification,
|
|
62
|
+
size
|
|
63
|
+
]), {
|
|
64
|
+
mass: springs.gentle.mass,
|
|
65
|
+
stiffness: springs.gentle.stiffness,
|
|
66
|
+
damping: 12
|
|
67
|
+
});
|
|
68
|
+
return /* @__PURE__ */ jsx(motion.div, {
|
|
69
|
+
ref,
|
|
70
|
+
style: {
|
|
71
|
+
width: prefersReducedMotion ? size : scaleSize,
|
|
72
|
+
height: prefersReducedMotion ? size : scaleSize,
|
|
73
|
+
padding
|
|
74
|
+
},
|
|
75
|
+
className: cn("flex aspect-square cursor-pointer items-center justify-center rounded-full bg-transparent", `hover:bg-muted focus-visible:bg-muted/80 focus-visible:outline-ring transition-colors duration-200
|
|
76
|
+
focus-visible:outline`, className),
|
|
77
|
+
...props,
|
|
78
|
+
children
|
|
79
|
+
});
|
|
108
80
|
};
|
|
109
81
|
DockIcon.displayName = "DockIcon";
|
|
110
82
|
|
|
83
|
+
//#endregion
|
|
111
84
|
export { Dock, DockIcon, dockVariants };
|
|
112
|
-
//# sourceMappingURL=dock.js.map
|
|
113
85
|
//# sourceMappingURL=dock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/motion/motion-config.ts","../../src/lib/utils.ts","../../src/components/dock.tsx"],"names":[],"mappings":"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","file":"dock.js","sourcesContent":["import type { Transition } from 'motion/react';\n\n/**\n * Shared motion configuration for consistent animations across the app.\n * Based on practical animation tips from https://emilkowal.ski/ui/7-practical-animation-tips\n *\n * Key principles:\n * 1. Keep UI animations under 300ms\n * 2. Never animate from scale(0) - use 0.9+ for natural feel\n * 3. Use custom easing curves for more impactful animations\n * 4. Make animations origin-aware when possible\n * 5. Use blur to smooth transitions when needed\n */\n\n// =============================================================================\n// Easing Curves\n// =============================================================================\n\n/**\n * Standard easing curves for UI animations.\n * Reference: https://easings.co/\n */\nexport const easings = {\n\t/** Smooth deceleration - good for elements entering the screen */\n\teaseOut: [0.25, 0.1, 0.25, 1] as const,\n\n\t/** Smooth acceleration - good for elements leaving the screen */\n\teaseIn: [0.42, 0, 1, 1] as const,\n\n\t/** Smooth both ways - good for hover states and toggles */\n\teaseInOut: [0.42, 0, 0.58, 1] as const,\n\n\t/** Snappy entrance with soft landing - great for modals/dialogs */\n\tsnappy: [0.2, 0, 0, 1] as const,\n\n\t/** Bouncy feel - use sparingly for playful interactions */\n\tbounce: [0.34, 1.56, 0.64, 1] as const,\n\n\t/** Quick start, gradual stop - good for quick feedback */\n\temphasized: [0.4, 0, 0.2, 1] as const,\n\n\t/** Physical feel for exit animations */\n\tphysicalExit: [0.4, 0, 0.6, 1] as const,\n} as const;\n\n// =============================================================================\n// Duration Presets\n// =============================================================================\n\n/**\n * Duration presets in seconds.\n * Rule: UI animations should be under 300ms (0.3s)\n */\nexport const durations = {\n\t/** Instant feedback (button press, toggle) */\n\tinstant: 0.1,\n\n\t/** Quick transitions (tooltips, small elements) */\n\tfast: 0.15,\n\n\t/** Standard UI transitions (modals, panels) */\n\tnormal: 0.2,\n\n\t/** Deliberate animations (page transitions, complex reveals) */\n\tslow: 0.3,\n\n\t/** Maximum for UI - use rarely */\n\tdeliberate: 0.4,\n} as const;\n\n// =============================================================================\n// Spring Presets\n// =============================================================================\n\n/**\n * Spring configurations for physics-based animations.\n * These create more natural, organic motion.\n */\nexport const springs = {\n\t/** Snappy spring - good for quick interactions */\n\tsnappy: {\n\t\ttype: 'spring' as const,\n\t\tstiffness: 400,\n\t\tdamping: 30,\n\t\tmass: 0.8,\n\t},\n\n\t/** Bouncy spring - good for playful elements */\n\tbouncy: {\n\t\ttype: 'spring' as const,\n\t\tstiffness: 300,\n\t\tdamping: 20,\n\t\tmass: 0.6,\n\t},\n\n\t/** Gentle spring - good for large elements */\n\tgentle: {\n\t\ttype: 'spring' as const,\n\t\tstiffness: 150,\n\t\tdamping: 25,\n\t\tmass: 1,\n\t},\n\n\t/** Stiff spring - good for precise movements */\n\tstiff: {\n\t\ttype: 'spring' as const,\n\t\tstiffness: 500,\n\t\tdamping: 35,\n\t\tmass: 0.5,\n\t},\n\n\t/** Panel/sheet animations */\n\tpanel: {\n\t\ttype: 'spring' as const,\n\t\tstiffness: 150,\n\t\tdamping: 25,\n\t},\n} as const;\n\n// =============================================================================\n// Transition Presets\n// =============================================================================\n\n/**\n * Pre-configured transitions for common animation patterns.\n */\nexport const transitions = {\n\t/** Fast fade for overlays and simple elements */\n\tfade: {\n\t\tduration: durations.fast,\n\t\tease: easings.easeOut,\n\t} satisfies Transition,\n\n\t/** Standard enter/exit for UI elements */\n\tenterExit: {\n\t\tduration: durations.normal,\n\t\tease: easings.easeOut,\n\t} satisfies Transition,\n\n\t/** Snappy transition for interactive elements */\n\tsnappy: {\n\t\tduration: durations.fast,\n\t\tease: easings.snappy,\n\t} satisfies Transition,\n\n\t/** Panel slide transition */\n\tpanel: {\n\t\ttype: 'spring',\n\t\tstiffness: 150,\n\t\tdamping: 25,\n\t} satisfies Transition,\n\n\t/** Exit transition with physical feel */\n\texit: {\n\t\ttype: 'tween',\n\t\tduration: durations.normal,\n\t\tease: easings.physicalExit,\n\t} satisfies Transition,\n\n\t/** Layout animations */\n\tlayout: {\n\t\ttype: 'spring',\n\t\tstiffness: 300,\n\t\tdamping: 30,\n\t} satisfies Transition,\n} as const;\n\n// =============================================================================\n// Animation Variants\n// =============================================================================\n\n/**\n * Common animation variants for AnimatePresence patterns.\n * Follows the rule: never animate from scale(0), use 0.9+ instead.\n */\nexport const variants = {\n\t/** Fade with subtle scale - good for modals, cards */\n\tfadeScale: {\n\t\tinitial: { opacity: 0, scale: 0.95 },\n\t\tanimate: { opacity: 1, scale: 1 },\n\t\texit: { opacity: 0, scale: 0.95 },\n\t},\n\n\t/** Fade with subtle slide up - good for content reveals */\n\tfadeSlideUp: {\n\t\tinitial: { opacity: 0, y: 8 },\n\t\tanimate: { opacity: 1, y: 0 },\n\t\texit: { opacity: 0, y: -8 },\n\t},\n\n\t/** Fade with subtle slide down - good for dropdowns */\n\tfadeSlideDown: {\n\t\tinitial: { opacity: 0, y: -8 },\n\t\tanimate: { opacity: 1, y: 0 },\n\t\texit: { opacity: 0, y: 8 },\n\t},\n\n\t/** Simple fade - for overlays */\n\tfade: {\n\t\tinitial: { opacity: 0 },\n\t\tanimate: { opacity: 1 },\n\t\texit: { opacity: 0 },\n\t},\n\n\t/** Dock/floating element - scales from bottom */\n\tfloatUp: {\n\t\tinitial: { opacity: 0, y: 8, scale: 0.98 },\n\t\tanimate: { opacity: 1, y: 0, scale: 1 },\n\t\texit: { opacity: 0, y: 8, scale: 0.98 },\n\t},\n} as const;\n","import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","'use client';\n\nimport React, { PropsWithChildren, useRef } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n\tmotion,\n\tMotionProps,\n\tMotionValue,\n\tuseMotionValue,\n\tuseReducedMotion,\n\tuseSpring,\n\tuseTransform,\n} from 'motion/react';\n\nimport { springs } from '../lib/motion/motion-config';\nimport { cn } from '../lib/utils';\n\nexport interface DockProps extends VariantProps<typeof dockVariants> {\n\tclassName?: string;\n\ticonSize?: number;\n\ticonMagnification?: number;\n\ticonDistance?: number;\n\tdirection?: 'top' | 'middle' | 'bottom';\n\tchildren: React.ReactNode;\n}\n\nconst DEFAULT_SIZE = 40;\nconst DEFAULT_MAGNIFICATION = 60;\nconst DEFAULT_DISTANCE = 140;\n\nconst dockVariants = cva(\n\t// Solid themed surface (no glass/blur)\n\t'mx-auto mt-8 flex h-[58px] w-max items-center justify-center gap-2 rounded-2xl bg-card p-2 shadow-card',\n);\n\nconst Dock = React.forwardRef<HTMLDivElement, DockProps>(\n\t(\n\t\t{\n\t\t\tclassName,\n\t\t\tchildren,\n\t\t\ticonSize = DEFAULT_SIZE,\n\t\t\ticonMagnification = DEFAULT_MAGNIFICATION,\n\t\t\ticonDistance = DEFAULT_DISTANCE,\n\t\t\tdirection = 'middle',\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst mouseX = useMotionValue(Infinity);\n\t\tconst prefersReducedMotion = useReducedMotion();\n\n\t\tconst renderChildren = () => {\n\t\t\treturn React.Children.map(children, (child) => {\n\t\t\t\tif (React.isValidElement<DockIconProps>(child) && child.type === DockIcon) {\n\t\t\t\t\treturn React.cloneElement(child, {\n\t\t\t\t\t\t...child.props,\n\t\t\t\t\t\tmouseX: mouseX,\n\t\t\t\t\t\tsize: iconSize,\n\t\t\t\t\t\tmagnification: iconMagnification,\n\t\t\t\t\t\tdistance: iconDistance,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn child;\n\t\t\t});\n\t\t};\n\n\t\treturn (\n\t\t\t<motion.div\n\t\t\t\tref={ref}\n\t\t\t\tonMouseMove={prefersReducedMotion ? undefined : (event) => mouseX.set(event.pageX)}\n\t\t\t\tonMouseLeave={prefersReducedMotion ? undefined : () => mouseX.set(Infinity)}\n\t\t\t\t{...props}\n\t\t\t\tclassName={cn(dockVariants({ className }), {\n\t\t\t\t\t'items-start': direction === 'top',\n\t\t\t\t\t'items-center': direction === 'middle',\n\t\t\t\t\t'items-end': direction === 'bottom',\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{renderChildren()}\n\t\t\t</motion.div>\n\t\t);\n\t},\n);\n\nDock.displayName = 'Dock';\n\nexport interface DockIconProps extends Omit<MotionProps & React.HTMLAttributes<HTMLDivElement>, 'children'> {\n\tsize?: number;\n\tmagnification?: number;\n\tdistance?: number;\n\tmouseX?: MotionValue<number>;\n\tclassName?: string;\n\tchildren?: React.ReactNode;\n\tprops?: PropsWithChildren;\n}\n\nconst DockIcon = ({\n\tsize = DEFAULT_SIZE,\n\tmagnification = DEFAULT_MAGNIFICATION,\n\tdistance = DEFAULT_DISTANCE,\n\tmouseX,\n\tclassName,\n\tchildren,\n\t...props\n}: DockIconProps) => {\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst prefersReducedMotion = useReducedMotion();\n\tconst padding = Math.max(6, size * 0.2);\n\tconst defaultMouseX = useMotionValue(Infinity);\n\n\tconst distanceCalc = useTransform(mouseX ?? defaultMouseX, (val: number) => {\n\t\tconst bounds = ref.current?.getBoundingClientRect() ?? { x: 0, width: 0 };\n\t\treturn val - bounds.x - bounds.width / 2;\n\t});\n\n\tconst sizeTransform = useTransform(distanceCalc, [-distance, 0, distance], [size, magnification, size]);\n\n\tconst scaleSize = useSpring(sizeTransform, {\n\t\tmass: springs.gentle.mass,\n\t\tstiffness: springs.gentle.stiffness,\n\t\tdamping: 12,\n\t});\n\n\treturn (\n\t\t<motion.div\n\t\t\tref={ref}\n\t\t\tstyle={{ width: prefersReducedMotion ? size : scaleSize, height: prefersReducedMotion ? size : scaleSize, padding }}\n\t\t\tclassName={cn(\n\t\t\t\t// Solid hover target with theme-aware colors\n\t\t\t\t'flex aspect-square cursor-pointer items-center justify-center rounded-full bg-transparent',\n\t\t\t\t`hover:bg-muted focus-visible:bg-muted/80 focus-visible:outline-ring transition-colors duration-200\n\t\t\t\tfocus-visible:outline`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</motion.div>\n\t);\n};\n\nDockIcon.displayName = 'DockIcon';\n\nexport { Dock, DockIcon, dockVariants };\n"]}
|
|
1
|
+
{"version":3,"file":"dock.js","names":[],"sources":["../../src/components/dock.tsx"],"sourcesContent":["'use client';\n\nimport React, { PropsWithChildren, useRef } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n\tmotion,\n\tMotionProps,\n\tMotionValue,\n\tuseMotionValue,\n\tuseReducedMotion,\n\tuseSpring,\n\tuseTransform,\n} from 'motion/react';\n\nimport { springs } from '../lib/motion/motion-config';\nimport { cn } from '../lib/utils';\n\nexport interface DockProps extends VariantProps<typeof dockVariants> {\n\tclassName?: string;\n\ticonSize?: number;\n\ticonMagnification?: number;\n\ticonDistance?: number;\n\tdirection?: 'top' | 'middle' | 'bottom';\n\tchildren: React.ReactNode;\n}\n\nconst DEFAULT_SIZE = 40;\nconst DEFAULT_MAGNIFICATION = 60;\nconst DEFAULT_DISTANCE = 140;\n\nconst dockVariants = cva(\n\t// Solid themed surface (no glass/blur)\n\t'mx-auto mt-8 flex h-[58px] w-max items-center justify-center gap-2 rounded-2xl bg-card p-2 shadow-card',\n);\n\nconst Dock = React.forwardRef<HTMLDivElement, DockProps>(\n\t(\n\t\t{\n\t\t\tclassName,\n\t\t\tchildren,\n\t\t\ticonSize = DEFAULT_SIZE,\n\t\t\ticonMagnification = DEFAULT_MAGNIFICATION,\n\t\t\ticonDistance = DEFAULT_DISTANCE,\n\t\t\tdirection = 'middle',\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst mouseX = useMotionValue(Infinity);\n\t\tconst prefersReducedMotion = useReducedMotion();\n\n\t\tconst renderChildren = () => {\n\t\t\treturn React.Children.map(children, (child) => {\n\t\t\t\tif (React.isValidElement<DockIconProps>(child) && child.type === DockIcon) {\n\t\t\t\t\treturn React.cloneElement(child, {\n\t\t\t\t\t\t...child.props,\n\t\t\t\t\t\tmouseX: mouseX,\n\t\t\t\t\t\tsize: iconSize,\n\t\t\t\t\t\tmagnification: iconMagnification,\n\t\t\t\t\t\tdistance: iconDistance,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn child;\n\t\t\t});\n\t\t};\n\n\t\treturn (\n\t\t\t<motion.div\n\t\t\t\tref={ref}\n\t\t\t\tonMouseMove={prefersReducedMotion ? undefined : (event) => mouseX.set(event.pageX)}\n\t\t\t\tonMouseLeave={prefersReducedMotion ? undefined : () => mouseX.set(Infinity)}\n\t\t\t\t{...props}\n\t\t\t\tclassName={cn(dockVariants({ className }), {\n\t\t\t\t\t'items-start': direction === 'top',\n\t\t\t\t\t'items-center': direction === 'middle',\n\t\t\t\t\t'items-end': direction === 'bottom',\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{renderChildren()}\n\t\t\t</motion.div>\n\t\t);\n\t},\n);\n\nDock.displayName = 'Dock';\n\nexport interface DockIconProps extends Omit<MotionProps & React.HTMLAttributes<HTMLDivElement>, 'children'> {\n\tsize?: number;\n\tmagnification?: number;\n\tdistance?: number;\n\tmouseX?: MotionValue<number>;\n\tclassName?: string;\n\tchildren?: React.ReactNode;\n\tprops?: PropsWithChildren;\n}\n\nconst DockIcon = ({\n\tsize = DEFAULT_SIZE,\n\tmagnification = DEFAULT_MAGNIFICATION,\n\tdistance = DEFAULT_DISTANCE,\n\tmouseX,\n\tclassName,\n\tchildren,\n\t...props\n}: DockIconProps) => {\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst prefersReducedMotion = useReducedMotion();\n\tconst padding = Math.max(6, size * 0.2);\n\tconst defaultMouseX = useMotionValue(Infinity);\n\n\tconst distanceCalc = useTransform(mouseX ?? defaultMouseX, (val: number) => {\n\t\tconst bounds = ref.current?.getBoundingClientRect() ?? { x: 0, width: 0 };\n\t\treturn val - bounds.x - bounds.width / 2;\n\t});\n\n\tconst sizeTransform = useTransform(distanceCalc, [-distance, 0, distance], [size, magnification, size]);\n\n\tconst scaleSize = useSpring(sizeTransform, {\n\t\tmass: springs.gentle.mass,\n\t\tstiffness: springs.gentle.stiffness,\n\t\tdamping: 12,\n\t});\n\n\treturn (\n\t\t<motion.div\n\t\t\tref={ref}\n\t\t\tstyle={{ width: prefersReducedMotion ? size : scaleSize, height: prefersReducedMotion ? size : scaleSize, padding }}\n\t\t\tclassName={cn(\n\t\t\t\t// Solid hover target with theme-aware colors\n\t\t\t\t'flex aspect-square cursor-pointer items-center justify-center rounded-full bg-transparent',\n\t\t\t\t`hover:bg-muted focus-visible:bg-muted/80 focus-visible:outline-ring transition-colors duration-200\n\t\t\t\tfocus-visible:outline`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</motion.div>\n\t);\n};\n\nDockIcon.displayName = 'DockIcon';\n\nexport { Dock, DockIcon, dockVariants };\n"],"mappings":";;;;;;;;;;AA0BA,MAAM,eAAe;AACrB,MAAM,wBAAwB;AAC9B,MAAM,mBAAmB;AAEzB,MAAM,eAAe,IAEpB,wGACD;AAEA,MAAM,OAAO,MAAM,YAEjB,EACC,WACA,UACA,WAAW,cACX,oBAAoB,uBACpB,eAAe,kBACf,YAAY,UACZ,GAAG,SAEJ,QACI;CACJ,MAAM,SAAS,eAAe,QAAQ;CACtC,MAAM,uBAAuB,iBAAiB;CAE9C,MAAM,uBAAuB;EAC5B,OAAO,MAAM,SAAS,IAAI,WAAW,UAAU;GAC9C,IAAI,MAAM,eAA8B,KAAK,KAAK,MAAM,SAAS,UAChE,OAAO,MAAM,aAAa,OAAO;IAChC,GAAG,MAAM;IACD;IACR,MAAM;IACN,eAAe;IACf,UAAU;GACX,CAAC;GAEF,OAAO;EACR,CAAC;CACF;CAEA,OACC,oBAAC,OAAO,KAAR;EACM;EACL,aAAa,uBAAuB,UAAa,UAAU,OAAO,IAAI,MAAM,KAAK;EACjF,cAAc,uBAAuB,eAAkB,OAAO,IAAI,QAAQ;EAC1E,GAAI;EACJ,WAAW,GAAG,aAAa,EAAE,UAAU,CAAC,GAAG;GAC1C,eAAe,cAAc;GAC7B,gBAAgB,cAAc;GAC9B,aAAa,cAAc;EAC5B,CAAC;YAEA,eAAe;CACL;AAEd,CACD;AAEA,KAAK,cAAc;AAYnB,MAAM,YAAY,EACjB,OAAO,cACP,gBAAgB,uBAChB,WAAW,kBACX,QACA,WACA,UACA,GAAG,YACiB;CACpB,MAAM,MAAM,OAAuB,IAAI;CACvC,MAAM,uBAAuB,iBAAiB;CAC9C,MAAM,UAAU,KAAK,IAAI,GAAG,OAAO,EAAG;CACtC,MAAM,gBAAgB,eAAe,QAAQ;CAS7C,MAAM,YAAY,UAFI,aALD,aAAa,UAAU,gBAAgB,QAAgB;EAC3E,MAAM,SAAS,IAAI,SAAS,sBAAsB,KAAK;GAAE,GAAG;GAAG,OAAO;EAAE;EACxE,OAAO,MAAM,OAAO,IAAI,OAAO,QAAQ;CACxC,CAE8C,GAAG;EAAC,CAAC;EAAU;EAAG;CAAQ,GAAG;EAAC;EAAM;EAAe;CAAI,CAE7D,GAAG;EAC1C,MAAM,QAAQ,OAAO;EACrB,WAAW,QAAQ,OAAO;EAC1B,SAAS;CACV,CAAC;CAED,OACC,oBAAC,OAAO,KAAR;EACM;EACL,OAAO;GAAE,OAAO,uBAAuB,OAAO;GAAW,QAAQ,uBAAuB,OAAO;GAAW;EAAQ;EAClH,WAAW,GAEV,6FACA;4BAEA,SACD;EACA,GAAI;EAEH;CACU;AAEd;AAEA,SAAS,cAAc"}
|