@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
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
|
|
3
|
-
type LabelProps = React.ComponentProps<'label'>;
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
//#region src/components/label.d.ts
|
|
3
|
+
type LabelProps = React$1.ComponentProps<'label'>;
|
|
4
4
|
/**
|
|
5
5
|
* Label component for form controls.
|
|
6
6
|
* Uses a standard HTML label element for maximum compatibility.
|
|
7
7
|
*/
|
|
8
|
-
declare function Label({ className, ...props }: LabelProps): React.JSX.Element;
|
|
9
|
-
|
|
8
|
+
declare function Label({ className, ...props }: LabelProps): React$1.JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
10
|
export { Label, type LabelProps };
|
|
11
|
+
//# sourceMappingURL=label.d.cts.map
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
|
|
3
|
-
type LabelProps = React.ComponentProps<'label'>;
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
//#region src/components/label.d.ts
|
|
3
|
+
type LabelProps = React$1.ComponentProps<'label'>;
|
|
4
4
|
/**
|
|
5
5
|
* Label component for form controls.
|
|
6
6
|
* Uses a standard HTML label element for maximum compatibility.
|
|
7
7
|
*/
|
|
8
|
-
declare function Label({ className, ...props }: LabelProps): React.JSX.Element;
|
|
9
|
-
|
|
8
|
+
declare function Label({ className, ...props }: LabelProps): React$1.JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
10
|
export { Label, type LabelProps };
|
|
11
|
+
//# sourceMappingURL=label.d.ts.map
|
package/dist/components/label.js
CHANGED
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
import { clsx } from 'clsx';
|
|
3
|
-
import { twMerge } from 'tailwind-merge';
|
|
4
|
-
import { jsx } from 'react/jsx-runtime';
|
|
1
|
+
'use client';
|
|
5
2
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
3
|
+
import { t as cn } from "../utils-BkMLyah9.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/label.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Label component for form controls.
|
|
10
|
+
* Uses a standard HTML label element for maximum compatibility.
|
|
11
|
+
*/
|
|
9
12
|
function Label({ className, ...props }) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"data-slot": "label",
|
|
14
|
-
className: cn(
|
|
15
|
-
`text-foreground text-sm leading-4 font-medium select-none group-data-[disabled=true]:pointer-events-none
|
|
13
|
+
return /* @__PURE__ */ jsx("label", {
|
|
14
|
+
"data-slot": "label",
|
|
15
|
+
className: cn(`text-foreground text-sm leading-4 font-medium select-none group-data-[disabled=true]:pointer-events-none
|
|
16
16
|
group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50
|
|
17
|
-
data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
...props
|
|
21
|
-
}
|
|
22
|
-
);
|
|
17
|
+
data-[disabled]:pointer-events-none data-[disabled]:opacity-50`, className),
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
23
20
|
}
|
|
24
21
|
|
|
22
|
+
//#endregion
|
|
25
23
|
export { Label };
|
|
26
|
-
//# sourceMappingURL=label.js.map
|
|
27
24
|
//# sourceMappingURL=label.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"label.js","names":[],"sources":["../../src/components/label.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\ntype LabelProps = React.ComponentProps<'label'>;\n\n/**\n * Label component for form controls.\n * Uses a standard HTML label element for maximum compatibility.\n */\nfunction Label({ className, ...props }: LabelProps) {\n\treturn (\n\t\t<label\n\t\t\tdata-slot=\"label\"\n\t\t\tclassName={cn(\n\t\t\t\t`text-foreground text-sm leading-4 font-medium select-none group-data-[disabled=true]:pointer-events-none\n\t\t\t\tgroup-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50\n\t\t\t\tdata-[disabled]:pointer-events-none data-[disabled]:opacity-50`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Label };\nexport type { LabelProps };\n"],"mappings":";;;;;;;;;;;AAYA,SAAS,MAAM,EAAE,WAAW,GAAG,SAAqB;CACnD,OACC,oBAAC,SAAD;EACC,aAAU;EACV,WAAW,GACV;;qEAGA,SACD;EACA,GAAI;CACJ;AAEH"}
|
|
@@ -1,108 +1,68 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
1
|
+
'use client';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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 motion_react = require("motion/react");
|
|
9
11
|
|
|
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
|
-
const [cols, rows] = gridSize;
|
|
50
|
-
const frames = useLoadingFrames(cols, rows);
|
|
51
|
-
const [index, setIndex] = React__namespace.useState(0);
|
|
52
|
-
const intervalRef = React__namespace.useRef(null);
|
|
53
|
-
const prefersReducedMotion = react.useReducedMotion();
|
|
54
|
-
const shouldAnimate = animate && !prefersReducedMotion;
|
|
55
|
-
React__namespace.useEffect(() => {
|
|
56
|
-
if (!shouldAnimate || frames.length === 0) {
|
|
57
|
-
setIndex(0);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
intervalRef.current = setInterval(() => setIndex((i) => (i + 1) % frames.length), duration);
|
|
61
|
-
return () => clearInterval(intervalRef.current);
|
|
62
|
-
}, [frames.length, duration, shouldAnimate]);
|
|
63
|
-
const active = new Set(frames[index]?.map(([x, y]) => y * cols + x) ?? []);
|
|
64
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
65
|
-
"div",
|
|
66
|
-
{
|
|
67
|
-
className: cn("grid w-fit gap-0.5", className),
|
|
68
|
-
style: {
|
|
69
|
-
...style,
|
|
70
|
-
gridTemplateColumns: `repeat(${cols}, minmax(0, 1fr))`,
|
|
71
|
-
gridAutoRows: "1fr"
|
|
72
|
-
},
|
|
73
|
-
...props,
|
|
74
|
-
children: Array.from({ length: cols * rows }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
75
|
-
react.motion.div,
|
|
76
|
-
{
|
|
77
|
-
className: cn(
|
|
78
|
-
"aspect-square size-3 rounded-full",
|
|
79
|
-
active.has(i) ? cn("bg-primary scale-110", cellActiveClassName) : cn("bg-muted scale-100", cellInactiveClassName),
|
|
80
|
-
cellClassName
|
|
81
|
-
),
|
|
82
|
-
...cellProps,
|
|
83
|
-
transition: prefersReducedMotion ? { duration: 0 } : { duration: duration / 1e3, ease: easings.easeInOut }
|
|
84
|
-
},
|
|
85
|
-
i
|
|
86
|
-
))
|
|
87
|
-
}
|
|
88
|
-
);
|
|
12
|
+
//#region src/components/motion-grid.tsx
|
|
13
|
+
const MotionGrid = ({ gridSize, duration = 200, animate = true, cellClassName, cellProps, cellActiveClassName, cellInactiveClassName, className, style, ...props }) => {
|
|
14
|
+
const [cols, rows] = gridSize;
|
|
15
|
+
const frames = useLoadingFrames(cols, rows);
|
|
16
|
+
const [index, setIndex] = react.useState(0);
|
|
17
|
+
const intervalRef = react.useRef(null);
|
|
18
|
+
const prefersReducedMotion = (0, motion_react.useReducedMotion)();
|
|
19
|
+
const shouldAnimate = animate && !prefersReducedMotion;
|
|
20
|
+
react.useEffect(() => {
|
|
21
|
+
if (!shouldAnimate || frames.length === 0) {
|
|
22
|
+
setIndex(0);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
intervalRef.current = setInterval(() => setIndex((i) => (i + 1) % frames.length), duration);
|
|
26
|
+
return () => clearInterval(intervalRef.current);
|
|
27
|
+
}, [
|
|
28
|
+
frames.length,
|
|
29
|
+
duration,
|
|
30
|
+
shouldAnimate
|
|
31
|
+
]);
|
|
32
|
+
const active = new Set(frames[index]?.map(([x, y]) => y * cols + x) ?? []);
|
|
33
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
34
|
+
className: require_utils.cn("grid w-fit gap-0.5", className),
|
|
35
|
+
style: {
|
|
36
|
+
...style,
|
|
37
|
+
gridTemplateColumns: `repeat(${cols}, minmax(0, 1fr))`,
|
|
38
|
+
gridAutoRows: "1fr"
|
|
39
|
+
},
|
|
40
|
+
...props,
|
|
41
|
+
children: Array.from({ length: cols * rows }).map((_, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react.motion.div, {
|
|
42
|
+
className: require_utils.cn("aspect-square size-3 rounded-full", active.has(i) ? require_utils.cn("bg-primary scale-110", cellActiveClassName) : require_utils.cn("bg-muted scale-100", cellInactiveClassName), cellClassName),
|
|
43
|
+
...cellProps,
|
|
44
|
+
transition: prefersReducedMotion ? { duration: 0 } : {
|
|
45
|
+
duration: duration / 1e3,
|
|
46
|
+
ease: require_motion_config.easings.easeInOut
|
|
47
|
+
}
|
|
48
|
+
}, i))
|
|
49
|
+
});
|
|
89
50
|
};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
return loadingFrames;
|
|
51
|
+
const useLoadingFrames = (cols = 8, rows = 4) => {
|
|
52
|
+
return react.useMemo(() => {
|
|
53
|
+
const frames = [];
|
|
54
|
+
for (let s = 0; s < cols + rows; s++) {
|
|
55
|
+
const dots = [];
|
|
56
|
+
for (let y = 0; y < rows; y++) {
|
|
57
|
+
const x = s - y;
|
|
58
|
+
if (x >= 0 && x < cols) dots.push([x, y]);
|
|
59
|
+
}
|
|
60
|
+
frames.push(dots);
|
|
61
|
+
}
|
|
62
|
+
return frames;
|
|
63
|
+
}, [cols, rows]);
|
|
104
64
|
};
|
|
105
65
|
|
|
66
|
+
//#endregion
|
|
106
67
|
exports.MotionGrid = MotionGrid;
|
|
107
|
-
//# sourceMappingURL=motion-grid.cjs.map
|
|
108
68
|
//# sourceMappingURL=motion-grid.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/motion/motion-config.ts","../../src/lib/utils.ts","../../src/components/motion-grid.tsx"],"names":["twM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IAAA,GAAe,CAAA,EAAG,OAAe,CAAA,KAAM;AAEhE,EAAA,MAAM,aAAA,GAAsBH,yBAAgB,MAAM;AACjD,IAAA,MAAM,SAAiB,EAAC;AACxB,IAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,IAAA,GAAO,MAAM,CAAA,EAAA,EAAK;AACrC,MAAA,MAAM,OAA2B,EAAC;AAClC,MAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,IAAA,EAAM,CAAA,EAAA,EAAK;AAC9B,QAAA,MAAM,IAAI,CAAA,GAAI,CAAA;AACd,QAAA,IAAI,CAAA,IAAK,KAAK,CAAA,GAAI,IAAA,OAAW,IAAA,CAAK,CAAC,CAAA,EAAG,CAAC,CAAC,CAAA;AAAA,MACzC;AACA,MAAA,MAAA,CAAO,KAAK,IAAI,CAAA;AAAA,IACjB;AACA,IAAA,OAAO,MAAA;AAAA,EACR,CAAA,EAAG,CAAC,IAAA,EAAM,IAAI,CAAC,CAAA;AAEf,EAAA,OAAO,aAAA;AACR,CAAA","file":"motion-grid.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 * as React from 'react';\nimport { motion, type HTMLMotionProps, useReducedMotion } from 'motion/react';\n\nimport { easings } from '../lib/motion/motion-config';\nimport { cn } from '../lib/utils';\n\ntype FrameDot = [number, number];\ntype Frame = FrameDot[];\ntype Frames = Frame[];\n\ntype MotionGridProps = {\n\tgridSize: [number, number];\n\t/** Duration in milliseconds for each frame of the animation */\n\tduration?: number;\n\tanimate?: boolean;\n\tcellClassName?: string;\n\tcellProps?: HTMLMotionProps<'div'>;\n\tcellActiveClassName?: string;\n\tcellInactiveClassName?: string;\n} & React.ComponentProps<'div'>;\n\nconst MotionGrid = ({\n\tgridSize,\n\tduration = 200,\n\tanimate = true,\n\tcellClassName,\n\tcellProps,\n\tcellActiveClassName,\n\tcellInactiveClassName,\n\tclassName,\n\tstyle,\n\t...props\n}: MotionGridProps) => {\n\tconst [cols, rows] = gridSize;\n\tconst frames = useLoadingFrames(cols, rows);\n\tconst [index, setIndex] = React.useState(0);\n\tconst intervalRef = React.useRef<NodeJS.Timeout | null>(null);\n\tconst prefersReducedMotion = useReducedMotion();\n\tconst shouldAnimate = animate && !prefersReducedMotion;\n\n\tReact.useEffect(() => {\n\t\tif (!shouldAnimate || frames.length === 0) {\n\t\t\tsetIndex(0);\n\t\t\treturn;\n\t\t}\n\t\tintervalRef.current = setInterval(() => setIndex((i) => (i + 1) % frames.length), duration);\n\t\treturn () => clearInterval(intervalRef.current!);\n\t}, [frames.length, duration, shouldAnimate]);\n\n\tconst active = new Set<number>(frames[index]?.map(([x, y]) => y * cols + x) ?? []);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn('grid w-fit gap-0.5', className)}\n\t\t\tstyle={{\n\t\t\t\t...style,\n\t\t\t\tgridTemplateColumns: `repeat(${cols}, minmax(0, 1fr))`,\n\t\t\t\tgridAutoRows: '1fr',\n\t\t\t}}\n\t\t\t{...props}\n\t\t>\n\t\t\t{Array.from({ length: cols * rows }).map((_, i) => (\n\t\t\t\t<motion.div\n\t\t\t\t\tkey={i}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'aspect-square size-3 rounded-full',\n\t\t\t\t\t\tactive.has(i)\n\t\t\t\t\t\t\t? cn('bg-primary scale-110', cellActiveClassName)\n\t\t\t\t\t\t\t: cn('bg-muted scale-100', cellInactiveClassName),\n\t\t\t\t\t\tcellClassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...cellProps}\n\t\t\t\t\t// Convert ms to seconds for motion library\n\t\t\t\t\ttransition={prefersReducedMotion ? { duration: 0 } : { duration: duration / 1000, ease: easings.easeInOut }}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</div>\n\t);\n};\n\nconst useLoadingFrames = (cols: number = 8, rows: number = 4) => {\n\t// Animated loading pattern for the preview area using MotionGrid\n\tconst loadingFrames = React.useMemo<Frames>(() => {\n\t\tconst frames: Frames = [];\n\t\tfor (let s = 0; s < cols + rows; s++) {\n\t\t\tconst dots: [number, number][] = [];\n\t\t\tfor (let y = 0; y < rows; y++) {\n\t\t\t\tconst x = s - y;\n\t\t\t\tif (x >= 0 && x < cols) dots.push([x, y]);\n\t\t\t}\n\t\t\tframes.push(dots);\n\t\t}\n\t\treturn frames;\n\t}, [cols, rows]);\n\n\treturn loadingFrames;\n};\n\nexport { MotionGrid, type MotionGridProps, type FrameDot, type Frame, type Frames };\n"]}
|
|
1
|
+
{"version":3,"file":"motion-grid.cjs","names":["React","cn","motion","easings"],"sources":["../../src/components/motion-grid.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { motion, type HTMLMotionProps, useReducedMotion } from 'motion/react';\n\nimport { easings } from '../lib/motion/motion-config';\nimport { cn } from '../lib/utils';\n\ntype FrameDot = [number, number];\ntype Frame = FrameDot[];\ntype Frames = Frame[];\n\ntype MotionGridProps = {\n\tgridSize: [number, number];\n\t/** Duration in milliseconds for each frame of the animation */\n\tduration?: number;\n\tanimate?: boolean;\n\tcellClassName?: string;\n\tcellProps?: HTMLMotionProps<'div'>;\n\tcellActiveClassName?: string;\n\tcellInactiveClassName?: string;\n} & React.ComponentProps<'div'>;\n\nconst MotionGrid = ({\n\tgridSize,\n\tduration = 200,\n\tanimate = true,\n\tcellClassName,\n\tcellProps,\n\tcellActiveClassName,\n\tcellInactiveClassName,\n\tclassName,\n\tstyle,\n\t...props\n}: MotionGridProps) => {\n\tconst [cols, rows] = gridSize;\n\tconst frames = useLoadingFrames(cols, rows);\n\tconst [index, setIndex] = React.useState(0);\n\tconst intervalRef = React.useRef<NodeJS.Timeout | null>(null);\n\tconst prefersReducedMotion = useReducedMotion();\n\tconst shouldAnimate = animate && !prefersReducedMotion;\n\n\tReact.useEffect(() => {\n\t\tif (!shouldAnimate || frames.length === 0) {\n\t\t\tsetIndex(0);\n\t\t\treturn;\n\t\t}\n\t\tintervalRef.current = setInterval(() => setIndex((i) => (i + 1) % frames.length), duration);\n\t\treturn () => clearInterval(intervalRef.current!);\n\t}, [frames.length, duration, shouldAnimate]);\n\n\tconst active = new Set<number>(frames[index]?.map(([x, y]) => y * cols + x) ?? []);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn('grid w-fit gap-0.5', className)}\n\t\t\tstyle={{\n\t\t\t\t...style,\n\t\t\t\tgridTemplateColumns: `repeat(${cols}, minmax(0, 1fr))`,\n\t\t\t\tgridAutoRows: '1fr',\n\t\t\t}}\n\t\t\t{...props}\n\t\t>\n\t\t\t{Array.from({ length: cols * rows }).map((_, i) => (\n\t\t\t\t<motion.div\n\t\t\t\t\tkey={i}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'aspect-square size-3 rounded-full',\n\t\t\t\t\t\tactive.has(i)\n\t\t\t\t\t\t\t? cn('bg-primary scale-110', cellActiveClassName)\n\t\t\t\t\t\t\t: cn('bg-muted scale-100', cellInactiveClassName),\n\t\t\t\t\t\tcellClassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...cellProps}\n\t\t\t\t\t// Convert ms to seconds for motion library\n\t\t\t\t\ttransition={prefersReducedMotion ? { duration: 0 } : { duration: duration / 1000, ease: easings.easeInOut }}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</div>\n\t);\n};\n\nconst useLoadingFrames = (cols: number = 8, rows: number = 4) => {\n\t// Animated loading pattern for the preview area using MotionGrid\n\tconst loadingFrames = React.useMemo<Frames>(() => {\n\t\tconst frames: Frames = [];\n\t\tfor (let s = 0; s < cols + rows; s++) {\n\t\t\tconst dots: [number, number][] = [];\n\t\t\tfor (let y = 0; y < rows; y++) {\n\t\t\t\tconst x = s - y;\n\t\t\t\tif (x >= 0 && x < cols) dots.push([x, y]);\n\t\t\t}\n\t\t\tframes.push(dots);\n\t\t}\n\t\treturn frames;\n\t}, [cols, rows]);\n\n\treturn loadingFrames;\n};\n\nexport { MotionGrid, type MotionGridProps, type FrameDot, type Frame, type Frames };\n"],"mappings":";;;;;;;;;;;;AAuBA,MAAM,cAAc,EACnB,UACA,WAAW,KACX,UAAU,MACV,eACA,WACA,qBACA,uBACA,WACA,OACA,GAAG,YACmB;CACtB,MAAM,CAAC,MAAM,QAAQ;CACrB,MAAM,SAAS,iBAAiB,MAAM,IAAI;CAC1C,MAAM,CAAC,OAAO,YAAYA,MAAM,SAAS,CAAC;CAC1C,MAAM,cAAcA,MAAM,OAA8B,IAAI;CAC5D,MAAM,0DAAwC;CAC9C,MAAM,gBAAgB,WAAW,CAAC;CAElC,MAAM,gBAAgB;EACrB,IAAI,CAAC,iBAAiB,OAAO,WAAW,GAAG;G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import * as React from
|
|
2
|
-
import { HTMLMotionProps } from
|
|
3
|
-
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { HTMLMotionProps } from "motion/react";
|
|
3
|
+
//#region src/components/motion-grid.d.ts
|
|
4
4
|
type FrameDot = [number, number];
|
|
5
5
|
type Frame = FrameDot[];
|
|
6
6
|
type Frames = Frame[];
|
|
7
7
|
type MotionGridProps = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} & React.ComponentProps<'div'>;
|
|
17
|
-
declare const MotionGrid: ({ gridSize, duration, animate, cellClassName, cellProps, cellActiveClassName, cellInactiveClassName, className, style, ...props }: MotionGridProps) => React.JSX.Element;
|
|
18
|
-
|
|
8
|
+
gridSize: [number, number];
|
|
9
|
+
/** Duration in milliseconds for each frame of the animation */
|
|
10
|
+
duration?: number;
|
|
11
|
+
animate?: boolean;
|
|
12
|
+
cellClassName?: string;
|
|
13
|
+
cellProps?: HTMLMotionProps<'div'>;
|
|
14
|
+
cellActiveClassName?: string;
|
|
15
|
+
cellInactiveClassName?: string;
|
|
16
|
+
} & React$1.ComponentProps<'div'>;
|
|
17
|
+
declare const MotionGrid: ({ gridSize, duration, animate, cellClassName, cellProps, cellActiveClassName, cellInactiveClassName, className, style, ...props }: MotionGridProps) => React$1.JSX.Element;
|
|
18
|
+
//#endregion
|
|
19
19
|
export { type Frame, type FrameDot, type Frames, MotionGrid, type MotionGridProps };
|
|
20
|
+
//# sourceMappingURL=motion-grid.d.cts.map
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { HTMLMotionProps } from
|
|
3
|
-
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { HTMLMotionProps } from "motion/react";
|
|
3
|
+
//#region src/components/motion-grid.d.ts
|
|
4
4
|
type FrameDot = [number, number];
|
|
5
5
|
type Frame = FrameDot[];
|
|
6
6
|
type Frames = Frame[];
|
|
7
7
|
type MotionGridProps = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} & React.ComponentProps<'div'>;
|
|
17
|
-
declare const MotionGrid: ({ gridSize, duration, animate, cellClassName, cellProps, cellActiveClassName, cellInactiveClassName, className, style, ...props }: MotionGridProps) => React.JSX.Element;
|
|
18
|
-
|
|
8
|
+
gridSize: [number, number];
|
|
9
|
+
/** Duration in milliseconds for each frame of the animation */
|
|
10
|
+
duration?: number;
|
|
11
|
+
animate?: boolean;
|
|
12
|
+
cellClassName?: string;
|
|
13
|
+
cellProps?: HTMLMotionProps<'div'>;
|
|
14
|
+
cellActiveClassName?: string;
|
|
15
|
+
cellInactiveClassName?: string;
|
|
16
|
+
} & React$1.ComponentProps<'div'>;
|
|
17
|
+
declare const MotionGrid: ({ gridSize, duration, animate, cellClassName, cellProps, cellActiveClassName, cellInactiveClassName, className, style, ...props }: MotionGridProps) => React$1.JSX.Element;
|
|
18
|
+
//#endregion
|
|
19
19
|
export { type Frame, type FrameDot, type Frames, MotionGrid, type MotionGridProps };
|
|
20
|
+
//# sourceMappingURL=motion-grid.d.ts.map
|
|
@@ -1,86 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { useReducedMotion, motion } from 'motion/react';
|
|
4
|
-
import { clsx } from 'clsx';
|
|
5
|
-
import { twMerge } from 'tailwind-merge';
|
|
6
|
-
import { jsx } from 'react/jsx-runtime';
|
|
1
|
+
'use client';
|
|
7
2
|
|
|
8
|
-
|
|
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
|
-
|
|
52
|
-
children: Array.from({ length: cols * rows }).map((_, i) => /* @__PURE__ */ jsx(
|
|
53
|
-
motion.div,
|
|
54
|
-
{
|
|
55
|
-
className: cn(
|
|
56
|
-
"aspect-square size-3 rounded-full",
|
|
57
|
-
active.has(i) ? cn("bg-primary scale-110", cellActiveClassName) : cn("bg-muted scale-100", cellInactiveClassName),
|
|
58
|
-
cellClassName
|
|
59
|
-
),
|
|
60
|
-
...cellProps,
|
|
61
|
-
transition: prefersReducedMotion ? { duration: 0 } : { duration: duration / 1e3, ease: easings.easeInOut }
|
|
62
|
-
},
|
|
63
|
-
i
|
|
64
|
-
))
|
|
65
|
-
}
|
|
66
|
-
);
|
|
3
|
+
import { t as cn } from "../utils-BkMLyah9.js";
|
|
4
|
+
import { n as easings } from "../motion-config-COsZ6azM.js";
|
|
5
|
+
import * as React$1 from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { motion, useReducedMotion } from "motion/react";
|
|
8
|
+
|
|
9
|
+
//#region src/components/motion-grid.tsx
|
|
10
|
+
const MotionGrid = ({ gridSize, duration = 200, animate = true, cellClassName, cellProps, cellActiveClassName, cellInactiveClassName, className, style, ...props }) => {
|
|
11
|
+
const [cols, rows] = gridSize;
|
|
12
|
+
const frames = useLoadingFrames(cols, rows);
|
|
13
|
+
const [index, setIndex] = React$1.useState(0);
|
|
14
|
+
const intervalRef = React$1.useRef(null);
|
|
15
|
+
const prefersReducedMotion = useReducedMotion();
|
|
16
|
+
const shouldAnimate = animate && !prefersReducedMotion;
|
|
17
|
+
React$1.useEffect(() => {
|
|
18
|
+
if (!shouldAnimate || frames.length === 0) {
|
|
19
|
+
setIndex(0);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
intervalRef.current = setInterval(() => setIndex((i) => (i + 1) % frames.length), duration);
|
|
23
|
+
return () => clearInterval(intervalRef.current);
|
|
24
|
+
}, [
|
|
25
|
+
frames.length,
|
|
26
|
+
duration,
|
|
27
|
+
shouldAnimate
|
|
28
|
+
]);
|
|
29
|
+
const active = new Set(frames[index]?.map(([x, y]) => y * cols + x) ?? []);
|
|
30
|
+
return /* @__PURE__ */ jsx("div", {
|
|
31
|
+
className: cn("grid w-fit gap-0.5", className),
|
|
32
|
+
style: {
|
|
33
|
+
...style,
|
|
34
|
+
gridTemplateColumns: `repeat(${cols}, minmax(0, 1fr))`,
|
|
35
|
+
gridAutoRows: "1fr"
|
|
36
|
+
},
|
|
37
|
+
...props,
|
|
38
|
+
children: Array.from({ length: cols * rows }).map((_, i) => /* @__PURE__ */ jsx(motion.div, {
|
|
39
|
+
className: cn("aspect-square size-3 rounded-full", active.has(i) ? cn("bg-primary scale-110", cellActiveClassName) : cn("bg-muted scale-100", cellInactiveClassName), cellClassName),
|
|
40
|
+
...cellProps,
|
|
41
|
+
transition: prefersReducedMotion ? { duration: 0 } : {
|
|
42
|
+
duration: duration / 1e3,
|
|
43
|
+
ease: easings.easeInOut
|
|
44
|
+
}
|
|
45
|
+
}, i))
|
|
46
|
+
});
|
|
67
47
|
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return loadingFrames;
|
|
48
|
+
const useLoadingFrames = (cols = 8, rows = 4) => {
|
|
49
|
+
return React$1.useMemo(() => {
|
|
50
|
+
const frames = [];
|
|
51
|
+
for (let s = 0; s < cols + rows; s++) {
|
|
52
|
+
const dots = [];
|
|
53
|
+
for (let y = 0; y < rows; y++) {
|
|
54
|
+
const x = s - y;
|
|
55
|
+
if (x >= 0 && x < cols) dots.push([x, y]);
|
|
56
|
+
}
|
|
57
|
+
frames.push(dots);
|
|
58
|
+
}
|
|
59
|
+
return frames;
|
|
60
|
+
}, [cols, rows]);
|
|
82
61
|
};
|
|
83
62
|
|
|
63
|
+
//#endregion
|
|
84
64
|
export { MotionGrid };
|
|
85
|
-
//# sourceMappingURL=motion-grid.js.map
|
|
86
65
|
//# sourceMappingURL=motion-grid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/motion/motion-config.ts","../../src/lib/utils.ts","../../src/components/motion-grid.tsx"],"names":[],"mappings":";;;;;;;AAsBO,IAAM,OAAA,GAAU;AAAA,EAKA;AAAA,EAGtB,SAAA,EAAW,CAAC,IAAA,EAAM,CAAA,EAAG,MAAM,CAAC,CAa7B,CAAA;ACxCO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACkBA,IAAM,aAAa,CAAC;AAAA,EACnB,QAAA;AAAA,EACA,QAAA,GAAW,GAAA;AAAA,EACX,OAAA,GAAU,IAAA;AAAA,EACV,aAAA;AAAA,EACA,SAAA;AAAA,EACA,mBAAA;AAAA,EACA,qBAAA;AAAA,EACA,SAAA;AAAA,EACA,KAAA;AAAA,EACA,GAAG;AACJ,CAAA,KAAuB;AACtB,EAAA,MAAM,CAAC,IAAA,EAAM,IAAI,CAAA,GAAI,QAAA;AACrB,EAAA,MAAM,MAAA,GAAS,gBAAA,CAAiB,IAAA,EAAM,IAAI,CAAA;AAC1C,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAU,eAAS,CAAC,CAAA;AAC1C,EAAA,MAAM,WAAA,GAAoB,aAA8B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EAAA;AAAA,YACV,mCAAA;AAAA,YACA,MAAA,CAAO,GAAA,CAAI,CAAC,CAAA,GACT,EAAA,CAAG,wBAAwB,mBAAmB,CAAA,GAC9C,EAAA,CAAG,oBAAA,EAAsB,qBAAqB,CAAA;AAAA,YACjD;AAAA,WACD;AAAA,UACC,GAAG,SAAA;AAAA,UAEJ,UAAA,EAAY,oBAAA,GAAuB,EAAE,QAAA,EAAU,CAAA,EAAE,GAAI,EAAE,QAAA,EAAU,QAAA,GAAW,GAAA,EAAM,IAAA,EAAM,OAAA,CAAQ,SAAA;AAAU,SAAA;AAAA,QAVrG;AAAA,OAYN;AAAA;AAAA,GACF;AAEF;AAEA,IAAM,gBAAA,GAAmB,CAAC,IAAA,GAAe,CAAA,EAAG,OAAe,CAAA,KAAM;AAEhE,EAAA,MAAM,aAAA,GAAsB,cAAgB,MAAM;AACjD,IAAA,MAAM,SAAiB,EAAC;AACxB,IAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,IAAA,GAAO,MAAM,CAAA,EAAA,EAAK;AACrC,MAAA,MAAM,OAA2B,EAAC;AAClC,MAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,IAAA,EAAM,CAAA,EAAA,EAAK;AAC9B,QAAA,MAAM,IAAI,CAAA,GAAI,CAAA;AACd,QAAA,IAAI,CAAA,IAAK,KAAK,CAAA,GAAI,IAAA,OAAW,IAAA,CAAK,CAAC,CAAA,EAAG,CAAC,CAAC,CAAA;AAAA,MACzC;AACA,MAAA,MAAA,CAAO,KAAK,IAAI,CAAA;AAAA,IACjB;AACA,IAAA,OAAO,MAAA;AAAA,EACR,CAAA,EAAG,CAAC,IAAA,EAAM,IAAI,CAAC,CAAA;AAEf,EAAA,OAAO,aAAA;AACR,CAAA","file":"motion-grid.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 * as React from 'react';\nimport { motion, type HTMLMotionProps, useReducedMotion } from 'motion/react';\n\nimport { easings } from '../lib/motion/motion-config';\nimport { cn } from '../lib/utils';\n\ntype FrameDot = [number, number];\ntype Frame = FrameDot[];\ntype Frames = Frame[];\n\ntype MotionGridProps = {\n\tgridSize: [number, number];\n\t/** Duration in milliseconds for each frame of the animation */\n\tduration?: number;\n\tanimate?: boolean;\n\tcellClassName?: string;\n\tcellProps?: HTMLMotionProps<'div'>;\n\tcellActiveClassName?: string;\n\tcellInactiveClassName?: string;\n} & React.ComponentProps<'div'>;\n\nconst MotionGrid = ({\n\tgridSize,\n\tduration = 200,\n\tanimate = true,\n\tcellClassName,\n\tcellProps,\n\tcellActiveClassName,\n\tcellInactiveClassName,\n\tclassName,\n\tstyle,\n\t...props\n}: MotionGridProps) => {\n\tconst [cols, rows] = gridSize;\n\tconst frames = useLoadingFrames(cols, rows);\n\tconst [index, setIndex] = React.useState(0);\n\tconst intervalRef = React.useRef<NodeJS.Timeout | null>(null);\n\tconst prefersReducedMotion = useReducedMotion();\n\tconst shouldAnimate = animate && !prefersReducedMotion;\n\n\tReact.useEffect(() => {\n\t\tif (!shouldAnimate || frames.length === 0) {\n\t\t\tsetIndex(0);\n\t\t\treturn;\n\t\t}\n\t\tintervalRef.current = setInterval(() => setIndex((i) => (i + 1) % frames.length), duration);\n\t\treturn () => clearInterval(intervalRef.current!);\n\t}, [frames.length, duration, shouldAnimate]);\n\n\tconst active = new Set<number>(frames[index]?.map(([x, y]) => y * cols + x) ?? []);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn('grid w-fit gap-0.5', className)}\n\t\t\tstyle={{\n\t\t\t\t...style,\n\t\t\t\tgridTemplateColumns: `repeat(${cols}, minmax(0, 1fr))`,\n\t\t\t\tgridAutoRows: '1fr',\n\t\t\t}}\n\t\t\t{...props}\n\t\t>\n\t\t\t{Array.from({ length: cols * rows }).map((_, i) => (\n\t\t\t\t<motion.div\n\t\t\t\t\tkey={i}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'aspect-square size-3 rounded-full',\n\t\t\t\t\t\tactive.has(i)\n\t\t\t\t\t\t\t? cn('bg-primary scale-110', cellActiveClassName)\n\t\t\t\t\t\t\t: cn('bg-muted scale-100', cellInactiveClassName),\n\t\t\t\t\t\tcellClassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...cellProps}\n\t\t\t\t\t// Convert ms to seconds for motion library\n\t\t\t\t\ttransition={prefersReducedMotion ? { duration: 0 } : { duration: duration / 1000, ease: easings.easeInOut }}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</div>\n\t);\n};\n\nconst useLoadingFrames = (cols: number = 8, rows: number = 4) => {\n\t// Animated loading pattern for the preview area using MotionGrid\n\tconst loadingFrames = React.useMemo<Frames>(() => {\n\t\tconst frames: Frames = [];\n\t\tfor (let s = 0; s < cols + rows; s++) {\n\t\t\tconst dots: [number, number][] = [];\n\t\t\tfor (let y = 0; y < rows; y++) {\n\t\t\t\tconst x = s - y;\n\t\t\t\tif (x >= 0 && x < cols) dots.push([x, y]);\n\t\t\t}\n\t\t\tframes.push(dots);\n\t\t}\n\t\treturn frames;\n\t}, [cols, rows]);\n\n\treturn loadingFrames;\n};\n\nexport { MotionGrid, type MotionGridProps, type FrameDot, type Frame, type Frames };\n"]}
|
|
1
|
+
{"version":3,"file":"motion-grid.js","names":["React"],"sources":["../../src/components/motion-grid.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { motion, type HTMLMotionProps, useReducedMotion } from 'motion/react';\n\nimport { easings } from '../lib/motion/motion-config';\nimport { cn } from '../lib/utils';\n\ntype FrameDot = [number, number];\ntype Frame = FrameDot[];\ntype Frames = Frame[];\n\ntype MotionGridProps = {\n\tgridSize: [number, number];\n\t/** Duration in milliseconds for each frame of the animation */\n\tduration?: number;\n\tanimate?: boolean;\n\tcellClassName?: string;\n\tcellProps?: HTMLMotionProps<'div'>;\n\tcellActiveClassName?: string;\n\tcellInactiveClassName?: string;\n} & React.ComponentProps<'div'>;\n\nconst MotionGrid = ({\n\tgridSize,\n\tduration = 200,\n\tanimate = true,\n\tcellClassName,\n\tcellProps,\n\tcellActiveClassName,\n\tcellInactiveClassName,\n\tclassName,\n\tstyle,\n\t...props\n}: MotionGridProps) => {\n\tconst [cols, rows] = gridSize;\n\tconst frames = useLoadingFrames(cols, rows);\n\tconst [index, setIndex] = React.useState(0);\n\tconst intervalRef = React.useRef<NodeJS.Timeout | null>(null);\n\tconst prefersReducedMotion = useReducedMotion();\n\tconst shouldAnimate = animate && !prefersReducedMotion;\n\n\tReact.useEffect(() => {\n\t\tif (!shouldAnimate || frames.length === 0) {\n\t\t\tsetIndex(0);\n\t\t\treturn;\n\t\t}\n\t\tintervalRef.current = setInterval(() => setIndex((i) => (i + 1) % frames.length), duration);\n\t\treturn () => clearInterval(intervalRef.current!);\n\t}, [frames.length, duration, shouldAnimate]);\n\n\tconst active = new Set<number>(frames[index]?.map(([x, y]) => y * cols + x) ?? []);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn('grid w-fit gap-0.5', className)}\n\t\t\tstyle={{\n\t\t\t\t...style,\n\t\t\t\tgridTemplateColumns: `repeat(${cols}, minmax(0, 1fr))`,\n\t\t\t\tgridAutoRows: '1fr',\n\t\t\t}}\n\t\t\t{...props}\n\t\t>\n\t\t\t{Array.from({ length: cols * rows }).map((_, i) => (\n\t\t\t\t<motion.div\n\t\t\t\t\tkey={i}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'aspect-square size-3 rounded-full',\n\t\t\t\t\t\tactive.has(i)\n\t\t\t\t\t\t\t? cn('bg-primary scale-110', cellActiveClassName)\n\t\t\t\t\t\t\t: cn('bg-muted scale-100', cellInactiveClassName),\n\t\t\t\t\t\tcellClassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...cellProps}\n\t\t\t\t\t// Convert ms to seconds for motion library\n\t\t\t\t\ttransition={prefersReducedMotion ? { duration: 0 } : { duration: duration / 1000, ease: easings.easeInOut }}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</div>\n\t);\n};\n\nconst useLoadingFrames = (cols: number = 8, rows: number = 4) => {\n\t// Animated loading pattern for the preview area using MotionGrid\n\tconst loadingFrames = React.useMemo<Frames>(() => {\n\t\tconst frames: Frames = [];\n\t\tfor (let s = 0; s < cols + rows; s++) {\n\t\t\tconst dots: [number, number][] = [];\n\t\t\tfor (let y = 0; y < rows; y++) {\n\t\t\t\tconst x = s - y;\n\t\t\t\tif (x >= 0 && x < cols) dots.push([x, y]);\n\t\t\t}\n\t\t\tframes.push(dots);\n\t\t}\n\t\treturn frames;\n\t}, [cols, rows]);\n\n\treturn loadingFrames;\n};\n\nexport { MotionGrid, type Motion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