@constructive-io/ui 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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-CPy_fibW.cjs +608 -0
- package/dist/sidebar-CPy_fibW.cjs.map +1 -0
- package/dist/sidebar-Cfax0g0_.js +463 -0
- package/dist/sidebar-Cfax0g0_.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,31 +1,32 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
|
|
3
|
-
interface StepperProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
//#region src/components/stepper.d.ts
|
|
3
|
+
interface StepperProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
defaultValue?: number;
|
|
5
|
+
value?: number;
|
|
6
|
+
onValueChange?: (value: number) => void;
|
|
7
|
+
orientation?: 'horizontal' | 'vertical';
|
|
8
8
|
}
|
|
9
|
-
declare function Stepper({ defaultValue, value, onValueChange, orientation, className, ...props }: StepperProps): React.JSX.Element;
|
|
10
|
-
interface StepperItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
declare function Stepper({ defaultValue, value, onValueChange, orientation, className, ...props }: StepperProps): React$1.JSX.Element;
|
|
10
|
+
interface StepperItemProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
11
|
+
step: number;
|
|
12
|
+
completed?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
loading?: boolean;
|
|
15
15
|
}
|
|
16
|
-
declare function StepperItem({ step, completed, disabled, loading, className, children, ...props }: StepperItemProps): React.JSX.Element;
|
|
17
|
-
interface StepperTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
declare function StepperItem({ step, completed, disabled, loading, className, children, ...props }: StepperItemProps): React$1.JSX.Element;
|
|
17
|
+
interface StepperTriggerProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
18
|
+
asChild?: boolean;
|
|
19
|
+
/** Disables hover and press scaling when motion would distract. */
|
|
20
|
+
static?: boolean;
|
|
21
21
|
}
|
|
22
|
-
declare function StepperTrigger({ asChild, static: isStatic, className, children, ...props }: StepperTriggerProps): React.JSX.Element;
|
|
23
|
-
interface StepperIndicatorProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
24
|
-
|
|
22
|
+
declare function StepperTrigger({ asChild, static: isStatic, className, children, ...props }: StepperTriggerProps): React$1.JSX.Element;
|
|
23
|
+
interface StepperIndicatorProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
24
|
+
asChild?: boolean;
|
|
25
25
|
}
|
|
26
|
-
declare function StepperIndicator({ asChild, className, children, ...props }: StepperIndicatorProps): React.JSX.Element;
|
|
27
|
-
declare function StepperTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>): React.JSX.Element;
|
|
28
|
-
declare function StepperDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>): React.JSX.Element;
|
|
29
|
-
declare function StepperSeparator({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
30
|
-
|
|
26
|
+
declare function StepperIndicator({ asChild, className, children, ...props }: StepperIndicatorProps): React$1.JSX.Element;
|
|
27
|
+
declare function StepperTitle({ className, ...props }: React$1.HTMLAttributes<HTMLHeadingElement>): React$1.JSX.Element;
|
|
28
|
+
declare function StepperDescription({ className, ...props }: React$1.HTMLAttributes<HTMLParagraphElement>): React$1.JSX.Element;
|
|
29
|
+
declare function StepperSeparator({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): React$1.JSX.Element;
|
|
30
|
+
//#endregion
|
|
31
31
|
export { Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger };
|
|
32
|
+
//# sourceMappingURL=stepper.d.ts.map
|
|
@@ -1,287 +1,152 @@
|
|
|
1
|
-
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { createContext, useContext } from 'react';
|
|
4
|
-
import { CheckIcon, LoaderCircleIcon } from 'lucide-react';
|
|
5
|
-
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
6
|
-
import { clsx } from 'clsx';
|
|
7
|
-
import { twMerge } from 'tailwind-merge';
|
|
1
|
+
'use client';
|
|
8
2
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (/^on[A-Z]/.test(propName) && typeof slotPropValue === "function" && typeof childPropValue === "function") {
|
|
27
|
-
overrideProps[propName] = (...args) => {
|
|
28
|
-
childPropValue(...args);
|
|
29
|
-
slotPropValue(...args);
|
|
30
|
-
};
|
|
31
|
-
} else if (propName === "className" && typeof slotPropValue === "string" && typeof childPropValue === "string") {
|
|
32
|
-
overrideProps[propName] = `${slotPropValue} ${childPropValue}`.trim();
|
|
33
|
-
} else if (propName === "style" && typeof slotPropValue === "object" && typeof childPropValue === "object") {
|
|
34
|
-
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return { ...slotProps, ...overrideProps };
|
|
38
|
-
}
|
|
39
|
-
function isSlottable(child) {
|
|
40
|
-
return React.isValidElement(child);
|
|
41
|
-
}
|
|
42
|
-
var Slot = React.forwardRef((props, forwardedRef) => {
|
|
43
|
-
const { children, ...slotProps } = props;
|
|
44
|
-
if (isSlottable(children)) {
|
|
45
|
-
const childProps = children.props;
|
|
46
|
-
const childRef = childProps.ref;
|
|
47
|
-
return React.cloneElement(children, {
|
|
48
|
-
...mergeProps(slotProps, childProps),
|
|
49
|
-
ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
if (React.Children.count(children) > 1) {
|
|
53
|
-
const childrenArray = React.Children.toArray(children);
|
|
54
|
-
const slottableChild = childrenArray.find(
|
|
55
|
-
(child) => React.isValidElement(child) && child.type === Slottable
|
|
56
|
-
);
|
|
57
|
-
if (slottableChild) {
|
|
58
|
-
const newElement = slottableChild.props.children;
|
|
59
|
-
if (isSlottable(newElement)) {
|
|
60
|
-
const newElementProps = newElement.props;
|
|
61
|
-
const newChildren = childrenArray.map((child) => {
|
|
62
|
-
if (child === slottableChild) {
|
|
63
|
-
return React.Children.count(newElementProps.children) > 1 ? React.Children.only(null) : newElementProps.children;
|
|
64
|
-
}
|
|
65
|
-
return child;
|
|
66
|
-
});
|
|
67
|
-
const childRef = newElementProps.ref;
|
|
68
|
-
return React.cloneElement(newElement, {
|
|
69
|
-
...mergeProps(slotProps, newElementProps),
|
|
70
|
-
ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,
|
|
71
|
-
children: newChildren
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
77
|
-
});
|
|
78
|
-
Slot.displayName = "Slot";
|
|
79
|
-
function Slottable({ children }) {
|
|
80
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
81
|
-
}
|
|
82
|
-
function cn(...inputs) {
|
|
83
|
-
return twMerge(clsx(inputs));
|
|
84
|
-
}
|
|
85
|
-
var StepperContext = createContext(void 0);
|
|
86
|
-
var StepItemContext = createContext(void 0);
|
|
87
|
-
var iconSwapClass = "transition-[opacity,scale,filter] duration-300 ease-[cubic-bezier(0.2,0,0,1)] motion-reduce:transition-none";
|
|
88
|
-
var iconSwapVisible = "scale-100 opacity-100 blur-0";
|
|
89
|
-
var iconSwapHidden = "scale-[0.25] opacity-0 blur-[4px]";
|
|
90
|
-
var useStepper = () => {
|
|
91
|
-
const context = useContext(StepperContext);
|
|
92
|
-
if (!context) {
|
|
93
|
-
throw new Error("useStepper must be used within a Stepper");
|
|
94
|
-
}
|
|
95
|
-
return context;
|
|
3
|
+
import { t as cn } from "../utils-BkMLyah9.js";
|
|
4
|
+
import { t as Slot } from "../slot-EL8zfLG0.js";
|
|
5
|
+
import * as React$1 from "react";
|
|
6
|
+
import { createContext, useContext } from "react";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { CheckIcon, LoaderCircleIcon } from "lucide-react";
|
|
9
|
+
|
|
10
|
+
//#region src/components/stepper.tsx
|
|
11
|
+
const StepperContext = createContext(void 0);
|
|
12
|
+
const StepItemContext = createContext(void 0);
|
|
13
|
+
const iconSwapClass = "transition-[opacity,scale,filter] duration-300 ease-[cubic-bezier(0.2,0,0,1)] motion-reduce:transition-none";
|
|
14
|
+
const iconSwapVisible = "scale-100 opacity-100 blur-0";
|
|
15
|
+
const iconSwapHidden = "scale-[0.25] opacity-0 blur-[4px]";
|
|
16
|
+
const useStepper = () => {
|
|
17
|
+
const context = useContext(StepperContext);
|
|
18
|
+
if (!context) throw new Error("useStepper must be used within a Stepper");
|
|
19
|
+
return context;
|
|
96
20
|
};
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
return context;
|
|
21
|
+
const useStepItem = () => {
|
|
22
|
+
const context = useContext(StepItemContext);
|
|
23
|
+
if (!context) throw new Error("useStepItem must be used within a StepperItem");
|
|
24
|
+
return context;
|
|
103
25
|
};
|
|
104
|
-
function Stepper({
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
{
|
|
126
|
-
value: {
|
|
127
|
-
activeStep: currentStep,
|
|
128
|
-
setActiveStep,
|
|
129
|
-
orientation
|
|
130
|
-
},
|
|
131
|
-
children: /* @__PURE__ */ jsx(
|
|
132
|
-
"div",
|
|
133
|
-
{
|
|
134
|
-
"data-slot": "stepper",
|
|
135
|
-
className: cn(
|
|
136
|
-
`group/stepper inline-flex data-[orientation=horizontal]:w-full data-[orientation=horizontal]:flex-row
|
|
137
|
-
data-[orientation=vertical]:flex-col`,
|
|
138
|
-
className
|
|
139
|
-
),
|
|
140
|
-
"data-orientation": orientation,
|
|
141
|
-
...props
|
|
142
|
-
}
|
|
143
|
-
)
|
|
144
|
-
}
|
|
145
|
-
);
|
|
26
|
+
function Stepper({ defaultValue = 0, value, onValueChange, orientation = "horizontal", className, ...props }) {
|
|
27
|
+
const [activeStep, setInternalStep] = React$1.useState(defaultValue);
|
|
28
|
+
const setActiveStep = React$1.useCallback((step) => {
|
|
29
|
+
if (value === void 0) setInternalStep(step);
|
|
30
|
+
onValueChange?.(step);
|
|
31
|
+
}, [value, onValueChange]);
|
|
32
|
+
const currentStep = value ?? activeStep;
|
|
33
|
+
return /* @__PURE__ */ jsx(StepperContext.Provider, {
|
|
34
|
+
value: {
|
|
35
|
+
activeStep: currentStep,
|
|
36
|
+
setActiveStep,
|
|
37
|
+
orientation
|
|
38
|
+
},
|
|
39
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
40
|
+
"data-slot": "stepper",
|
|
41
|
+
className: cn(`group/stepper inline-flex data-[orientation=horizontal]:w-full data-[orientation=horizontal]:flex-row
|
|
42
|
+
data-[orientation=vertical]:flex-col`, className),
|
|
43
|
+
"data-orientation": orientation,
|
|
44
|
+
...props
|
|
45
|
+
})
|
|
46
|
+
});
|
|
146
47
|
}
|
|
147
|
-
function StepperItem({
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
"data-state": state,
|
|
169
|
-
...isLoading ? { "data-loading": true } : {},
|
|
170
|
-
...props,
|
|
171
|
-
children
|
|
172
|
-
}
|
|
173
|
-
) });
|
|
48
|
+
function StepperItem({ step, completed = false, disabled = false, loading = false, className, children, ...props }) {
|
|
49
|
+
const { activeStep } = useStepper();
|
|
50
|
+
const state = completed || step < activeStep ? "completed" : activeStep === step ? "active" : "inactive";
|
|
51
|
+
const isLoading = loading && step === activeStep;
|
|
52
|
+
return /* @__PURE__ */ jsx(StepItemContext.Provider, {
|
|
53
|
+
value: {
|
|
54
|
+
step,
|
|
55
|
+
state,
|
|
56
|
+
isDisabled: disabled,
|
|
57
|
+
isLoading
|
|
58
|
+
},
|
|
59
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
60
|
+
"data-slot": "stepper-item",
|
|
61
|
+
className: cn(`group/step flex items-center group-data-[orientation=horizontal]/stepper:flex-row
|
|
62
|
+
group-data-[orientation=vertical]/stepper:flex-col`, className),
|
|
63
|
+
"data-state": state,
|
|
64
|
+
...isLoading ? { "data-loading": true } : {},
|
|
65
|
+
...props,
|
|
66
|
+
children
|
|
67
|
+
})
|
|
68
|
+
});
|
|
174
69
|
}
|
|
175
70
|
function StepperTrigger({ asChild = false, static: isStatic, className, children, ...props }) {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
`focus-visible:border-ring focus-visible:ring-ring/50 inline-flex items-center gap-3 rounded-full transition-transform
|
|
71
|
+
const { setActiveStep } = useStepper();
|
|
72
|
+
const { step, isDisabled } = useStepItem();
|
|
73
|
+
const triggerClassName = cn(`focus-visible:border-ring focus-visible:ring-ring/50 inline-flex items-center gap-3 rounded-full transition-transform
|
|
180
74
|
duration-150 ease-out outline-none focus-visible:z-10 focus-visible:ring-[3px]
|
|
181
|
-
disabled:pointer-events-none disabled:opacity-50`,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
return /* @__PURE__ */ jsx(
|
|
199
|
-
"button",
|
|
200
|
-
{
|
|
201
|
-
"data-slot": "stepper-trigger",
|
|
202
|
-
className: triggerClassName,
|
|
203
|
-
onClick: () => setActiveStep(step),
|
|
204
|
-
disabled: isDisabled,
|
|
205
|
-
...props,
|
|
206
|
-
children
|
|
207
|
-
}
|
|
208
|
-
);
|
|
75
|
+
disabled:pointer-events-none disabled:opacity-50`, !isStatic && "motion-safe:hover:scale-105 motion-safe:active:not-disabled:scale-[0.96]", className);
|
|
76
|
+
if (asChild) return /* @__PURE__ */ jsx(Slot, {
|
|
77
|
+
"data-slot": "stepper-trigger",
|
|
78
|
+
className: triggerClassName,
|
|
79
|
+
onClick: () => setActiveStep(step),
|
|
80
|
+
disabled: isDisabled,
|
|
81
|
+
...props,
|
|
82
|
+
children
|
|
83
|
+
});
|
|
84
|
+
return /* @__PURE__ */ jsx("button", {
|
|
85
|
+
"data-slot": "stepper-trigger",
|
|
86
|
+
className: triggerClassName,
|
|
87
|
+
onClick: () => setActiveStep(step),
|
|
88
|
+
disabled: isDisabled,
|
|
89
|
+
...props,
|
|
90
|
+
children
|
|
91
|
+
});
|
|
209
92
|
}
|
|
210
93
|
function StepperIndicator({ asChild = false, className, children, ...props }) {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
"data-slot": "stepper-indicator",
|
|
218
|
-
className: cn(
|
|
219
|
-
`bg-muted text-muted-foreground data-[state=active]:bg-primary data-[state=completed]:bg-primary
|
|
94
|
+
const { state, step, isLoading } = useStepItem();
|
|
95
|
+
const showNumber = !isLoading && state !== "completed";
|
|
96
|
+
const showCheck = !isLoading && state === "completed";
|
|
97
|
+
return /* @__PURE__ */ jsx("span", {
|
|
98
|
+
"data-slot": "stepper-indicator",
|
|
99
|
+
className: cn(`bg-muted text-muted-foreground data-[state=active]:bg-primary data-[state=completed]:bg-primary
|
|
220
100
|
data-[state=active]:text-primary-foreground data-[state=completed]:text-primary-foreground relative flex size-6
|
|
221
|
-
shrink-0 items-center justify-center rounded-full text-xs font-medium transition-[color,background-color] duration-200 ease-out`,
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
] })
|
|
245
|
-
}
|
|
246
|
-
);
|
|
101
|
+
shrink-0 items-center justify-center rounded-full text-xs font-medium transition-[color,background-color] duration-200 ease-out`, className),
|
|
102
|
+
"data-state": state,
|
|
103
|
+
...props,
|
|
104
|
+
children: asChild ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
105
|
+
/* @__PURE__ */ jsx("span", {
|
|
106
|
+
className: cn("absolute", iconSwapClass, showNumber ? iconSwapVisible : iconSwapHidden),
|
|
107
|
+
children: step
|
|
108
|
+
}),
|
|
109
|
+
/* @__PURE__ */ jsx(CheckIcon, {
|
|
110
|
+
className: cn("absolute", iconSwapClass, showCheck ? iconSwapVisible : iconSwapHidden),
|
|
111
|
+
size: 16,
|
|
112
|
+
"aria-hidden": "true"
|
|
113
|
+
}),
|
|
114
|
+
/* @__PURE__ */ jsx("span", {
|
|
115
|
+
className: cn("absolute", iconSwapClass, isLoading ? iconSwapVisible : iconSwapHidden),
|
|
116
|
+
children: /* @__PURE__ */ jsx(LoaderCircleIcon, {
|
|
117
|
+
className: cn(isLoading && "motion-safe:animate-spin"),
|
|
118
|
+
size: 14,
|
|
119
|
+
"aria-hidden": "true"
|
|
120
|
+
})
|
|
121
|
+
})
|
|
122
|
+
] })
|
|
123
|
+
});
|
|
247
124
|
}
|
|
248
125
|
function StepperTitle({ className, ...props }) {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
...props
|
|
255
|
-
}
|
|
256
|
-
);
|
|
126
|
+
return /* @__PURE__ */ jsx("h3", {
|
|
127
|
+
"data-slot": "stepper-title",
|
|
128
|
+
className: cn("text-sm font-medium transition-colors duration-200 ease-out", className),
|
|
129
|
+
...props
|
|
130
|
+
});
|
|
257
131
|
}
|
|
258
132
|
function StepperDescription({ className, ...props }) {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
...props
|
|
265
|
-
}
|
|
266
|
-
);
|
|
133
|
+
return /* @__PURE__ */ jsx("p", {
|
|
134
|
+
"data-slot": "stepper-description",
|
|
135
|
+
className: cn("text-muted-foreground text-sm transition-colors duration-200 ease-out", className),
|
|
136
|
+
...props
|
|
137
|
+
});
|
|
267
138
|
}
|
|
268
139
|
function StepperSeparator({ className, ...props }) {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
"data-slot": "stepper-separator",
|
|
273
|
-
className: cn(
|
|
274
|
-
`bg-muted group-data-[state=completed]/step:bg-primary m-0.5 transition-colors duration-200 ease-out
|
|
140
|
+
return /* @__PURE__ */ jsx("div", {
|
|
141
|
+
"data-slot": "stepper-separator",
|
|
142
|
+
className: cn(`bg-muted group-data-[state=completed]/step:bg-primary m-0.5 transition-colors duration-200 ease-out
|
|
275
143
|
group-data-[orientation=horizontal]/stepper:h-0.5 group-data-[orientation=horizontal]/stepper:w-full
|
|
276
144
|
group-data-[orientation=horizontal]/stepper:flex-1 group-data-[orientation=vertical]/stepper:h-12
|
|
277
|
-
group-data-[orientation=vertical]/stepper:w-0.5`,
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
...props
|
|
281
|
-
}
|
|
282
|
-
);
|
|
145
|
+
group-data-[orientation=vertical]/stepper:w-0.5`, className),
|
|
146
|
+
...props
|
|
147
|
+
});
|
|
283
148
|
}
|
|
284
149
|
|
|
150
|
+
//#endregion
|
|
285
151
|
export { Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger };
|
|
286
|
-
//# sourceMappingURL=stepper.js.map
|
|
287
152
|
//# sourceMappingURL=stepper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/slot.tsx","../../src/lib/utils.ts","../../src/components/stepper.tsx"],"names":["React2","jsx","Fragment"],"mappings":";;;;;;;AAQA,SAAS,eAAkB,IAAA,EAA0D;AACpF,EAAA,OAAO,CAAC,IAAA,KAAS;AAChB,IAAA,IAAA,CAAK,OAAA,CAAQ,CAAC,GAAA,KAAQ;AACrB,MAAA,IAAI,OAAO,QAAQ,UAAA,EAAY;AAC9B,QAAA,GAAA,CAAI,IAAI,CAAA;AAAA,MACT,CAAA,MAAA,IAAW,OAAO,IAAA,EAAM;AACvB,QAAC,IAAyC,OAAA,GAAU,IAAA;AAAA,MACrD;AAAA,IACD,CAAC,CAAA;AAAA,EACF,CAAA;AACD;AAMA,SAAS,UAAA,CACR,WACA,UAAA,EAC0B;AAC1B,EAAA,MAAM,aAAA,GAAyC,EAAE,GAAG,UAAA,EAAW;AAE/D,EAAA,KAAA,MAAW,YAAY,UAAA,EAAY;AAElC,IAAA,IAAI,aAAa,KAAA,EAAO;AAExB,IAAA,MAAM,aAAA,GAAgB,UAAU,QAAQ,CAAA;AACxC,IAAA,MAAM,cAAA,GAAiB,WAAW,QAAQ,CAAA;AAG1C,IAAA,IAAI,UAAA,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ACN,aAAA,EAAY;AAAA;AAAA,SACb,EACD;AAAA,OAAA,EACD;AAAA;AAAA,GAEF;AAEF;AAGA,SAAS,YAAA,CAAa,EAAE,SAAA,EAAW,GAAG,OAAM,EAA6C;AACxF,EAAA,uBACCA,GAAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACA,WAAA,EAAU,eAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,6DAAA,EAA+D,SAAS,CAAA;AAAA,MACrF,GAAG;AAAA;AAAA,GACL;AAEF;AAGA,SAAS,kBAAA,CAAmB,EAAE,SAAA,EAAW,GAAG,OAAM,EAA+C;AAChG,EAAA,uBACCA,GAAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACA,WAAA,EAAU,qBAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,uEAAA,EAAyE,SAAS,CAAA;AAAA,MAC/F,GAAG;AAAA;AAAA,GACL;AAEF;AAGA,SAAS,gBAAA,CAAiB,EAAE,SAAA,EAAW,GAAG,OAAM,EAAyC;AACxF,EAAA,uBACCA,GAAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACA,WAAA,EAAU,mBAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,CAAA;AAAA;AAAA;AAAA,mDAAA,CAAA;AAAA,QAIA;AAAA,OACD;AAAA,MACC,GAAG;AAAA;AAAA,GACL;AAEF","file":"stepper.js","sourcesContent":["'use client';\n\nimport * as React from 'react';\n\n/**\n * Merges refs into a single callback ref.\n * React 19 compatible - handles refs as regular props.\n */\nfunction composeRefs<T>(...refs: (React.Ref<T> | undefined)[]): React.RefCallback<T> {\n\treturn (node) => {\n\t\trefs.forEach((ref) => {\n\t\t\tif (typeof ref === 'function') {\n\t\t\t\tref(node);\n\t\t\t} else if (ref != null) {\n\t\t\t\t(ref as React.MutableRefObject<T | null>).current = node;\n\t\t\t}\n\t\t});\n\t};\n}\n\n/**\n * Merges props, handling special cases for className, style, and event handlers.\n * Excludes 'ref' from merging as it's handled separately.\n */\nfunction mergeProps(\n\tslotProps: Record<string, unknown>,\n\tchildProps: Record<string, unknown>,\n): Record<string, unknown> {\n\tconst overrideProps: Record<string, unknown> = { ...childProps };\n\n\tfor (const propName in childProps) {\n\t\t// Skip ref - handled separately for composition\n\t\tif (propName === 'ref') continue;\n\n\t\tconst slotPropValue = slotProps[propName];\n\t\tconst childPropValue = childProps[propName];\n\n\t\t// Compose event handlers\n\t\tif (/^on[A-Z]/.test(propName) && typeof slotPropValue === 'function' && typeof childPropValue === 'function') {\n\t\t\toverrideProps[propName] = (...args: unknown[]) => {\n\t\t\t\tchildPropValue(...args);\n\t\t\t\tslotPropValue(...args);\n\t\t\t};\n\t\t}\n\t\t// Merge className\n\t\telse if (propName === 'className' && typeof slotPropValue === 'string' && typeof childPropValue === 'string') {\n\t\t\toverrideProps[propName] = `${slotPropValue} ${childPropValue}`.trim();\n\t\t}\n\t\t// Merge style\n\t\telse if (propName === 'style' && typeof slotPropValue === 'object' && typeof childPropValue === 'object') {\n\t\t\toverrideProps[propName] = { ...slotPropValue, ...childPropValue };\n\t\t}\n\t}\n\n\treturn { ...slotProps, ...overrideProps };\n}\n\n/**\n * Merges props from a parent component with a child element's props,\n * including proper ref composition. Use this in render prop patterns\n * where the parent needs to merge its props with the child's.\n *\n * @param parentProps - Props from the parent component (e.g., triggerProps from Base UI)\n * @param childElement - The child React element whose props will be merged\n * @returns Merged props object ready to pass to React.cloneElement\n */\nfunction mergePropsWithRef<T = HTMLElement>(\n\tparentProps: Record<string, unknown>,\n\tchildElement: React.ReactElement,\n): Record<string, unknown> {\n\tconst childProps = childElement.props as Record<string, unknown>;\n\tconst parentRef = parentProps.ref as React.Ref<T> | undefined;\n\tconst childRef = childProps.ref as React.Ref<T> | undefined;\n\n\tconst mergedProps = mergeProps(parentProps, childProps);\n\n\t// Compose refs if either exists\n\tif (parentRef || childRef) {\n\t\tmergedProps.ref = composeRefs(parentRef, childRef);\n\t}\n\n\treturn mergedProps;\n}\n\n/**\n * Check if a value is a valid slottable child (single React element).\n */\nfunction isSlottable(child: React.ReactNode): child is React.ReactElement {\n\treturn React.isValidElement(child);\n}\n\nexport interface SlotProps extends React.HTMLAttributes<HTMLElement> {\n\tchildren?: React.ReactNode;\n}\n\n/**\n * Slot component - renders its child element with merged props.\n * Used for the `asChild` pattern where parent props are passed to child.\n * React 19 compatible - accesses ref from props instead of element.ref.\n */\nconst Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n\tconst { children, ...slotProps } = props;\n\n\t// Handle single child\n\tif (isSlottable(children)) {\n\t\tconst childProps = children.props as Record<string, unknown>;\n\t\t// React 19: ref is now a regular prop, not element.ref\n\t\tconst childRef = childProps.ref as React.Ref<HTMLElement> | undefined;\n\n\t\treturn React.cloneElement(children, {\n\t\t\t...mergeProps(slotProps, childProps),\n\t\t\tref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,\n\t\t} as React.Attributes);\n\t}\n\n\t// Handle multiple children - wrap Slottable content\n\tif (React.Children.count(children) > 1) {\n\t\tconst childrenArray = React.Children.toArray(children);\n\t\tconst slottableChild = childrenArray.find(\n\t\t\t(child) => React.isValidElement(child) && child.type === Slottable,\n\t\t) as React.ReactElement<{ children: React.ReactNode }> | undefined;\n\n\t\tif (slottableChild) {\n\t\t\tconst newElement = slottableChild.props.children;\n\t\t\tif (isSlottable(newElement)) {\n\t\t\t\tconst newElementProps = newElement.props as Record<string, unknown> & { children?: React.ReactNode };\n\t\t\t\tconst newChildren = childrenArray.map((child) => {\n\t\t\t\t\tif (child === slottableChild) {\n\t\t\t\t\t\treturn React.Children.count(newElementProps.children) > 1\n\t\t\t\t\t\t\t? React.Children.only(null)\n\t\t\t\t\t\t\t: newElementProps.children;\n\t\t\t\t\t}\n\t\t\t\t\treturn child;\n\t\t\t\t});\n\n\t\t\t\t// React 19: ref is now a regular prop\n\t\t\t\tconst childRef = newElementProps.ref as React.Ref<HTMLElement> | undefined;\n\n\t\t\t\treturn React.cloneElement(newElement, {\n\t\t\t\t\t...mergeProps(slotProps, newElementProps),\n\t\t\t\t\tref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,\n\t\t\t\t\tchildren: newChildren,\n\t\t\t\t} as React.Attributes);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Fallback: render children as-is (shouldn't normally happen with proper usage)\n\treturn <>{children}</>;\n});\n\nSlot.displayName = 'Slot';\n\n/**\n * Slottable component - marks content that should receive slot props.\n * Used when Slot has multiple children and you want to specify which one receives props.\n */\nfunction Slottable({ children }: { children: React.ReactNode }) {\n\treturn <>{children}</>;\n}\n\nexport { Slot, Slottable, composeRefs, mergeProps, mergePropsWithRef };\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 { createContext, useContext } from 'react';\nimport { CheckIcon, LoaderCircleIcon } from 'lucide-react';\nimport { Slot } from '../lib/slot';\n\nimport { cn } from '../lib/utils';\n\n// Types\ntype StepperContextValue = {\n\tactiveStep: number;\n\tsetActiveStep: (step: number) => void;\n\torientation: 'horizontal' | 'vertical';\n};\n\ntype StepItemContextValue = {\n\tstep: number;\n\tstate: StepState;\n\tisDisabled: boolean;\n\tisLoading: boolean;\n};\n\ntype StepState = 'active' | 'completed' | 'inactive' | 'loading';\n\n// Contexts\nconst StepperContext = createContext<StepperContextValue | undefined>(undefined);\nconst StepItemContext = createContext<StepItemContextValue | undefined>(undefined);\n\nconst iconSwapClass =\n\t'transition-[opacity,scale,filter] duration-300 ease-[cubic-bezier(0.2,0,0,1)] motion-reduce:transition-none';\nconst iconSwapVisible = 'scale-100 opacity-100 blur-0';\nconst iconSwapHidden = 'scale-[0.25] opacity-0 blur-[4px]';\n\nconst useStepper = () => {\n\tconst context = useContext(StepperContext);\n\tif (!context) {\n\t\tthrow new Error('useStepper must be used within a Stepper');\n\t}\n\treturn context;\n};\n\nconst useStepItem = () => {\n\tconst context = useContext(StepItemContext);\n\tif (!context) {\n\t\tthrow new Error('useStepItem must be used within a StepperItem');\n\t}\n\treturn context;\n};\n\n// Components\ninterface StepperProps extends React.HTMLAttributes<HTMLDivElement> {\n\tdefaultValue?: number;\n\tvalue?: number;\n\tonValueChange?: (value: number) => void;\n\torientation?: 'horizontal' | 'vertical';\n}\n\nfunction Stepper({\n\tdefaultValue = 0,\n\tvalue,\n\tonValueChange,\n\torientation = 'horizontal',\n\tclassName,\n\t...props\n}: StepperProps) {\n\tconst [activeStep, setInternalStep] = React.useState(defaultValue);\n\n\tconst setActiveStep = React.useCallback(\n\t\t(step: number) => {\n\t\t\tif (value === undefined) {\n\t\t\t\tsetInternalStep(step);\n\t\t\t}\n\t\t\tonValueChange?.(step);\n\t\t},\n\t\t[value, onValueChange],\n\t);\n\n\tconst currentStep = value ?? activeStep;\n\n\treturn (\n\t\t<StepperContext.Provider\n\t\t\tvalue={{\n\t\t\t\tactiveStep: currentStep,\n\t\t\t\tsetActiveStep,\n\t\t\t\torientation,\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\tdata-slot=\"stepper\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t`group/stepper inline-flex data-[orientation=horizontal]:w-full data-[orientation=horizontal]:flex-row\n\t\t\t\t\tdata-[orientation=vertical]:flex-col`,\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tdata-orientation={orientation}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</StepperContext.Provider>\n\t);\n}\n\n// StepperItem\ninterface StepperItemProps extends React.HTMLAttributes<HTMLDivElement> {\n\tstep: number;\n\tcompleted?: boolean;\n\tdisabled?: boolean;\n\tloading?: boolean;\n}\n\nfunction StepperItem({\n\tstep,\n\tcompleted = false,\n\tdisabled = false,\n\tloading = false,\n\tclassName,\n\tchildren,\n\t...props\n}: StepperItemProps) {\n\tconst { activeStep } = useStepper();\n\n\tconst state: StepState = completed || step < activeStep ? 'completed' : activeStep === step ? 'active' : 'inactive';\n\n\tconst isLoading = loading && step === activeStep;\n\n\treturn (\n\t\t<StepItemContext.Provider value={{ step, state, isDisabled: disabled, isLoading }}>\n\t\t\t<div\n\t\t\t\tdata-slot=\"stepper-item\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t`group/step flex items-center group-data-[orientation=horizontal]/stepper:flex-row\n\t\t\t\t\tgroup-data-[orientation=vertical]/stepper:flex-col`,\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tdata-state={state}\n\t\t\t\t{...(isLoading ? { 'data-loading': true } : {})}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</StepItemContext.Provider>\n\t);\n}\n\n// StepperTrigger\ninterface StepperTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n\tasChild?: boolean;\n\t/** Disables hover and press scaling when motion would distract. */\n\tstatic?: boolean;\n}\n\nfunction StepperTrigger({ asChild = false, static: isStatic, className, children, ...props }: StepperTriggerProps) {\n\tconst { setActiveStep } = useStepper();\n\tconst { step, isDisabled } = useStepItem();\n\n\tconst triggerClassName = cn(\n\t\t`focus-visible:border-ring focus-visible:ring-ring/50 inline-flex items-center gap-3 rounded-full transition-transform\n\t\tduration-150 ease-out outline-none focus-visible:z-10 focus-visible:ring-[3px]\n\t\tdisabled:pointer-events-none disabled:opacity-50`,\n\t\t!isStatic && 'motion-safe:hover:scale-105 motion-safe:active:not-disabled:scale-[0.96]',\n\t\tclassName,\n\t);\n\n\tif (asChild) {\n\t\treturn (\n\t\t\t<Slot\n\t\t\t\tdata-slot=\"stepper-trigger\"\n\t\t\t\tclassName={triggerClassName}\n\t\t\t\tonClick={() => setActiveStep(step)}\n\t\t\t\tdisabled={isDisabled}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Slot>\n\t\t);\n\t}\n\n\treturn (\n\t\t<button\n\t\t\tdata-slot=\"stepper-trigger\"\n\t\t\tclassName={triggerClassName}\n\t\t\tonClick={() => setActiveStep(step)}\n\t\t\tdisabled={isDisabled}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</button>\n\t);\n}\n\n// StepperIndicator\ninterface StepperIndicatorProps extends React.HTMLAttributes<HTMLDivElement> {\n\tasChild?: boolean;\n}\n\nfunction StepperIndicator({ asChild = false, className, children, ...props }: StepperIndicatorProps) {\n\tconst { state, step, isLoading } = useStepItem();\n\tconst showNumber = !isLoading && state !== 'completed';\n\tconst showCheck = !isLoading && state === 'completed';\n\n\treturn (\n\t\t<span\n\t\t\tdata-slot=\"stepper-indicator\"\n\t\t\tclassName={cn(\n\t\t\t\t`bg-muted text-muted-foreground data-[state=active]:bg-primary data-[state=completed]:bg-primary\n\t\t\t\t\tdata-[state=active]:text-primary-foreground data-[state=completed]:text-primary-foreground relative flex size-6\n\t\t\t\t\tshrink-0 items-center justify-center rounded-full text-xs font-medium transition-[color,background-color] duration-200 ease-out`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tdata-state={state}\n\t\t\t{...props}\n\t\t>\n\t\t\t{asChild ? (\n\t\t\t\tchildren\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<span className={cn('absolute', iconSwapClass, showNumber ? iconSwapVisible : iconSwapHidden)}>\n\t\t\t\t\t\t{step}\n\t\t\t\t\t</span>\n\t\t\t\t\t<CheckIcon\n\t\t\t\t\t\tclassName={cn('absolute', iconSwapClass, showCheck ? iconSwapVisible : iconSwapHidden)}\n\t\t\t\t\t\tsize={16}\n\t\t\t\t\t\taria-hidden='true'\n\t\t\t\t\t/>\n\t\t\t\t\t<span className={cn('absolute', iconSwapClass, isLoading ? iconSwapVisible : iconSwapHidden)}>\n\t\t\t\t\t\t<LoaderCircleIcon\n\t\t\t\t\t\t\tclassName={cn(isLoading && 'motion-safe:animate-spin')}\n\t\t\t\t\t\t\tsize={14}\n\t\t\t\t\t\t\taria-hidden='true'\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</span>\n\t);\n}\n\n// StepperTitle\nfunction StepperTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>) {\n\treturn (\n\t\t<h3\n\t\t\tdata-slot=\"stepper-title\"\n\t\t\tclassName={cn('text-sm font-medium transition-colors duration-200 ease-out', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// StepperDescription\nfunction StepperDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>) {\n\treturn (\n\t\t<p\n\t\t\tdata-slot=\"stepper-description\"\n\t\t\tclassName={cn('text-muted-foreground text-sm transition-colors duration-200 ease-out', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// StepperSeparator\nfunction StepperSeparator({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"stepper-separator\"\n\t\t\tclassName={cn(\n\t\t\t\t`bg-muted group-data-[state=completed]/step:bg-primary m-0.5 transition-colors duration-200 ease-out\n\t\t\t\tgroup-data-[orientation=horizontal]/stepper:h-0.5 group-data-[orientation=horizontal]/stepper:w-full\n\t\t\t\tgroup-data-[orientation=horizontal]/stepper:flex-1 group-data-[orientation=vertical]/stepper:h-12\n\t\t\t\tgroup-data-[orientation=vertical]/stepper:w-0.5`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger };\n"]}
|
|
1
|
+
{"version":3,"file":"stepper.js","names":["React"],"sources":["../../src/components/stepper.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { createContext, useContext } from 'react';\nimport { CheckIcon, LoaderCircleIcon } from 'lucide-react';\nimport { Slot } from '../lib/slot';\n\nimport { cn } from '../lib/utils';\n\n// Types\ntype StepperContextValue = {\n\tactiveStep: number;\n\tsetActiveStep: (step: number) => void;\n\torientation: 'horizontal' | 'vertical';\n};\n\ntype StepItemContextValue = {\n\tstep: number;\n\tstate: StepState;\n\tisDisabled: boolean;\n\tisLoading: boolean;\n};\n\ntype StepState = 'active' | 'completed' | 'inactive' | 'loading';\n\n// Contexts\nconst StepperContext = createContext<StepperContextValue | undefined>(undefined);\nconst StepItemContext = createContext<StepItemContextValue | undefined>(undefined);\n\nconst iconSwapClass =\n\t'transition-[opacity,scale,filter] duration-300 ease-[cubic-bezier(0.2,0,0,1)] motion-reduce:transition-none';\nconst iconSwapVisible = 'scale-100 opacity-100 blur-0';\nconst iconSwapHidden = 'scale-[0.25] opacity-0 blur-[4px]';\n\nconst useStepper = () => {\n\tconst context = useContext(StepperContext);\n\tif (!context) {\n\t\tthrow new Error('useStepper must be used within a Stepper');\n\t}\n\treturn context;\n};\n\nconst useStepItem = () => {\n\tconst context = useContext(StepItemContext);\n\tif (!context) {\n\t\tthrow new Error('useStepItem must be used within a StepperItem');\n\t}\n\treturn context;\n};\n\n// Components\ninterface StepperProps extends React.HTMLAttributes<HTMLDivElement> {\n\tdefaultValue?: number;\n\tvalue?: number;\n\tonValueChange?: (value: number) => void;\n\torientation?: 'horizontal' | 'vertical';\n}\n\nfunction Stepper({\n\tdefaultValue = 0,\n\tvalue,\n\tonValueChange,\n\torientation = 'horizontal',\n\tclassName,\n\t...props\n}: StepperProps) {\n\tconst [activeStep, setInternalStep] = React.useState(defaultValue);\n\n\tconst setActiveStep = React.useCallback(\n\t\t(step: number) => {\n\t\t\tif (value === undefined) {\n\t\t\t\tsetInternalStep(step);\n\t\t\t}\n\t\t\tonValueChange?.(step);\n\t\t},\n\t\t[value, onValueChange],\n\t);\n\n\tconst currentStep = value ?? activeStep;\n\n\treturn (\n\t\t<StepperContext.Provider\n\t\t\tvalue={{\n\t\t\t\tactiveStep: currentStep,\n\t\t\t\tsetActiveStep,\n\t\t\t\torientation,\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\tdata-slot=\"stepper\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t`group/stepper inline-flex data-[orientation=horizontal]:w-full data-[orientation=horizontal]:flex-row\n\t\t\t\t\tdata-[orientation=vertical]:flex-col`,\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tdata-orientation={orientation}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</StepperContext.Provider>\n\t);\n}\n\n// StepperItem\ninterface StepperItemProps extends React.HTMLAttributes<HTMLDivElement> {\n\tstep: number;\n\tcompleted?: boolean;\n\tdisabled?: boolean;\n\tloading?: boolean;\n}\n\nfunction StepperItem({\n\tstep,\n\tcompleted = false,\n\tdisabled = false,\n\tloading = false,\n\tclassName,\n\tchildren,\n\t...props\n}: StepperItemProps) {\n\tconst { activeStep } = useStepper();\n\n\tconst state: StepState = completed || step < activeStep ? 'completed' : activeStep === step ? 'active' : 'inactive';\n\n\tconst isLoading = loading && step === activeStep;\n\n\treturn (\n\t\t<StepItemContext.Provider value={{ step, state, isDisabled: disabled, isLoading }}>\n\t\t\t<div\n\t\t\t\tdata-slot=\"stepper-item\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t`group/step flex items-center group-data-[orientation=horizontal]/stepper:flex-row\n\t\t\t\t\tgroup-data-[orientation=vertical]/stepper:flex-col`,\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tdata-state={state}\n\t\t\t\t{...(isLoading ? { 'data-loading': true } : {})}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</StepItemContext.Provider>\n\t);\n}\n\n// StepperTrigger\ninterface StepperTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n\tasChild?: boolean;\n\t/** Disables hover and press scaling when motion would distract. */\n\tstatic?: boolean;\n}\n\nfunction StepperTrigger({ asChild = false, static: isStatic, className, children, ...props }: StepperTriggerProps) {\n\tconst { setActiveStep } = useStepper();\n\tconst { step, isDisabled } = useStepItem();\n\n\tconst triggerClassName = cn(\n\t\t`focus-visible:border-ring focus-visible:ring-ring/50 inline-flex items-center gap-3 rounded-full transition-transform\n\t\tduration-150 ease-out outline-none focus-visible:z-10 focus-visible:ring-[3px]\n\t\tdisabled:pointer-events-none disabled:opacity-50`,\n\t\t!isStatic && 'motion-safe:hover:scale-105 motion-safe:active:not-disabled:scale-[0.96]',\n\t\tclassName,\n\t);\n\n\tif (asChild) {\n\t\treturn (\n\t\t\t<Slot\n\t\t\t\tdata-slot=\"stepper-trigger\"\n\t\t\t\tclassName={triggerClassName}\n\t\t\t\tonClick={() => setActiveStep(step)}\n\t\t\t\tdisabled={isDisabled}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Slot>\n\t\t);\n\t}\n\n\treturn (\n\t\t<button\n\t\t\tdata-slot=\"stepper-trigger\"\n\t\t\tclassName={triggerClassName}\n\t\t\tonClick={() => setActiveStep(step)}\n\t\t\tdisabled={isDisabled}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</button>\n\t);\n}\n\n// StepperIndicator\ninterface StepperIndicatorProps extends React.HTMLAttributes<HTMLDivElement> {\n\tasChild?: boolean;\n}\n\nfunction StepperIndicator({ asChild = false, className, children, ...props }: StepperIndicatorProps) {\n\tconst { state, step, isLoading } = useStepItem();\n\tconst showNumber = !isLoading && state !== 'completed';\n\tconst showCheck = !isLoading && state === 'completed';\n\n\treturn (\n\t\t<span\n\t\t\tdata-slot=\"stepper-indicator\"\n\t\t\tclassName={cn(\n\t\t\t\t`bg-muted text-muted-foreground data-[state=active]:bg-primary data-[state=completed]:bg-primary\n\t\t\t\t\tdata-[state=active]:text-primary-foreground data-[state=completed]:text-primary-foreground relative flex size-6\n\t\t\t\t\tshrink-0 items-center justify-center rounded-full text-xs font-medium transition-[color,background-color] duration-200 ease-out`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tdata-state={state}\n\t\t\t{...props}\n\t\t>\n\t\t\t{asChild ? (\n\t\t\t\tchildren\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<span className={cn('absolute', iconSwapClass, showNumber ? iconSwapVisible : iconSwapHidden)}>\n\t\t\t\t\t\t{step}\n\t\t\t\t\t</span>\n\t\t\t\t\t<CheckIcon\n\t\t\t\t\t\tclassName={cn('absolute', iconSwapClass, showCheck ? iconSwapVisible : iconSwapHidden)}\n\t\t\t\t\t\tsize={16}\n\t\t\t\t\t\taria-hidden='true'\n\t\t\t\t\t/>\n\t\t\t\t\t<span className={cn('absolute', iconSwapClass, isLoading ? iconSwapVisible : iconSwapHidden)}>\n\t\t\t\t\t\t<LoaderCircleIcon\n\t\t\t\t\t\t\tclassName={cn(isLoading && 'motion-safe:animate-spin')}\n\t\t\t\t\t\t\tsize={14}\n\t\t\t\t\t\t\taria-hidden='true'\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</span>\n\t);\n}\n\n// StepperTitle\nfunction StepperTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>) {\n\treturn (\n\t\t<h3\n\t\t\tdata-slot=\"stepper-title\"\n\t\t\tclassName={cn('text-sm font-medium transition-colors duration-200 ease-out', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// StepperDescription\nfunction StepperDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>) {\n\treturn (\n\t\t<p\n\t\t\tdata-slot=\"stepper-description\"\n\t\t\tclassName={cn('text-muted-foreground text-sm transition-colors duration-200 ease-out', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// StepperSeparator\nfunction StepperSeparator({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"stepper-separator\"\n\t\t\tclassName={cn(\n\t\t\t\t`bg-muted group-data-[state=completed]/step:bg-primary m-0.5 transition-colors duration-200 ease-out\n\t\t\t\tgroup-data-[orientation=horizontal]/stepper:h-0.5 group-data-[orientation=horizontal]/stepper:w-full\n\t\t\t\tgroup-data-[orientation=horizontal]/stepper:flex-1 group-data-[orientation=vertical]/stepper:h-12\n\t\t\t\tgroup-data-[orientation=vertical]/stepper:w-0.5`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger };\n"],"mappings":";;;;;;;;;;AA0BA,MAAM,iBAAiB,cAA+C,MAAS;AAC/E,MAAM,kBAAkB,cAAgD,MAAS;AAEjF,MAAM,gBACL;AACD,MAAM,kBAAkB;AACxB,MAAM,iBAAiB;AAEvB,MAAM,mBAAmB;CACxB,MAAM,UAAU,WAAW,cAAc;CACzC,IAAI,CAAC,SACJ,MAAM,IAAI,MAAM,0CAA0C;CAE3D,OAAO;AACR;AAEA,MAAM,oBAAoB;CACzB,MAAM,UAAU,WAAW,eAAe;CAC1C,IAAI,CAAC,SACJ,MAAM,IAAI,MAAM,+CAA+C;CAEhE,OAAO;AACR;AAUA,SAAS,QAAQ,EAChB,eAAe,GACf,OACA,eACA,cAAc,cACd,WACA,GAAG,SACa;CAChB,MAAM,CAAC,YAAY,mBAAmBA,QAAM,SAAS,YAAY;CAEjE,MAAM,gBAAgBA,QAAM,aAC1B,SAAiB;EACjB,IAAI,UAAU,QACb,gBAAgB,IAAI;EAErB,gBAAgB,IAAI;CACrB,GACA,CAAC,OAAO,aAAa,CACtB;CAEA,MAAM,cAAc,SAAS;CAE7B,OACC,oBAAC,eAAe,UAAhB;EACC,OAAO;GACN,YAAY;GACZ;GACA;EACD;YAEA,oBAAC,OAAD;GACC,aAAU;GACV,WAAW,GACV;4CAEA,SACD;GACA,oBAAkB;GAClB,GAAI;EACJ;CACuB;AAE3B;AAUA,SAAS,YAAY,EACpB,MACA,YAAY,OACZ,WAAW,OACX,UAAU,OACV,WACA,UACA,GAAG,SACiB;CACpB,MAAM,EAAE,eAAe,WAAW;CAEl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;IAAM,WAAW,GAAG,YAAY,eAAe,YAAY,kBAAkB,cAAc;cAC1F,oBAAC,kBAAD;KACC,WAAW,GAAG,aAAa,0BAA0B;KACrD,MAAM;KACN,eAAY;IACZ;GACI;EACL;CAEE;AAER;AAGA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAmD;CACxF,OACC,oBAAC,MAAD;EACC,aAAU;EACV,WAAW,GAAG,+DAA+D,SAAS;EACtF,GAAI;CACJ;AAEH;AAGA,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAqD;CAChG,OACC,oBAAC,KAAD;EACC,aAAU;EACV,WAAW,GAAG,yEAAyE,SAAS;EAChG,GAAI;CACJ;AAEH;AAGA,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAA+C;CACxF,OACC,oBAAC,OAAD;EACC,aAAU;EACV,WAAW,GACV;;;sDAIA,SACD;EACA,GAAI;CACJ;AAEH"}
|
|
@@ -1,46 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
1
|
+
'use client';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
+
let react = require("react");
|
|
7
|
+
react = require_rolldown_runtime.__toESM(react, 1);
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
let _base_ui_react_switch = require("@base-ui/react/switch");
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
11
|
-
}
|
|
11
|
+
//#region src/components/switch.tsx
|
|
12
12
|
function Switch({ className, ...props }) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"data-slot": "switch",
|
|
17
|
-
className: cn(
|
|
18
|
-
`peer relative inline-flex h-10 w-11 shrink-0 items-center justify-center outline-none
|
|
13
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_switch.Switch.Root, {
|
|
14
|
+
"data-slot": "switch",
|
|
15
|
+
className: require_utils.cn(`peer relative inline-flex h-10 w-11 shrink-0 items-center justify-center outline-none
|
|
19
16
|
before:pointer-events-none before:absolute before:left-1/2 before:top-1/2 before:h-[1.15rem]
|
|
20
17
|
before:w-8 before:-translate-x-1/2 before:-translate-y-1/2 before:rounded-full before:border
|
|
21
18
|
before:border-transparent before:bg-input before:shadow-xs before:transition-[background-color,box-shadow]
|
|
22
19
|
data-[checked]:before:bg-primary dark:data-[unchecked]:before:bg-input/80
|
|
23
20
|
focus-visible:before:border-ring focus-visible:before:ring-[3px] focus-visible:before:ring-ring/50
|
|
24
21
|
transition-transform duration-150 ease-out motion-safe:active:not-data-disabled:scale-[0.96]
|
|
25
|
-
motion-reduce:transition-none pointer-coarse:h-11 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
_switch.Switch.Thumb,
|
|
31
|
-
{
|
|
32
|
-
"data-slot": "switch-thumb",
|
|
33
|
-
className: cn(
|
|
34
|
-
`bg-background dark:data-[unchecked]:bg-foreground dark:data-[checked]:bg-primary-foreground
|
|
22
|
+
motion-reduce:transition-none pointer-coarse:h-11 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`, className),
|
|
23
|
+
...props,
|
|
24
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_switch.Switch.Thumb, {
|
|
25
|
+
"data-slot": "switch-thumb",
|
|
26
|
+
className: require_utils.cn(`bg-background dark:data-[unchecked]:bg-foreground dark:data-[checked]:bg-primary-foreground
|
|
35
27
|
pointer-events-none absolute left-[calc(50%-1rem)] top-1/2 block size-4 -translate-y-1/2 rounded-full ring-0 transition-transform
|
|
36
|
-
data-[checked]:translate-x-[calc(100%-2px)] data-[unchecked]:translate-x-0`
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
)
|
|
40
|
-
}
|
|
41
|
-
);
|
|
28
|
+
data-[checked]:translate-x-[calc(100%-2px)] data-[unchecked]:translate-x-0`)
|
|
29
|
+
})
|
|
30
|
+
});
|
|
42
31
|
}
|
|
43
32
|
|
|
33
|
+
//#endregion
|
|
44
34
|
exports.Switch = Switch;
|
|
45
|
-
//# sourceMappingURL=switch.cjs.map
|
|
46
35
|
//# sourceMappingURL=switch.cjs.map
|