@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
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { Input } from "@base-ui/react/input";
|
|
3
|
+
//#region src/components/input.d.ts
|
|
4
|
+
type InputProps = Omit<Input.Props & React$1.RefAttributes<HTMLInputElement>, 'size'> & {
|
|
5
|
+
size?: 'sm' | 'default' | 'lg' | number;
|
|
6
|
+
unstyled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare function Input$1({ className, size, unstyled, ...props }: InputProps): React$1.JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { InputProps as n, Input$1 as t };
|
|
11
|
+
//# sourceMappingURL=input-CBrCuMH8.d.cts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { Input } from "@base-ui/react/input";
|
|
3
|
+
//#region src/components/input.d.ts
|
|
4
|
+
type InputProps = Omit<Input.Props & React$1.RefAttributes<HTMLInputElement>, 'size'> & {
|
|
5
|
+
size?: 'sm' | 'default' | 'lg' | number;
|
|
6
|
+
unstyled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare function Input$1({ className, size, unstyled, ...props }: InputProps): React$1.JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { InputProps as n, Input$1 as t };
|
|
11
|
+
//# sourceMappingURL=input-CBrCuMH8.d.ts.map
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
//#region src/lib/motion/motion-config.ts
|
|
4
|
+
/**
|
|
5
|
+
* Shared motion configuration for consistent animations across the app.
|
|
6
|
+
* Based on practical animation tips from https://emilkowal.ski/ui/7-practical-animation-tips
|
|
7
|
+
*
|
|
8
|
+
* Key principles:
|
|
9
|
+
* 1. Keep UI animations under 300ms
|
|
10
|
+
* 2. Never animate from scale(0) - use 0.9+ for natural feel
|
|
11
|
+
* 3. Use custom easing curves for more impactful animations
|
|
12
|
+
* 4. Make animations origin-aware when possible
|
|
13
|
+
* 5. Use blur to smooth transitions when needed
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Standard easing curves for UI animations.
|
|
17
|
+
* Reference: https://easings.co/
|
|
18
|
+
*/
|
|
19
|
+
const easings = {
|
|
20
|
+
/** Smooth deceleration - good for elements entering the screen */
|
|
21
|
+
easeOut: [
|
|
22
|
+
.25,
|
|
23
|
+
.1,
|
|
24
|
+
.25,
|
|
25
|
+
1
|
|
26
|
+
],
|
|
27
|
+
/** Smooth acceleration - good for elements leaving the screen */
|
|
28
|
+
easeIn: [
|
|
29
|
+
.42,
|
|
30
|
+
0,
|
|
31
|
+
1,
|
|
32
|
+
1
|
|
33
|
+
],
|
|
34
|
+
/** Smooth both ways - good for hover states and toggles */
|
|
35
|
+
easeInOut: [
|
|
36
|
+
.42,
|
|
37
|
+
0,
|
|
38
|
+
.58,
|
|
39
|
+
1
|
|
40
|
+
],
|
|
41
|
+
/** Snappy entrance with soft landing - great for modals/dialogs */
|
|
42
|
+
snappy: [
|
|
43
|
+
.2,
|
|
44
|
+
0,
|
|
45
|
+
0,
|
|
46
|
+
1
|
|
47
|
+
],
|
|
48
|
+
/** Bouncy feel - use sparingly for playful interactions */
|
|
49
|
+
bounce: [
|
|
50
|
+
.34,
|
|
51
|
+
1.56,
|
|
52
|
+
.64,
|
|
53
|
+
1
|
|
54
|
+
],
|
|
55
|
+
/** Quick start, gradual stop - good for quick feedback */
|
|
56
|
+
emphasized: [
|
|
57
|
+
.4,
|
|
58
|
+
0,
|
|
59
|
+
.2,
|
|
60
|
+
1
|
|
61
|
+
],
|
|
62
|
+
/** Physical feel for exit animations */
|
|
63
|
+
physicalExit: [
|
|
64
|
+
.4,
|
|
65
|
+
0,
|
|
66
|
+
.6,
|
|
67
|
+
1
|
|
68
|
+
]
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Duration presets in seconds.
|
|
72
|
+
* Rule: UI animations should be under 300ms (0.3s)
|
|
73
|
+
*/
|
|
74
|
+
const durations = {
|
|
75
|
+
/** Instant feedback (button press, toggle) */
|
|
76
|
+
instant: .1,
|
|
77
|
+
/** Quick transitions (tooltips, small elements) */
|
|
78
|
+
fast: .15,
|
|
79
|
+
/** Standard UI transitions (modals, panels) */
|
|
80
|
+
normal: .2,
|
|
81
|
+
/** Deliberate animations (page transitions, complex reveals) */
|
|
82
|
+
slow: .3,
|
|
83
|
+
/** Maximum for UI - use rarely */
|
|
84
|
+
deliberate: .4
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Spring configurations for physics-based animations.
|
|
88
|
+
* These create more natural, organic motion.
|
|
89
|
+
*/
|
|
90
|
+
const springs = {
|
|
91
|
+
/** Snappy spring - good for quick interactions */
|
|
92
|
+
snappy: {
|
|
93
|
+
type: "spring",
|
|
94
|
+
stiffness: 400,
|
|
95
|
+
damping: 30,
|
|
96
|
+
mass: .8
|
|
97
|
+
},
|
|
98
|
+
/** Bouncy spring - good for playful elements */
|
|
99
|
+
bouncy: {
|
|
100
|
+
type: "spring",
|
|
101
|
+
stiffness: 300,
|
|
102
|
+
damping: 20,
|
|
103
|
+
mass: .6
|
|
104
|
+
},
|
|
105
|
+
/** Gentle spring - good for large elements */
|
|
106
|
+
gentle: {
|
|
107
|
+
type: "spring",
|
|
108
|
+
stiffness: 150,
|
|
109
|
+
damping: 25,
|
|
110
|
+
mass: 1
|
|
111
|
+
},
|
|
112
|
+
/** Stiff spring - good for precise movements */
|
|
113
|
+
stiff: {
|
|
114
|
+
type: "spring",
|
|
115
|
+
stiffness: 500,
|
|
116
|
+
damping: 35,
|
|
117
|
+
mass: .5
|
|
118
|
+
},
|
|
119
|
+
/** Panel/sheet animations */
|
|
120
|
+
panel: {
|
|
121
|
+
type: "spring",
|
|
122
|
+
stiffness: 150,
|
|
123
|
+
damping: 25
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Pre-configured transitions for common animation patterns.
|
|
128
|
+
*/
|
|
129
|
+
const transitions = {
|
|
130
|
+
/** Fast fade for overlays and simple elements */
|
|
131
|
+
fade: {
|
|
132
|
+
duration: durations.fast,
|
|
133
|
+
ease: easings.easeOut
|
|
134
|
+
},
|
|
135
|
+
/** Standard enter/exit for UI elements */
|
|
136
|
+
enterExit: {
|
|
137
|
+
duration: durations.normal,
|
|
138
|
+
ease: easings.easeOut
|
|
139
|
+
},
|
|
140
|
+
/** Snappy transition for interactive elements */
|
|
141
|
+
snappy: {
|
|
142
|
+
duration: durations.fast,
|
|
143
|
+
ease: easings.snappy
|
|
144
|
+
},
|
|
145
|
+
/** Panel slide transition */
|
|
146
|
+
panel: {
|
|
147
|
+
type: "spring",
|
|
148
|
+
stiffness: 150,
|
|
149
|
+
damping: 25
|
|
150
|
+
},
|
|
151
|
+
/** Exit transition with physical feel */
|
|
152
|
+
exit: {
|
|
153
|
+
type: "tween",
|
|
154
|
+
duration: durations.normal,
|
|
155
|
+
ease: easings.physicalExit
|
|
156
|
+
},
|
|
157
|
+
/** Layout animations */
|
|
158
|
+
layout: {
|
|
159
|
+
type: "spring",
|
|
160
|
+
stiffness: 300,
|
|
161
|
+
damping: 30
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* Common animation variants for AnimatePresence patterns.
|
|
166
|
+
* Follows the rule: never animate from scale(0), use 0.9+ instead.
|
|
167
|
+
*/
|
|
168
|
+
const variants = {
|
|
169
|
+
/** Fade with subtle scale - good for modals, cards */
|
|
170
|
+
fadeScale: {
|
|
171
|
+
initial: {
|
|
172
|
+
opacity: 0,
|
|
173
|
+
scale: .95
|
|
174
|
+
},
|
|
175
|
+
animate: {
|
|
176
|
+
opacity: 1,
|
|
177
|
+
scale: 1
|
|
178
|
+
},
|
|
179
|
+
exit: {
|
|
180
|
+
opacity: 0,
|
|
181
|
+
scale: .95
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
/** Fade with subtle slide up - good for content reveals */
|
|
185
|
+
fadeSlideUp: {
|
|
186
|
+
initial: {
|
|
187
|
+
opacity: 0,
|
|
188
|
+
y: 8
|
|
189
|
+
},
|
|
190
|
+
animate: {
|
|
191
|
+
opacity: 1,
|
|
192
|
+
y: 0
|
|
193
|
+
},
|
|
194
|
+
exit: {
|
|
195
|
+
opacity: 0,
|
|
196
|
+
y: -8
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
/** Fade with subtle slide down - good for dropdowns */
|
|
200
|
+
fadeSlideDown: {
|
|
201
|
+
initial: {
|
|
202
|
+
opacity: 0,
|
|
203
|
+
y: -8
|
|
204
|
+
},
|
|
205
|
+
animate: {
|
|
206
|
+
opacity: 1,
|
|
207
|
+
y: 0
|
|
208
|
+
},
|
|
209
|
+
exit: {
|
|
210
|
+
opacity: 0,
|
|
211
|
+
y: 8
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
/** Simple fade - for overlays */
|
|
215
|
+
fade: {
|
|
216
|
+
initial: { opacity: 0 },
|
|
217
|
+
animate: { opacity: 1 },
|
|
218
|
+
exit: { opacity: 0 }
|
|
219
|
+
},
|
|
220
|
+
/** Dock/floating element - scales from bottom */
|
|
221
|
+
floatUp: {
|
|
222
|
+
initial: {
|
|
223
|
+
opacity: 0,
|
|
224
|
+
y: 8,
|
|
225
|
+
scale: .98
|
|
226
|
+
},
|
|
227
|
+
animate: {
|
|
228
|
+
opacity: 1,
|
|
229
|
+
y: 0,
|
|
230
|
+
scale: 1
|
|
231
|
+
},
|
|
232
|
+
exit: {
|
|
233
|
+
opacity: 0,
|
|
234
|
+
y: 8,
|
|
235
|
+
scale: .98
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
//#endregion
|
|
241
|
+
Object.defineProperty(exports, 'durations', {
|
|
242
|
+
enumerable: true,
|
|
243
|
+
get: function () {
|
|
244
|
+
return durations;
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
Object.defineProperty(exports, 'easings', {
|
|
248
|
+
enumerable: true,
|
|
249
|
+
get: function () {
|
|
250
|
+
return easings;
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
Object.defineProperty(exports, 'springs', {
|
|
254
|
+
enumerable: true,
|
|
255
|
+
get: function () {
|
|
256
|
+
return springs;
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
Object.defineProperty(exports, 'transitions', {
|
|
260
|
+
enumerable: true,
|
|
261
|
+
get: function () {
|
|
262
|
+
return transitions;
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
Object.defineProperty(exports, 'variants', {
|
|
266
|
+
enumerable: true,
|
|
267
|
+
get: function () {
|
|
268
|
+
return variants;
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
//# sourceMappingURL=motion-config-COCFHq1L.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"motion-config-COCFHq1L.cjs","names":[],"sources":["../src/lib/motion/motion-config.ts"],"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"],"mappings":";;;;;;;;;;;;;;;;;;AAsBA,MAAa,UAAU;;CAEtB,SAAS;EAAC;EAAM;EAAK;EAAM;CAAC;;CAG5B,QAAQ;EAAC;EAAM;EAAG;EAAG;CAAC;;CAGtB,WAAW;EAAC;EAAM;EAAG;EAAM;CAAC;;CAG5B,QAAQ;EAAC;EAAK;EAAG;EAAG;CAAC;;CAGrB,QAAQ;EAAC;EAAM;EAAM;EAAM;CAAC;;CAG5B,YAAY;EAAC;EAAK;EAAG;EAAK;CAAC;;CAG3B,cAAc;EAAC;EAAK;EAAG;EAAK;CAAC;AAC9B;;;;;AAUA,MAAa,YAAY;;CAExB,SAAS;;CAGT,MAAM;;CAGN,QAAQ;;CAGR,MAAM;;CAGN,YAAY;AACb;;;;;AAUA,MAAa,UAAU;;CAEtB,QAAQ;EACP,MAAM;EACN,WAAW;EACX,SAAS;EACT,MAAM;CACP;;CAGA,QAAQ;EACP,MAAM;EACN,WAAW;EACX,SAAS;EACT,MAAM;CACP;;CAGA,QAAQ;EACP,MAAM;EACN,WAAW;EACX,SAAS;EACT,MAAM;CACP;;CAGA,OAAO;EACN,MAAM;EACN,WAAW;EACX,SAAS;EACT,MAAM;CACP;;CAGA,OAAO;EACN,MAAM;EACN,WAAW;EACX,SAAS;CACV;AACD;;;;AASA,MAAa,cAAc;;CAE1B,MAAM;EACL,UAAU,UAAU;EACpB,MAAM,QAAQ;CACf;;CAGA,WAAW;EACV,UAAU,UAAU;EACpB,MAAM,QAAQ;CACf;;CAGA,QAAQ;EACP,UAAU,UAAU;EACpB,MAAM,QAAQ;CACf;;CAGA,OAAO;EACN,MAAM;EACN,WAAW;EACX,SAAS;CACV;;CAGA,MAAM;EACL,MAAM;EACN,UAAU,UAAU;EACpB,MAAM,QAAQ;CACf;;CAGA,QAAQ;EACP,MAAM;EACN,WAAW;EACX,SAAS;CACV;AACD;;;;;AAUA,MAAa,WAAW;;CAEvB,WAAW;EACV,SAAS;GAAE,SAAS;GAAG,OAAO;EAAK;EACnC,SAAS;GAAE,SAAS;GAAG,OAAO;EAAE;EAChC,MAAM;GAAE,SAAS;GAAG,OAAO;EAAK;CACjC;;CAGA,aAAa;EACZ,SAAS;GAAE,SAAS;GAAG,GAAG;EAAE;EAC5B,SAAS;GAAE,SAAS;GAAG,GAAG;EAAE;EAC5B,MAAM;GAAE,SAAS;GAAG,GAAG;EAAG;CAC3B;;CAGA,eAAe;EACd,SAAS;GAAE,SAAS;GAAG,GAAG;EAAG;EAC7B,SAAS;GAAE,SAAS;GAAG,GAAG;EAAE;EAC5B,MAAM;GAAE,SAAS;GAAG,GAAG;EAAE;CAC1B;;CAGA,MAAM;EACL,SAAS,EAAE,SAAS,EAAE;EACtB,SAAS,EAAE,SAAS,EAAE;EACtB,MAAM,EAAE,SAAS,EAAE;CACpB;;CAGA,SAAS;EACR,SAAS;GAAE,SAAS;GAAG,GAAG;GAAG,OAAO;EAAK;EACzC,SAAS;GAAE,SAAS;GAAG,GAAG;GAAG,OAAO;EAAE;EACtC,MAAM;GAAE,SAAS;GAAG,GAAG;GAAG,OAAO;EAAK;CACvC;AACD"}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
//#region src/lib/motion/motion-config.ts
|
|
3
|
+
/**
|
|
4
|
+
* Shared motion configuration for consistent animations across the app.
|
|
5
|
+
* Based on practical animation tips from https://emilkowal.ski/ui/7-practical-animation-tips
|
|
6
|
+
*
|
|
7
|
+
* Key principles:
|
|
8
|
+
* 1. Keep UI animations under 300ms
|
|
9
|
+
* 2. Never animate from scale(0) - use 0.9+ for natural feel
|
|
10
|
+
* 3. Use custom easing curves for more impactful animations
|
|
11
|
+
* 4. Make animations origin-aware when possible
|
|
12
|
+
* 5. Use blur to smooth transitions when needed
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Standard easing curves for UI animations.
|
|
16
|
+
* Reference: https://easings.co/
|
|
17
|
+
*/
|
|
18
|
+
const easings = {
|
|
19
|
+
/** Smooth deceleration - good for elements entering the screen */
|
|
20
|
+
easeOut: [
|
|
21
|
+
.25,
|
|
22
|
+
.1,
|
|
23
|
+
.25,
|
|
24
|
+
1
|
|
25
|
+
],
|
|
26
|
+
/** Smooth acceleration - good for elements leaving the screen */
|
|
27
|
+
easeIn: [
|
|
28
|
+
.42,
|
|
29
|
+
0,
|
|
30
|
+
1,
|
|
31
|
+
1
|
|
32
|
+
],
|
|
33
|
+
/** Smooth both ways - good for hover states and toggles */
|
|
34
|
+
easeInOut: [
|
|
35
|
+
.42,
|
|
36
|
+
0,
|
|
37
|
+
.58,
|
|
38
|
+
1
|
|
39
|
+
],
|
|
40
|
+
/** Snappy entrance with soft landing - great for modals/dialogs */
|
|
41
|
+
snappy: [
|
|
42
|
+
.2,
|
|
43
|
+
0,
|
|
44
|
+
0,
|
|
45
|
+
1
|
|
46
|
+
],
|
|
47
|
+
/** Bouncy feel - use sparingly for playful interactions */
|
|
48
|
+
bounce: [
|
|
49
|
+
.34,
|
|
50
|
+
1.56,
|
|
51
|
+
.64,
|
|
52
|
+
1
|
|
53
|
+
],
|
|
54
|
+
/** Quick start, gradual stop - good for quick feedback */
|
|
55
|
+
emphasized: [
|
|
56
|
+
.4,
|
|
57
|
+
0,
|
|
58
|
+
.2,
|
|
59
|
+
1
|
|
60
|
+
],
|
|
61
|
+
/** Physical feel for exit animations */
|
|
62
|
+
physicalExit: [
|
|
63
|
+
.4,
|
|
64
|
+
0,
|
|
65
|
+
.6,
|
|
66
|
+
1
|
|
67
|
+
]
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Duration presets in seconds.
|
|
71
|
+
* Rule: UI animations should be under 300ms (0.3s)
|
|
72
|
+
*/
|
|
73
|
+
const durations = {
|
|
74
|
+
/** Instant feedback (button press, toggle) */
|
|
75
|
+
instant: .1,
|
|
76
|
+
/** Quick transitions (tooltips, small elements) */
|
|
77
|
+
fast: .15,
|
|
78
|
+
/** Standard UI transitions (modals, panels) */
|
|
79
|
+
normal: .2,
|
|
80
|
+
/** Deliberate animations (page transitions, complex reveals) */
|
|
81
|
+
slow: .3,
|
|
82
|
+
/** Maximum for UI - use rarely */
|
|
83
|
+
deliberate: .4
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Spring configurations for physics-based animations.
|
|
87
|
+
* These create more natural, organic motion.
|
|
88
|
+
*/
|
|
89
|
+
const springs = {
|
|
90
|
+
/** Snappy spring - good for quick interactions */
|
|
91
|
+
snappy: {
|
|
92
|
+
type: "spring",
|
|
93
|
+
stiffness: 400,
|
|
94
|
+
damping: 30,
|
|
95
|
+
mass: .8
|
|
96
|
+
},
|
|
97
|
+
/** Bouncy spring - good for playful elements */
|
|
98
|
+
bouncy: {
|
|
99
|
+
type: "spring",
|
|
100
|
+
stiffness: 300,
|
|
101
|
+
damping: 20,
|
|
102
|
+
mass: .6
|
|
103
|
+
},
|
|
104
|
+
/** Gentle spring - good for large elements */
|
|
105
|
+
gentle: {
|
|
106
|
+
type: "spring",
|
|
107
|
+
stiffness: 150,
|
|
108
|
+
damping: 25,
|
|
109
|
+
mass: 1
|
|
110
|
+
},
|
|
111
|
+
/** Stiff spring - good for precise movements */
|
|
112
|
+
stiff: {
|
|
113
|
+
type: "spring",
|
|
114
|
+
stiffness: 500,
|
|
115
|
+
damping: 35,
|
|
116
|
+
mass: .5
|
|
117
|
+
},
|
|
118
|
+
/** Panel/sheet animations */
|
|
119
|
+
panel: {
|
|
120
|
+
type: "spring",
|
|
121
|
+
stiffness: 150,
|
|
122
|
+
damping: 25
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Pre-configured transitions for common animation patterns.
|
|
127
|
+
*/
|
|
128
|
+
const transitions = {
|
|
129
|
+
/** Fast fade for overlays and simple elements */
|
|
130
|
+
fade: {
|
|
131
|
+
duration: durations.fast,
|
|
132
|
+
ease: easings.easeOut
|
|
133
|
+
},
|
|
134
|
+
/** Standard enter/exit for UI elements */
|
|
135
|
+
enterExit: {
|
|
136
|
+
duration: durations.normal,
|
|
137
|
+
ease: easings.easeOut
|
|
138
|
+
},
|
|
139
|
+
/** Snappy transition for interactive elements */
|
|
140
|
+
snappy: {
|
|
141
|
+
duration: durations.fast,
|
|
142
|
+
ease: easings.snappy
|
|
143
|
+
},
|
|
144
|
+
/** Panel slide transition */
|
|
145
|
+
panel: {
|
|
146
|
+
type: "spring",
|
|
147
|
+
stiffness: 150,
|
|
148
|
+
damping: 25
|
|
149
|
+
},
|
|
150
|
+
/** Exit transition with physical feel */
|
|
151
|
+
exit: {
|
|
152
|
+
type: "tween",
|
|
153
|
+
duration: durations.normal,
|
|
154
|
+
ease: easings.physicalExit
|
|
155
|
+
},
|
|
156
|
+
/** Layout animations */
|
|
157
|
+
layout: {
|
|
158
|
+
type: "spring",
|
|
159
|
+
stiffness: 300,
|
|
160
|
+
damping: 30
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* Common animation variants for AnimatePresence patterns.
|
|
165
|
+
* Follows the rule: never animate from scale(0), use 0.9+ instead.
|
|
166
|
+
*/
|
|
167
|
+
const variants = {
|
|
168
|
+
/** Fade with subtle scale - good for modals, cards */
|
|
169
|
+
fadeScale: {
|
|
170
|
+
initial: {
|
|
171
|
+
opacity: 0,
|
|
172
|
+
scale: .95
|
|
173
|
+
},
|
|
174
|
+
animate: {
|
|
175
|
+
opacity: 1,
|
|
176
|
+
scale: 1
|
|
177
|
+
},
|
|
178
|
+
exit: {
|
|
179
|
+
opacity: 0,
|
|
180
|
+
scale: .95
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
/** Fade with subtle slide up - good for content reveals */
|
|
184
|
+
fadeSlideUp: {
|
|
185
|
+
initial: {
|
|
186
|
+
opacity: 0,
|
|
187
|
+
y: 8
|
|
188
|
+
},
|
|
189
|
+
animate: {
|
|
190
|
+
opacity: 1,
|
|
191
|
+
y: 0
|
|
192
|
+
},
|
|
193
|
+
exit: {
|
|
194
|
+
opacity: 0,
|
|
195
|
+
y: -8
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
/** Fade with subtle slide down - good for dropdowns */
|
|
199
|
+
fadeSlideDown: {
|
|
200
|
+
initial: {
|
|
201
|
+
opacity: 0,
|
|
202
|
+
y: -8
|
|
203
|
+
},
|
|
204
|
+
animate: {
|
|
205
|
+
opacity: 1,
|
|
206
|
+
y: 0
|
|
207
|
+
},
|
|
208
|
+
exit: {
|
|
209
|
+
opacity: 0,
|
|
210
|
+
y: 8
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
/** Simple fade - for overlays */
|
|
214
|
+
fade: {
|
|
215
|
+
initial: { opacity: 0 },
|
|
216
|
+
animate: { opacity: 1 },
|
|
217
|
+
exit: { opacity: 0 }
|
|
218
|
+
},
|
|
219
|
+
/** Dock/floating element - scales from bottom */
|
|
220
|
+
floatUp: {
|
|
221
|
+
initial: {
|
|
222
|
+
opacity: 0,
|
|
223
|
+
y: 8,
|
|
224
|
+
scale: .98
|
|
225
|
+
},
|
|
226
|
+
animate: {
|
|
227
|
+
opacity: 1,
|
|
228
|
+
y: 0,
|
|
229
|
+
scale: 1
|
|
230
|
+
},
|
|
231
|
+
exit: {
|
|
232
|
+
opacity: 0,
|
|
233
|
+
y: 8,
|
|
234
|
+
scale: .98
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
//#endregion
|
|
240
|
+
export { variants as a, transitions as i, easings as n, springs as r, durations as t };
|
|
241
|
+
//# sourceMappingURL=motion-config-COsZ6azM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"motion-config-COsZ6azM.js","names":[],"sources":["../src/lib/motion/motion-config.ts"],"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"],"mappings":";;;;;;;;;;;;;;;;;AAsBA,MAAa,UAAU;;CAEtB,SAAS;EAAC;EAAM;EAAK;EAAM;CAAC;;CAG5B,QAAQ;EAAC;EAAM;EAAG;EAAG;CAAC;;CAGtB,WAAW;EAAC;EAAM;EAAG;EAAM;CAAC;;CAG5B,QAAQ;EAAC;EAAK;EAAG;EAAG;CAAC;;CAGrB,QAAQ;EAAC;EAAM;EAAM;EAAM;CAAC;;CAG5B,YAAY;EAAC;EAAK;EAAG;EAAK;CAAC;;CAG3B,cAAc;EAAC;EAAK;EAAG;EAAK;CAAC;AAC9B;;;;;AAUA,MAAa,YAAY;;CAExB,SAAS;;CAGT,MAAM;;CAGN,QAAQ;;CAGR,MAAM;;CAGN,YAAY;AACb;;;;;AAUA,MAAa,UAAU;;CAEtB,QAAQ;EACP,MAAM;EACN,WAAW;EACX,SAAS;EACT,MAAM;CACP;;CAGA,QAAQ;EACP,MAAM;EACN,WAAW;EACX,SAAS;EACT,MAAM;CACP;;CAGA,QAAQ;EACP,MAAM;EACN,WAAW;EACX,SAAS;EACT,MAAM;CACP;;CAGA,OAAO;EACN,MAAM;EACN,WAAW;EACX,SAAS;EACT,MAAM;CACP;;CAGA,OAAO;EACN,MAAM;EACN,WAAW;EACX,SAAS;CACV;AACD;;;;AASA,MAAa,cAAc;;CAE1B,MAAM;EACL,UAAU,UAAU;EACpB,MAAM,QAAQ;CACf;;CAGA,WAAW;EACV,UAAU,UAAU;EACpB,MAAM,QAAQ;CACf;;CAGA,QAAQ;EACP,UAAU,UAAU;EACpB,MAAM,QAAQ;CACf;;CAGA,OAAO;EACN,MAAM;EACN,WAAW;EACX,SAAS;CACV;;CAGA,MAAM;EACL,MAAM;EACN,UAAU,UAAU;EACpB,MAAM,QAAQ;CACf;;CAGA,QAAQ;EACP,MAAM;EACN,WAAW;EACX,SAAS;CACV;AACD;;;;;AAUA,MAAa,WAAW;;CAEvB,WAAW;EACV,SAAS;GAAE,SAAS;GAAG,OAAO;EAAK;EACnC,SAAS;GAAE,SAAS;GAAG,OAAO;EAAE;EAChC,MAAM;GAAE,SAAS;GAAG,OAAO;EAAK;CACjC;;CAGA,aAAa;EACZ,SAAS;GAAE,SAAS;GAAG,GAAG;EAAE;EAC5B,SAAS;GAAE,SAAS;GAAG,GAAG;EAAE;EAC5B,MAAM;GAAE,SAAS;GAAG,GAAG;EAAG;CAC3B;;CAGA,eAAe;EACd,SAAS;GAAE,SAAS;GAAG,GAAG;EAAG;EAC7B,SAAS;GAAE,SAAS;GAAG,GAAG;EAAE;EAC5B,MAAM;GAAE,SAAS;GAAG,GAAG;EAAE;CAC1B;;CAGA,MAAM;EACL,SAAS,EAAE,SAAS,EAAE;EACtB,SAAS,EAAE,SAAS,EAAE;EACtB,MAAM,EAAE,SAAS,EAAE;CACpB;;CAGA,SAAS;EACR,SAAS;GAAE,SAAS;GAAG,GAAG;GAAG,OAAO;EAAK;EACzC,SAAS;GAAE,SAAS;GAAG,GAAG;GAAG,OAAO;EAAE;EACtC,MAAM;GAAE,SAAS;GAAG,GAAG;GAAG,OAAO;EAAK;CACvC;AACD"}
|