@constructive-io/ui 0.4.1 → 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/LICENSE +21 -0
- package/README.md +17 -22
- package/dist/button-D4vqTxhp.d.cts +20 -0
- package/dist/button-D4vqTxhp.d.ts +20 -0
- package/dist/components/alert-dialog.cjs +129 -0
- package/dist/components/alert-dialog.cjs.map +1 -0
- package/dist/components/alert-dialog.d.cts +33 -0
- package/dist/components/alert-dialog.d.ts +23 -21
- package/dist/components/alert-dialog.js +98 -296
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/alert.cjs +62 -0
- package/dist/components/alert.cjs.map +1 -0
- package/dist/components/alert.d.cts +19 -0
- package/dist/components/alert.d.ts +18 -13
- package/dist/components/alert.js +49 -31
- package/dist/components/alert.js.map +1 -1
- package/dist/components/app-bar.cjs +81 -0
- package/dist/components/app-bar.cjs.map +1 -0
- package/dist/components/app-bar.d.cts +27 -0
- package/dist/components/app-bar.d.ts +27 -0
- package/dist/components/app-bar.js +77 -0
- package/dist/components/app-bar.js.map +1 -0
- package/dist/components/app-shell.cjs +267 -0
- package/dist/components/app-shell.cjs.map +1 -0
- package/dist/components/app-shell.d.cts +98 -0
- package/dist/components/app-shell.d.ts +98 -0
- package/dist/components/app-shell.js +264 -0
- package/dist/components/app-shell.js.map +1 -0
- package/dist/components/autocomplete.cjs +167 -0
- package/dist/components/autocomplete.cjs.map +1 -0
- package/dist/components/autocomplete.d.cts +28 -0
- package/dist/components/autocomplete.d.ts +24 -24
- package/dist/components/autocomplete.js +146 -397
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/avatar.cjs +39 -0
- package/dist/components/avatar.cjs.map +1 -0
- package/dist/components/avatar.d.cts +13 -0
- package/dist/components/avatar.d.ts +11 -11
- package/dist/components/avatar.js +24 -27
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.cjs +48 -0
- package/dist/components/badge.cjs.map +1 -0
- package/dist/components/badge.d.cts +15 -0
- 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 +89 -0
- package/dist/components/breadcrumb.cjs.map +1 -0
- package/dist/components/breadcrumb.d.cts +15 -0
- package/dist/components/breadcrumb.d.ts +14 -13
- package/dist/components/breadcrumb.js +63 -137
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button.cjs +75 -0
- package/dist/components/button.cjs.map +1 -0
- package/dist/components/button.d.cts +2 -0
- package/dist/components/button.d.ts +2 -17
- package/dist/components/button.js +66 -57
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar-rac.cjs +72 -0
- package/dist/components/calendar-rac.cjs.map +1 -0
- package/dist/components/calendar-rac.d.cts +13 -0
- 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 +86 -0
- package/dist/components/card.cjs.map +1 -0
- package/dist/components/card.d.cts +17 -0
- package/dist/components/card.d.ts +15 -17
- package/dist/components/card.js +58 -57
- package/dist/components/card.js.map +1 -1
- package/dist/components/checkbox-group.cjs +19 -0
- package/dist/components/checkbox-group.cjs.map +1 -0
- package/dist/components/checkbox-group.d.cts +7 -0
- 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 +67 -0
- package/dist/components/checkbox.cjs.map +1 -0
- package/dist/components/checkbox.d.cts +8 -0
- package/dist/components/checkbox.d.ts +6 -6
- package/dist/components/checkbox.js +58 -61
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/collapsible.cjs +90 -0
- package/dist/components/collapsible.cjs.map +1 -0
- package/dist/components/collapsible.d.cts +45 -0
- package/dist/components/collapsible.d.ts +19 -28
- package/dist/components/collapsible.js +74 -112
- package/dist/components/collapsible.js.map +1 -1
- package/dist/components/combobox.cjs +257 -0
- package/dist/components/combobox.cjs.map +1 -0
- package/dist/components/combobox.d.cts +44 -0
- package/dist/components/combobox.d.ts +36 -36
- package/dist/components/combobox.js +229 -515
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/command.cjs +139 -0
- package/dist/components/command.cjs.map +1 -0
- package/dist/components/command.d.cts +24 -0
- package/dist/components/command.d.ts +22 -22
- package/dist/components/command.js +109 -240
- package/dist/components/command.js.map +1 -1
- package/dist/components/dialog.cjs +139 -0
- package/dist/components/dialog.cjs.map +1 -0
- package/dist/components/dialog.d.cts +31 -0
- package/dist/components/dialog.d.ts +27 -31
- package/dist/components/dialog.js +112 -429
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/dock.cjs +90 -0
- package/dist/components/dock.cjs.map +1 -0
- package/dist/components/dock.d.cts +30 -0
- package/dist/components/dock.d.ts +25 -26
- package/dist/components/dock.js +78 -104
- package/dist/components/dock.js.map +1 -1
- package/dist/components/drawer.cjs +115 -0
- package/dist/components/drawer.cjs.map +1 -0
- package/dist/components/drawer.d.cts +16 -0
- package/dist/components/drawer.d.ts +15 -15
- package/dist/components/drawer.js +77 -121
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown-menu.cjs +217 -0
- package/dist/components/dropdown-menu.cjs.map +1 -0
- package/dist/components/dropdown-menu.d.cts +53 -0
- package/dist/components/dropdown-menu.d.ts +49 -46
- package/dist/components/dropdown-menu.js +177 -357
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/empty.cjs +72 -0
- package/dist/components/empty.cjs.map +1 -0
- package/dist/components/empty.d.cts +15 -0
- package/dist/components/empty.d.ts +15 -0
- package/dist/components/empty.js +64 -0
- package/dist/components/empty.js.map +1 -0
- package/dist/components/field.cjs +186 -0
- package/dist/components/field.cjs.map +1 -0
- package/dist/components/field.d.cts +46 -0
- package/dist/components/field.d.ts +44 -49
- package/dist/components/field.js +166 -108
- package/dist/components/field.js.map +1 -1
- package/dist/components/flickering-grid.cjs +153 -0
- package/dist/components/flickering-grid.cjs.map +1 -0
- package/dist/components/flickering-grid.d.cts +16 -0
- package/dist/components/flickering-grid.d.ts +14 -13
- package/dist/components/flickering-grid.js +144 -141
- package/dist/components/flickering-grid.js.map +1 -1
- package/dist/components/flow-zoom-panel.cjs +62 -0
- package/dist/components/flow-zoom-panel.cjs.map +1 -0
- package/dist/components/flow-zoom-panel.d.cts +12 -0
- package/dist/components/flow-zoom-panel.d.ts +12 -0
- package/dist/components/flow-zoom-panel.js +61 -0
- package/dist/components/flow-zoom-panel.js.map +1 -0
- package/dist/components/form-control.cjs +65 -0
- package/dist/components/form-control.cjs.map +1 -0
- package/dist/components/form-control.d.cts +15 -0
- package/dist/components/form-control.d.ts +11 -11
- package/dist/components/form-control.js +56 -167
- package/dist/components/form-control.js.map +1 -1
- package/dist/components/form.cjs +102 -0
- package/dist/components/form.cjs.map +1 -0
- package/dist/components/form.d.cts +2 -0
- package/dist/components/form.d.ts +2 -37
- package/dist/components/form.js +76 -163
- package/dist/components/form.js.map +1 -1
- package/dist/components/input-group.cjs +70 -0
- package/dist/components/input-group.cjs.map +1 -0
- package/dist/components/input-group.d.cts +16 -0
- package/dist/components/input-group.d.ts +14 -16
- package/dist/components/input-group.js +51 -163
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/input.cjs +37 -0
- package/dist/components/input.cjs.map +1 -0
- package/dist/components/input.d.cts +2 -0
- package/dist/components/input.d.ts +2 -11
- package/dist/components/input.js +30 -54
- package/dist/components/input.js.map +1 -1
- package/dist/components/json-input.cjs +147 -0
- package/dist/components/json-input.cjs.map +1 -0
- package/dist/components/json-input.d.cts +26 -0
- package/dist/components/json-input.d.ts +20 -19
- package/dist/components/json-input.js +132 -340
- package/dist/components/json-input.js.map +1 -1
- package/dist/components/label.cjs +27 -0
- package/dist/components/label.cjs.map +1 -0
- package/dist/components/label.d.cts +11 -0
- package/dist/components/label.d.ts +6 -6
- package/dist/components/label.js +17 -20
- package/dist/components/label.js.map +1 -1
- package/dist/components/motion-grid.cjs +68 -0
- package/dist/components/motion-grid.cjs.map +1 -0
- package/dist/components/motion-grid.d.cts +20 -0
- package/dist/components/motion-grid.d.ts +15 -15
- package/dist/components/motion-grid.js +59 -75
- package/dist/components/motion-grid.js.map +1 -1
- package/dist/components/multi-select.cjs +573 -0
- package/dist/components/multi-select.cjs.map +1 -0
- package/dist/components/multi-select.d.cts +198 -0
- package/dist/components/multi-select.d.ts +173 -173
- package/dist/components/multi-select.js +562 -874
- package/dist/components/multi-select.js.map +1 -1
- package/dist/components/page-header.cjs +30 -0
- package/dist/components/page-header.cjs.map +1 -0
- package/dist/components/page-header.d.cts +17 -0
- 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 +95 -0
- package/dist/components/pagination.cjs.map +1 -0
- package/dist/components/pagination.d.cts +17 -0
- package/dist/components/pagination.d.ts +15 -17
- package/dist/components/pagination.js +70 -128
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/popover.cjs +97 -0
- package/dist/components/popover.cjs.map +1 -0
- package/dist/components/popover.d.cts +40 -0
- package/dist/components/popover.d.ts +33 -28
- package/dist/components/popover.js +78 -178
- package/dist/components/popover.js.map +1 -1
- package/dist/components/portal.cjs +156 -0
- package/dist/components/portal.cjs.map +1 -0
- package/dist/components/portal.d.cts +118 -0
- package/dist/components/portal.d.ts +33 -23
- package/dist/components/portal.js +128 -57
- package/dist/components/portal.js.map +1 -1
- package/dist/components/progress.cjs +30 -0
- package/dist/components/progress.cjs.map +1 -0
- package/dist/components/progress.d.cts +10 -0
- package/dist/components/progress.d.ts +8 -8
- package/dist/components/progress.js +21 -24
- package/dist/components/progress.js.map +1 -1
- package/dist/components/progressive-blur-scroll-container.cjs +76 -0
- package/dist/components/progressive-blur-scroll-container.cjs.map +1 -0
- package/dist/components/progressive-blur-scroll-container.d.cts +25 -0
- 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 +46 -0
- package/dist/components/progressive-blur.cjs.map +1 -0
- package/dist/components/progressive-blur.d.cts +17 -0
- 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 +38 -0
- package/dist/components/radio-group.cjs.map +1 -0
- package/dist/components/radio-group.d.cts +10 -0
- package/dist/components/radio-group.d.ts +8 -8
- package/dist/components/radio-group.js +28 -30
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/record-picker.cjs +8 -0
- package/dist/components/record-picker.d.cts +16 -0
- package/dist/components/record-picker.d.ts +13 -13
- package/dist/components/record-picker.js +5 -364
- package/dist/components/resizable.cjs +50 -0
- package/dist/components/resizable.cjs.map +1 -0
- package/dist/components/resizable.d.cts +11 -0
- package/dist/components/resizable.d.ts +10 -10
- package/dist/components/resizable.js +29 -37
- package/dist/components/resizable.js.map +1 -1
- package/dist/components/responsive-diagram.cjs +56 -0
- package/dist/components/responsive-diagram.cjs.map +1 -0
- package/dist/components/responsive-diagram.d.cts +10 -0
- 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 +46 -0
- package/dist/components/scroll-area.cjs.map +1 -0
- package/dist/components/scroll-area.d.cts +12 -0
- package/dist/components/scroll-area.d.ts +11 -11
- package/dist/components/scroll-area.js +35 -62
- package/dist/components/scroll-area.js.map +1 -1
- package/dist/components/select.cjs +204 -0
- package/dist/components/select.cjs.map +1 -0
- package/dist/components/select.d.cts +47 -0
- package/dist/components/select.d.ts +38 -38
- package/dist/components/select.js +172 -269
- package/dist/components/select.js.map +1 -1
- package/dist/components/separator.cjs +23 -0
- package/dist/components/separator.cjs.map +1 -0
- package/dist/components/separator.d.cts +2 -0
- package/dist/components/separator.d.ts +2 -11
- package/dist/components/separator.js +14 -18
- package/dist/components/separator.js.map +1 -1
- package/dist/components/sheet.cjs +19 -0
- package/dist/components/sheet.d.cts +107 -0
- package/dist/components/sheet.d.ts +85 -90
- package/dist/components/sheet.js +3 -598
- package/dist/components/sidebar.cjs +29 -0
- package/dist/components/sidebar.d.cts +67 -0
- package/dist/components/sidebar.d.ts +63 -73
- package/dist/components/sidebar.js +3 -1215
- package/dist/components/skeleton.cjs +24 -0
- package/dist/components/skeleton.cjs.map +1 -0
- package/dist/components/skeleton.d.cts +11 -0
- package/dist/components/skeleton.d.ts +10 -6
- package/dist/components/skeleton.js +15 -10
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/sonner.cjs +23 -0
- package/dist/components/sonner.cjs.map +1 -0
- package/dist/components/sonner.d.cts +10 -0
- 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 +44 -0
- package/dist/components/stack/index.d.cts +2 -0
- package/dist/components/stack/index.d.ts +2 -674
- package/dist/components/stack/index.js +3 -1444
- package/dist/components/stepper.cjs +160 -0
- package/dist/components/stepper.cjs.map +1 -0
- package/dist/components/stepper.d.cts +32 -0
- package/dist/components/stepper.d.ts +27 -25
- package/dist/components/stepper.js +133 -261
- package/dist/components/stepper.js.map +1 -1
- package/dist/components/switch.cjs +35 -0
- package/dist/components/switch.cjs.map +1 -0
- package/dist/components/switch.d.cts +8 -0
- package/dist/components/switch.d.ts +7 -7
- package/dist/components/switch.js +26 -34
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.cjs +85 -0
- package/dist/components/table.cjs.map +1 -0
- package/dist/components/table.d.cts +23 -0
- package/dist/components/table.d.ts +23 -15
- package/dist/components/table.js +56 -46
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.cjs +49 -0
- package/dist/components/tabs.cjs.map +1 -0
- package/dist/components/tabs.d.cts +10 -0
- package/dist/components/tabs.d.ts +9 -9
- package/dist/components/tabs.js +31 -36
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/tags.cjs +132 -0
- package/dist/components/tags.cjs.map +1 -0
- package/dist/components/tags.d.cts +36 -0
- package/dist/components/tags.d.ts +24 -28
- package/dist/components/tags.js +114 -438
- package/dist/components/tags.js.map +1 -1
- package/dist/components/textarea.cjs +34 -0
- package/dist/components/textarea.cjs.map +1 -0
- package/dist/components/textarea.d.cts +10 -0
- package/dist/components/textarea.d.ts +8 -8
- package/dist/components/textarea.js +27 -48
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/toast/index.cjs +9 -0
- package/dist/components/toast/index.d.cts +2 -0
- package/dist/components/toast/index.d.ts +2 -52
- package/dist/components/toast/index.js +3 -623
- package/dist/components/tooltip.cjs +67 -0
- package/dist/components/tooltip.cjs.map +1 -0
- package/dist/components/tooltip.d.cts +2 -0
- package/dist/components/tooltip.d.ts +2 -29
- package/dist/components/tooltip.js +53 -166
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/unlink-button.cjs +24 -0
- package/dist/components/unlink-button.cjs.map +1 -0
- package/dist/components/unlink-button.d.cts +14 -0
- package/dist/components/unlink-button.d.ts +11 -11
- package/dist/components/unlink-button.js +18 -86
- 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 -9346
- package/dist/index.d.cts +224 -2548
- package/dist/index.d.ts +224 -2548
- package/dist/index.js +65 -9022
- 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 +288 -47
- package/src/styles/globals.css +155 -203
- package/dist/components/org-chart/index.d.ts +0 -54
- package/dist/components/org-chart/index.js +0 -861
- package/dist/components/org-chart/index.js.map +0 -1
- package/dist/components/record-picker.js.map +0 -1
- package/dist/components/sheet.js.map +0 -1
- package/dist/components/sidebar.js.map +0 -1
- package/dist/components/stack/index.js.map +0 -1
- package/dist/components/toast/index.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_utils = require('../utils-CzTQ3-VI.cjs');
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
let lucide_react = require("lucide-react");
|
|
7
|
+
let _internationalized_date = require("@internationalized/date");
|
|
8
|
+
let react_aria_components = require("react-aria-components");
|
|
9
|
+
|
|
10
|
+
//#region src/components/calendar-rac.tsx
|
|
11
|
+
function CalendarHeader() {
|
|
12
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("header", {
|
|
13
|
+
className: "flex w-full items-center gap-1 pb-1",
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.Button, {
|
|
16
|
+
slot: "previous",
|
|
17
|
+
className: "text-muted-foreground/80 hover:bg-accent hover:text-foreground focus-visible:ring-ring/50 flex size-9\n items-center justify-center rounded-md transition-[color,box-shadow] outline-none focus-visible:ring-[3px]",
|
|
18
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronLeftIcon, { size: 16 })
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.Heading, { className: "grow text-center text-sm font-medium" }),
|
|
21
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.Button, {
|
|
22
|
+
slot: "next",
|
|
23
|
+
className: "text-muted-foreground/80 hover:bg-accent hover:text-foreground focus-visible:ring-ring/50 flex size-9\n items-center justify-center rounded-md transition-[color,box-shadow] outline-none focus-visible:ring-[3px]",
|
|
24
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRightIcon, { size: 16 })
|
|
25
|
+
})
|
|
26
|
+
]
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function CalendarGridComponent({ isRange = false }) {
|
|
30
|
+
const now = (0, _internationalized_date.today)((0, _internationalized_date.getLocalTimeZone)());
|
|
31
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_aria_components.CalendarGrid, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.CalendarGridHeader, { children: (day) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.CalendarHeaderCell, {
|
|
32
|
+
className: "text-muted-foreground/80 size-9 rounded-md p-0 text-xs font-medium",
|
|
33
|
+
children: day
|
|
34
|
+
}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.CalendarGridBody, {
|
|
35
|
+
className: "[&_td]:px-0 [&_td]:py-px",
|
|
36
|
+
children: (date) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.CalendarCell, {
|
|
37
|
+
date,
|
|
38
|
+
className: require_utils.cn(`text-foreground data-hovered:bg-accent data-selected:bg-primary data-hovered:text-foreground
|
|
39
|
+
data-selected:text-primary-foreground data-focus-visible:ring-ring/50 relative flex size-9 items-center
|
|
40
|
+
justify-center rounded-md p-0 text-sm font-normal whitespace-nowrap
|
|
41
|
+
[transition-property:color,background-color,border-radius,box-shadow] duration-150 outline-none
|
|
42
|
+
data-disabled:pointer-events-none data-disabled:opacity-30 data-focus-visible:z-10
|
|
43
|
+
data-focus-visible:ring-[3px] data-unavailable:pointer-events-none data-unavailable:line-through
|
|
44
|
+
data-unavailable:opacity-30`, isRange && `data-selected:bg-accent data-selected:text-foreground data-invalid:data-selection-end:bg-destructive
|
|
45
|
+
data-invalid:data-selection-start:bg-destructive data-selection-end:bg-primary
|
|
46
|
+
data-selection-start:bg-primary data-selection-end:text-primary-foreground
|
|
47
|
+
data-selection-start:text-primary-foreground data-invalid:bg-red-100 data-selected:rounded-none
|
|
48
|
+
data-selection-end:rounded-e-md data-invalid:data-selection-end:text-white
|
|
49
|
+
data-selection-start:rounded-s-md data-invalid:data-selection-start:text-white`, date.compare(now) === 0 && require_utils.cn(`after:bg-primary after:pointer-events-none after:absolute after:start-1/2 after:bottom-1 after:z-10
|
|
50
|
+
after:size-[3px] after:-translate-x-1/2 after:rounded-full`, isRange ? "data-selection-end:after:bg-background data-selection-start:after:bg-background" : "data-selected:after:bg-background"))
|
|
51
|
+
})
|
|
52
|
+
})] });
|
|
53
|
+
}
|
|
54
|
+
function Calendar({ className, ...props }) {
|
|
55
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_aria_components.Calendar, {
|
|
56
|
+
...props,
|
|
57
|
+
className: (0, react_aria_components.composeRenderProps)(className, (className) => require_utils.cn("w-fit", className)),
|
|
58
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CalendarHeader, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CalendarGridComponent, {})]
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function RangeCalendar({ className, ...props }) {
|
|
62
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_aria_components.RangeCalendar, {
|
|
63
|
+
...props,
|
|
64
|
+
className: (0, react_aria_components.composeRenderProps)(className, (className) => require_utils.cn("w-fit", className)),
|
|
65
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CalendarHeader, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CalendarGridComponent, { isRange: true })]
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
//#endregion
|
|
70
|
+
exports.Calendar = Calendar;
|
|
71
|
+
exports.RangeCalendar = RangeCalendar;
|
|
72
|
+
//# sourceMappingURL=calendar-rac.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-rac.cjs","names":["Button","ChevronLeftIcon","HeadingRac","ChevronRightIcon","CalendarGridRac","CalendarGridHeaderRac","CalendarHeaderCellRac","CalendarGridBodyRac","CalendarCellRac","cn","CalendarRac","RangeCalendarRac"],"sources":["../../src/components/calendar-rac.tsx"],"sourcesContent":["'use client';\n\nimport { ComponentProps } from 'react';\nimport { getLocalTimeZone, today } from '@internationalized/date';\nimport { ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';\nimport {\n\tButton,\n\tCalendarCell as CalendarCellRac,\n\tCalendarGridBody as CalendarGridBodyRac,\n\tCalendarGridHeader as CalendarGridHeaderRac,\n\tCalendarGrid as CalendarGridRac,\n\tCalendarHeaderCell as CalendarHeaderCellRac,\n\tCalendar as CalendarRac,\n\tcomposeRenderProps,\n\tHeading as HeadingRac,\n\tRangeCalendar as RangeCalendarRac,\n} from 'react-aria-components';\n\nimport { cn } from '../lib/utils';\n\ninterface BaseCalendarProps {\n\tclassName?: string;\n}\n\ntype CalendarProps = ComponentProps<typeof CalendarRac> & BaseCalendarProps;\ntype RangeCalendarProps = ComponentProps<typeof RangeCalendarRac> & BaseCalendarProps;\n\nfunction CalendarHeader() {\n\treturn (\n\t\t<header className='flex w-full items-center gap-1 pb-1'>\n\t\t\t<Button\n\t\t\t\tslot='previous'\n\t\t\t\tclassName='text-muted-foreground/80 hover:bg-accent hover:text-foreground focus-visible:ring-ring/50 flex size-9\n\t\t\t\t\titems-center justify-center rounded-md transition-[color,box-shadow] outline-none focus-visible:ring-[3px]'\n\t\t\t>\n\t\t\t\t<ChevronLeftIcon size={16} />\n\t\t\t</Button>\n\t\t\t<HeadingRac className='grow text-center text-sm font-medium' />\n\t\t\t<Button\n\t\t\t\tslot='next'\n\t\t\t\tclassName='text-muted-foreground/80 hover:bg-accent hover:text-foreground focus-visible:ring-ring/50 flex size-9\n\t\t\t\t\titems-center justify-center rounded-md transition-[color,box-shadow] outline-none focus-visible:ring-[3px]'\n\t\t\t>\n\t\t\t\t<ChevronRightIcon size={16} />\n\t\t\t</Button>\n\t\t</header>\n\t);\n}\n\nfunction CalendarGridComponent({ isRange = false }: { isRange?: boolean }) {\n\tconst now = today(getLocalTimeZone());\n\n\treturn (\n\t\t<CalendarGridRac>\n\t\t\t<CalendarGridHeaderRac>\n\t\t\t\t{(day) => (\n\t\t\t\t\t<CalendarHeaderCellRac className='text-muted-foreground/80 size-9 rounded-md p-0 text-xs font-medium'>\n\t\t\t\t\t\t{day}\n\t\t\t\t\t</CalendarHeaderCellRac>\n\t\t\t\t)}\n\t\t\t</CalendarGridHeaderRac>\n\t\t\t<CalendarGridBodyRac className='[&_td]:px-0 [&_td]:py-px'>\n\t\t\t\t{(date) => (\n\t\t\t\t\t<CalendarCellRac\n\t\t\t\t\t\tdate={date}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t`text-foreground data-hovered:bg-accent data-selected:bg-primary data-hovered:text-foreground\n\t\t\t\t\t\t\tdata-selected:text-primary-foreground data-focus-visible:ring-ring/50 relative flex size-9 items-center\n\t\t\t\t\t\t\tjustify-center rounded-md p-0 text-sm font-normal whitespace-nowrap\n\t\t\t\t\t\t\t[transition-property:color,background-color,border-radius,box-shadow] duration-150 outline-none\n\t\t\t\t\t\t\tdata-disabled:pointer-events-none data-disabled:opacity-30 data-focus-visible:z-10\n\t\t\t\t\t\t\tdata-focus-visible:ring-[3px] data-unavailable:pointer-events-none data-unavailable:line-through\n\t\t\t\t\t\t\tdata-unavailable:opacity-30`,\n\t\t\t\t\t\t\t// Range-specific styles\n\t\t\t\t\t\t\tisRange &&\n\t\t\t\t\t\t\t\t`data-selected:bg-accent data-selected:text-foreground data-invalid:data-selection-end:bg-destructive\n\t\t\t\t\t\t\t\tdata-invalid:data-selection-start:bg-destructive data-selection-end:bg-primary\n\t\t\t\t\t\t\t\tdata-selection-start:bg-primary data-selection-end:text-primary-foreground\n\t\t\t\t\t\t\t\tdata-selection-start:text-primary-foreground data-invalid:bg-red-100 data-selected:rounded-none\n\t\t\t\t\t\t\t\tdata-selection-end:rounded-e-md data-invalid:data-selection-end:text-white\n\t\t\t\t\t\t\t\tdata-selection-start:rounded-s-md data-invalid:data-selection-start:text-white`,\n\t\t\t\t\t\t\t// Today indicator styles\n\t\t\t\t\t\t\tdate.compare(now) === 0 &&\n\t\t\t\t\t\t\t\tcn(\n\t\t\t\t\t\t\t\t\t`after:bg-primary after:pointer-events-none after:absolute after:start-1/2 after:bottom-1 after:z-10\n\t\t\t\t\t\t\t\t\tafter:size-[3px] after:-translate-x-1/2 after:rounded-full`,\n\t\t\t\t\t\t\t\t\tisRange\n\t\t\t\t\t\t\t\t\t\t? 'data-selection-end:after:bg-background data-selection-start:after:bg-background'\n\t\t\t\t\t\t\t\t\t\t: 'data-selected:after:bg-background',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</CalendarGridBodyRac>\n\t\t</CalendarGridRac>\n\t);\n}\n\nfunction Calendar({ className, ...props }: CalendarProps) {\n\treturn (\n\t\t<CalendarRac {...props} className={composeRenderProps(className, (className) => cn('w-fit', className))}>\n\t\t\t<CalendarHeader />\n\t\t\t<CalendarGridComponent />\n\t\t</CalendarRac>\n\t);\n}\n\nfunction RangeCalendar({ className, ...props }: RangeCalendarProps) {\n\treturn (\n\t\t<RangeCalendarRac {...props} className={composeRenderProps(className, (className) => cn('w-fit', className))}>\n\t\t\t<CalendarHeader />\n\t\t\t<CalendarGridComponent isRange />\n\t\t</RangeCalendarRac>\n\t);\n}\n\nexport { Calendar, RangeCalendar };\n"],"mappings":";;;;;;;;;;AA2BA,SAAS,iBAAiB;CACzB,OACC,4CAAC,UAAD;EAAQ,WAAU;YAAlB;GACC,2CAACA,8BAAD;IACC,MAAK;IACL,WAAU;cAGV,2CAACC,8BAAD,EAAiB,MAAM,GAAK;GACrB;GACR,2CAACC,+BAAD,EAAY,WAAU,uCAAwC;GAC9D,2CAACF,8BAAD;IACC,MAAK;IACL,WAAU;cAGV,2CAACG,+BAAD,EAAkB,MAAM,GAAK;GACtB;EACD;;AAEV;AAEA,SAAS,sBAAsB,EAAE,UAAU,SAAgC;CAC1E,MAAM,uFAA6B,CAAC;CAEpC,OACC,4CAACC,oCAAD,aACC,2CAACC,0CAAD,aACG,QACD,2CAACC,0CAAD;EAAuB,WAAU;YAC/B;CACqB,GAEF,IACvB,2CAACC,wCAAD;EAAqB,WAAU;aAC5B,SACD,2CAACC,oCAAD;GACO;GACN,WAAWC,iBACV;;;;;;qCAQA,WACC;;;;;yFAOD,KAAK,QAAQ,GAAG,MAAM,KACrBA,iBACC;sEAEA,UACG,oFACA,mCACJ,CACF;EACA;CAEkB,EACL;AAEnB;AAEA,SAAS,SAAS,EAAE,WAAW,GAAG,SAAwB;CACzD,OACC,4CAACC,gCAAD;EAAa,GAAI;EAAO,yDAA8B,YAAY,cAAcD,iBAAG,SAAS,SAAS,CAAC;YAAtG,CACC,2CAAC,gBAAD,CAAiB,IACjB,2CAAC,uBAAD,CAAwB,EACZ;;AAEf;AAEA,SAAS,cAAc,EAAE,WAAW,GAAG,SAA6B;CACnE,OACC,4CAACE,qCAAD;EAAkB,GAAI;EAAO,yDAA8B,YAAY,cAAcF,iBAAG,SAAS,SAAS,CAAC;YAA3G,CACC,2CAAC,gBAAD,CAAiB,IACjB,2CAAC,uBAAD,EAAuB,cAAS,EACf;;AAEpB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import { Calendar as Calendar$1, RangeCalendar as RangeCalendar$1 } from "react-aria-components";
|
|
3
|
+
//#region src/components/calendar-rac.d.ts
|
|
4
|
+
interface BaseCalendarProps {
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
type CalendarProps = ComponentProps<typeof Calendar$1> & BaseCalendarProps;
|
|
8
|
+
type RangeCalendarProps = ComponentProps<typeof RangeCalendar$1> & BaseCalendarProps;
|
|
9
|
+
declare function Calendar({ className, ...props }: CalendarProps): import("react").JSX.Element;
|
|
10
|
+
declare function RangeCalendar({ className, ...props }: RangeCalendarProps): import("react").JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Calendar, RangeCalendar };
|
|
13
|
+
//# sourceMappingURL=calendar-rac.d.cts.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import { Calendar as Calendar$1, RangeCalendar as RangeCalendar$1 } from "react-aria-components";
|
|
3
|
+
//#region src/components/calendar-rac.d.ts
|
|
5
4
|
interface BaseCalendarProps {
|
|
6
|
-
|
|
5
|
+
className?: string;
|
|
7
6
|
}
|
|
8
7
|
type CalendarProps = ComponentProps<typeof Calendar$1> & BaseCalendarProps;
|
|
9
8
|
type RangeCalendarProps = ComponentProps<typeof RangeCalendar$1> & BaseCalendarProps;
|
|
10
|
-
declare function Calendar({ className, ...props }: CalendarProps):
|
|
11
|
-
declare function RangeCalendar({ className, ...props }: RangeCalendarProps):
|
|
12
|
-
|
|
9
|
+
declare function Calendar({ className, ...props }: CalendarProps): import("react").JSX.Element;
|
|
10
|
+
declare function RangeCalendar({ className, ...props }: RangeCalendarProps): import("react").JSX.Element;
|
|
11
|
+
//#endregion
|
|
13
12
|
export { Calendar, RangeCalendar };
|
|
13
|
+
//# sourceMappingURL=calendar-rac.d.ts.map
|
|
@@ -1,82 +1,70 @@
|
|
|
1
|
-
|
|
2
|
-
import { today, getLocalTimeZone } from '@internationalized/date';
|
|
3
|
-
import { ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';
|
|
4
|
-
import { Calendar as Calendar$1, composeRenderProps, RangeCalendar as RangeCalendar$1, Button, Heading, CalendarGrid, CalendarGridHeader, CalendarHeaderCell, CalendarGridBody, CalendarCell } from 'react-aria-components';
|
|
5
|
-
import { clsx } from 'clsx';
|
|
6
|
-
import { twMerge } from 'tailwind-merge';
|
|
7
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
|
+
'use client';
|
|
8
2
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
3
|
+
import { t as cn } from "../utils-BkMLyah9.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
6
|
+
import { getLocalTimeZone, today } from "@internationalized/date";
|
|
7
|
+
import { Button, Calendar as Calendar$1, CalendarCell, CalendarGrid, CalendarGridBody, CalendarGridHeader, CalendarHeaderCell, Heading, RangeCalendar as RangeCalendar$1, composeRenderProps } from "react-aria-components";
|
|
8
|
+
|
|
9
|
+
//#region src/components/calendar-rac.tsx
|
|
12
10
|
function CalendarHeader() {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
)
|
|
31
|
-
] });
|
|
11
|
+
return /* @__PURE__ */ jsxs("header", {
|
|
12
|
+
className: "flex w-full items-center gap-1 pb-1",
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ jsx(Button, {
|
|
15
|
+
slot: "previous",
|
|
16
|
+
className: "text-muted-foreground/80 hover:bg-accent hover:text-foreground focus-visible:ring-ring/50 flex size-9\n items-center justify-center rounded-md transition-[color,box-shadow] outline-none focus-visible:ring-[3px]",
|
|
17
|
+
children: /* @__PURE__ */ jsx(ChevronLeftIcon, { size: 16 })
|
|
18
|
+
}),
|
|
19
|
+
/* @__PURE__ */ jsx(Heading, { className: "grow text-center text-sm font-medium" }),
|
|
20
|
+
/* @__PURE__ */ jsx(Button, {
|
|
21
|
+
slot: "next",
|
|
22
|
+
className: "text-muted-foreground/80 hover:bg-accent hover:text-foreground focus-visible:ring-ring/50 flex size-9\n items-center justify-center rounded-md transition-[color,box-shadow] outline-none focus-visible:ring-[3px]",
|
|
23
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, { size: 16 })
|
|
24
|
+
})
|
|
25
|
+
]
|
|
26
|
+
});
|
|
32
27
|
}
|
|
33
28
|
function CalendarGridComponent({ isRange = false }) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
29
|
+
const now = today(getLocalTimeZone());
|
|
30
|
+
return /* @__PURE__ */ jsxs(CalendarGrid, { children: [/* @__PURE__ */ jsx(CalendarGridHeader, { children: (day) => /* @__PURE__ */ jsx(CalendarHeaderCell, {
|
|
31
|
+
className: "text-muted-foreground/80 size-9 rounded-md p-0 text-xs font-medium",
|
|
32
|
+
children: day
|
|
33
|
+
}) }), /* @__PURE__ */ jsx(CalendarGridBody, {
|
|
34
|
+
className: "[&_td]:px-0 [&_td]:py-px",
|
|
35
|
+
children: (date) => /* @__PURE__ */ jsx(CalendarCell, {
|
|
36
|
+
date,
|
|
37
|
+
className: cn(`text-foreground data-hovered:bg-accent data-selected:bg-primary data-hovered:text-foreground
|
|
43
38
|
data-selected:text-primary-foreground data-focus-visible:ring-ring/50 relative flex size-9 items-center
|
|
44
39
|
justify-center rounded-md p-0 text-sm font-normal whitespace-nowrap
|
|
45
40
|
[transition-property:color,background-color,border-radius,box-shadow] duration-150 outline-none
|
|
46
41
|
data-disabled:pointer-events-none data-disabled:opacity-30 data-focus-visible:z-10
|
|
47
42
|
data-focus-visible:ring-[3px] data-unavailable:pointer-events-none data-unavailable:line-through
|
|
48
|
-
data-unavailable:opacity-30`,
|
|
49
|
-
// Range-specific styles
|
|
50
|
-
isRange && `data-selected:bg-accent data-selected:text-foreground data-invalid:data-selection-end:bg-destructive
|
|
43
|
+
data-unavailable:opacity-30`, isRange && `data-selected:bg-accent data-selected:text-foreground data-invalid:data-selection-end:bg-destructive
|
|
51
44
|
data-invalid:data-selection-start:bg-destructive data-selection-end:bg-primary
|
|
52
45
|
data-selection-start:bg-primary data-selection-end:text-primary-foreground
|
|
53
46
|
data-selection-start:text-primary-foreground data-invalid:bg-red-100 data-selected:rounded-none
|
|
54
47
|
data-selection-end:rounded-e-md data-invalid:data-selection-end:text-white
|
|
55
|
-
data-selection-start:rounded-s-md data-invalid:data-selection-start:text-white`,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
after:size-[3px] after:-translate-x-1/2 after:rounded-full`,
|
|
60
|
-
isRange ? "data-selection-end:after:bg-background data-selection-start:after:bg-background" : "data-selected:after:bg-background"
|
|
61
|
-
)
|
|
62
|
-
)
|
|
63
|
-
}
|
|
64
|
-
) })
|
|
65
|
-
] });
|
|
48
|
+
data-selection-start:rounded-s-md data-invalid:data-selection-start:text-white`, date.compare(now) === 0 && cn(`after:bg-primary after:pointer-events-none after:absolute after:start-1/2 after:bottom-1 after:z-10
|
|
49
|
+
after:size-[3px] after:-translate-x-1/2 after:rounded-full`, isRange ? "data-selection-end:after:bg-background data-selection-start:after:bg-background" : "data-selected:after:bg-background"))
|
|
50
|
+
})
|
|
51
|
+
})] });
|
|
66
52
|
}
|
|
67
53
|
function Calendar({ className, ...props }) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
54
|
+
return /* @__PURE__ */ jsxs(Calendar$1, {
|
|
55
|
+
...props,
|
|
56
|
+
className: composeRenderProps(className, (className) => cn("w-fit", className)),
|
|
57
|
+
children: [/* @__PURE__ */ jsx(CalendarHeader, {}), /* @__PURE__ */ jsx(CalendarGridComponent, {})]
|
|
58
|
+
});
|
|
72
59
|
}
|
|
73
60
|
function RangeCalendar({ className, ...props }) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
61
|
+
return /* @__PURE__ */ jsxs(RangeCalendar$1, {
|
|
62
|
+
...props,
|
|
63
|
+
className: composeRenderProps(className, (className) => cn("w-fit", className)),
|
|
64
|
+
children: [/* @__PURE__ */ jsx(CalendarHeader, {}), /* @__PURE__ */ jsx(CalendarGridComponent, { isRange: true })]
|
|
65
|
+
});
|
|
78
66
|
}
|
|
79
67
|
|
|
68
|
+
//#endregion
|
|
80
69
|
export { Calendar, RangeCalendar };
|
|
81
|
-
//# sourceMappingURL=calendar-rac.js.map
|
|
82
70
|
//# sourceMappingURL=calendar-rac.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"calendar-rac.js","names":["HeadingRac","CalendarGridRac","CalendarGridHeaderRac","CalendarHeaderCellRac","CalendarGridBodyRac","CalendarCellRac","CalendarRac","RangeCalendarRac"],"sources":["../../src/components/calendar-rac.tsx"],"sourcesContent":["'use client';\n\nimport { ComponentProps } from 'react';\nimport { getLocalTimeZone, today } from '@internationalized/date';\nimport { ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';\nimport {\n\tButton,\n\tCalendarCell as CalendarCellRac,\n\tCalendarGridBody as CalendarGridBodyRac,\n\tCalendarGridHeader as CalendarGridHeaderRac,\n\tCalendarGrid as CalendarGridRac,\n\tCalendarHeaderCell as CalendarHeaderCellRac,\n\tCalendar as CalendarRac,\n\tcomposeRenderProps,\n\tHeading as HeadingRac,\n\tRangeCalendar as RangeCalendarRac,\n} from 'react-aria-components';\n\nimport { cn } from '../lib/utils';\n\ninterface BaseCalendarProps {\n\tclassName?: string;\n}\n\ntype CalendarProps = ComponentProps<typeof CalendarRac> & BaseCalendarProps;\ntype RangeCalendarProps = ComponentProps<typeof RangeCalendarRac> & BaseCalendarProps;\n\nfunction CalendarHeader() {\n\treturn (\n\t\t<header className='flex w-full items-center gap-1 pb-1'>\n\t\t\t<Button\n\t\t\t\tslot='previous'\n\t\t\t\tclassName='text-muted-foreground/80 hover:bg-accent hover:text-foreground focus-visible:ring-ring/50 flex size-9\n\t\t\t\t\titems-center justify-center rounded-md transition-[color,box-shadow] outline-none focus-visible:ring-[3px]'\n\t\t\t>\n\t\t\t\t<ChevronLeftIcon size={16} />\n\t\t\t</Button>\n\t\t\t<HeadingRac className='grow text-center text-sm font-medium' />\n\t\t\t<Button\n\t\t\t\tslot='next'\n\t\t\t\tclassName='text-muted-foreground/80 hover:bg-accent hover:text-foreground focus-visible:ring-ring/50 flex size-9\n\t\t\t\t\titems-center justify-center rounded-md transition-[color,box-shadow] outline-none focus-visible:ring-[3px]'\n\t\t\t>\n\t\t\t\t<ChevronRightIcon size={16} />\n\t\t\t</Button>\n\t\t</header>\n\t);\n}\n\nfunction CalendarGridComponent({ isRange = false }: { isRange?: boolean }) {\n\tconst now = today(getLocalTimeZone());\n\n\treturn (\n\t\t<CalendarGridRac>\n\t\t\t<CalendarGridHeaderRac>\n\t\t\t\t{(day) => (\n\t\t\t\t\t<CalendarHeaderCellRac className='text-muted-foreground/80 size-9 rounded-md p-0 text-xs font-medium'>\n\t\t\t\t\t\t{day}\n\t\t\t\t\t</CalendarHeaderCellRac>\n\t\t\t\t)}\n\t\t\t</CalendarGridHeaderRac>\n\t\t\t<CalendarGridBodyRac className='[&_td]:px-0 [&_td]:py-px'>\n\t\t\t\t{(date) => (\n\t\t\t\t\t<CalendarCellRac\n\t\t\t\t\t\tdate={date}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t`text-foreground data-hovered:bg-accent data-selected:bg-primary data-hovered:text-foreground\n\t\t\t\t\t\t\tdata-selected:text-primary-foreground data-focus-visible:ring-ring/50 relative flex size-9 items-center\n\t\t\t\t\t\t\tjustify-center rounded-md p-0 text-sm font-normal whitespace-nowrap\n\t\t\t\t\t\t\t[transition-property:color,background-color,border-radius,box-shadow] duration-150 outline-none\n\t\t\t\t\t\t\tdata-disabled:pointer-events-none data-disabled:opacity-30 data-focus-visible:z-10\n\t\t\t\t\t\t\tdata-focus-visible:ring-[3px] data-unavailable:pointer-events-none data-unavailable:line-through\n\t\t\t\t\t\t\tdata-unavailable:opacity-30`,\n\t\t\t\t\t\t\t// Range-specific styles\n\t\t\t\t\t\t\tisRange &&\n\t\t\t\t\t\t\t\t`data-selected:bg-accent data-selected:text-foreground data-invalid:data-selection-end:bg-destructive\n\t\t\t\t\t\t\t\tdata-invalid:data-selection-start:bg-destructive data-selection-end:bg-primary\n\t\t\t\t\t\t\t\tdata-selection-start:bg-primary data-selection-end:text-primary-foreground\n\t\t\t\t\t\t\t\tdata-selection-start:text-primary-foreground data-invalid:bg-red-100 data-selected:rounded-none\n\t\t\t\t\t\t\t\tdata-selection-end:rounded-e-md data-invalid:data-selection-end:text-white\n\t\t\t\t\t\t\t\tdata-selection-start:rounded-s-md data-invalid:data-selection-start:text-white`,\n\t\t\t\t\t\t\t// Today indicator styles\n\t\t\t\t\t\t\tdate.compare(now) === 0 &&\n\t\t\t\t\t\t\t\tcn(\n\t\t\t\t\t\t\t\t\t`after:bg-primary after:pointer-events-none after:absolute after:start-1/2 after:bottom-1 after:z-10\n\t\t\t\t\t\t\t\t\tafter:size-[3px] after:-translate-x-1/2 after:rounded-full`,\n\t\t\t\t\t\t\t\t\tisRange\n\t\t\t\t\t\t\t\t\t\t? 'data-selection-end:after:bg-background data-selection-start:after:bg-background'\n\t\t\t\t\t\t\t\t\t\t: 'data-selected:after:bg-background',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</CalendarGridBodyRac>\n\t\t</CalendarGridRac>\n\t);\n}\n\nfunction Calendar({ className, ...props }: CalendarProps) {\n\treturn (\n\t\t<CalendarRac {...props} className={composeRenderProps(className, (className) => cn('w-fit', className))}>\n\t\t\t<CalendarHeader />\n\t\t\t<CalendarGridComponent />\n\t\t</CalendarRac>\n\t);\n}\n\nfunction RangeCalendar({ className, ...props }: RangeCalendarProps) {\n\treturn (\n\t\t<RangeCalendarRac {...props} className={composeRenderProps(className, (className) => cn('w-fit', className))}>\n\t\t\t<CalendarHeader />\n\t\t\t<CalendarGridComponent isRange />\n\t\t</RangeCalendarRac>\n\t);\n}\n\nexport { Calendar, RangeCalendar };\n"],"mappings":";;;;;;;;;AA2BA,SAAS,iBAAiB;CACzB,OACC,qBAAC,UAAD;EAAQ,WAAU;YAAlB;GACC,oBAAC,QAAD;IACC,MAAK;IACL,WAAU;cAGV,oBAAC,iBAAD,EAAiB,MAAM,GAAK;GACrB;GACR,oBAACA,SAAD,EAAY,WAAU,uCAAwC;GAC9D,oBAAC,QAAD;IACC,MAAK;IACL,WAAU;cAGV,oBAAC,kBAAD,EAAkB,MAAM,GAAK;GACtB;EACD;;AAEV;AAEA,SAAS,sBAAsB,EAAE,UAAU,SAAgC;CAC1E,MAAM,MAAM,MAAM,iBAAiB,CAAC;CAEpC,OACC,qBAACC,cAAD,aACC,oBAACC,oBAAD,aACG,QACD,oBAACC,oBAAD;EAAuB,WAAU;YAC/B;CACqB,GAEF,IACvB,oBAACC,kBAAD;EAAqB,WAAU;aAC5B,SACD,oBAACC,cAAD;GACO;GACN,WAAW,GACV;;;;;;qCAQA,WACC;;;;;yFAOD,KAAK,QAAQ,GAAG,MAAM,KACrB,GACC;sEAEA,UACG,oFACA,mCACJ,CACF;EACA;CAEkB,EACL;AAEnB;AAEA,SAAS,SAAS,EAAE,WAAW,GAAG,SAAwB;CACzD,OACC,qBAACC,YAAD;EAAa,GAAI;EAAO,WAAW,mBAAmB,YAAY,cAAc,GAAG,SAAS,SAAS,CAAC;YAAtG,CACC,oBAAC,gBAAD,CAAiB,IACjB,oBAAC,uBAAD,CAAwB,EACZ;;AAEf;AAEA,SAAS,cAAc,EAAE,WAAW,GAAG,SAA6B;CACnE,OACC,qBAACC,iBAAD;EAAkB,GAAI;EAAO,WAAW,mBAAmB,YAAY,cAAc,GAAG,SAAS,SAAS,CAAC;YAA3G,CACC,oBAAC,gBAAD,CAAiB,IACjB,oBAAC,uBAAD,EAAuB,cAAS,EACf;;AAEpB"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
3
|
+
const require_rolldown_runtime = require('../rolldown-runtime-D_qnwXdH.cjs');
|
|
4
|
+
const require_utils = require('../utils-CzTQ3-VI.cjs');
|
|
5
|
+
let react = require("react");
|
|
6
|
+
react = require_rolldown_runtime.__toESM(react, 1);
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
let class_variance_authority = require("class-variance-authority");
|
|
9
|
+
|
|
10
|
+
//#region src/components/card.tsx
|
|
11
|
+
const cardVariants = (0, class_variance_authority.cva)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl py-6", {
|
|
12
|
+
variants: { variant: {
|
|
13
|
+
default: "shadow-card",
|
|
14
|
+
elevated: "shadow-card-lg",
|
|
15
|
+
flat: "border border-border/60 shadow-none",
|
|
16
|
+
ghost: "bg-transparent shadow-none",
|
|
17
|
+
interactive: [
|
|
18
|
+
"shadow-card",
|
|
19
|
+
"hover:shadow-card-lg motion-safe:hover:-translate-y-0.5",
|
|
20
|
+
"transition-[box-shadow,translate] duration-200 motion-reduce:transition-shadow",
|
|
21
|
+
"cursor-pointer"
|
|
22
|
+
]
|
|
23
|
+
} },
|
|
24
|
+
defaultVariants: { variant: "default" }
|
|
25
|
+
});
|
|
26
|
+
function Card({ className, variant, ...props }) {
|
|
27
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
28
|
+
"data-slot": "card",
|
|
29
|
+
className: require_utils.cn(cardVariants({ variant }), className),
|
|
30
|
+
...props
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function CardHeader({ className, ...props }) {
|
|
34
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
35
|
+
"data-slot": "card-header",
|
|
36
|
+
className: require_utils.cn(`@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6
|
|
37
|
+
has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6`, className),
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function CardTitle({ className, ...props }) {
|
|
42
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
43
|
+
"data-slot": "card-title",
|
|
44
|
+
className: require_utils.cn("text-balance leading-none font-semibold tracking-tight", className),
|
|
45
|
+
...props
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function CardDescription({ className, ...props }) {
|
|
49
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
50
|
+
"data-slot": "card-description",
|
|
51
|
+
className: require_utils.cn("text-muted-foreground text-pretty text-sm", className),
|
|
52
|
+
...props
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function CardAction({ className, ...props }) {
|
|
56
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
57
|
+
"data-slot": "card-action",
|
|
58
|
+
className: require_utils.cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className),
|
|
59
|
+
...props
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function CardContent({ className, ...props }) {
|
|
63
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
64
|
+
"data-slot": "card-content",
|
|
65
|
+
className: require_utils.cn("px-6", className),
|
|
66
|
+
...props
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function CardFooter({ className, ...props }) {
|
|
70
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
71
|
+
"data-slot": "card-footer",
|
|
72
|
+
className: require_utils.cn("flex items-center px-6 [.border-t]:pt-6", className),
|
|
73
|
+
...props
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
exports.Card = Card;
|
|
79
|
+
exports.CardAction = CardAction;
|
|
80
|
+
exports.CardContent = CardContent;
|
|
81
|
+
exports.CardDescription = CardDescription;
|
|
82
|
+
exports.CardFooter = CardFooter;
|
|
83
|
+
exports.CardHeader = CardHeader;
|
|
84
|
+
exports.CardTitle = CardTitle;
|
|
85
|
+
exports.cardVariants = cardVariants;
|
|
86
|
+
//# sourceMappingURL=card.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.cjs","names":["cn"],"sources":["../../src/components/card.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../lib/utils';\n\nconst cardVariants = cva(\n\t// Base styles\n\t\t'bg-card text-card-foreground flex flex-col gap-6 rounded-xl py-6',\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: 'shadow-card',\n\t\t\t\televated: 'shadow-card-lg',\n\t\t\t\tflat: 'border border-border/60 shadow-none',\n\t\t\t\tghost: 'bg-transparent shadow-none',\n\t\t\t\tinteractive: [\n\t\t\t\t\t'shadow-card',\n\t\t\t\t\t'hover:shadow-card-lg motion-safe:hover:-translate-y-0.5',\n\t\t\t\t\t'transition-[box-shadow,translate] duration-200 motion-reduce:transition-shadow',\n\t\t\t\t\t'cursor-pointer',\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: 'default',\n\t\t},\n\t},\n);\n\ninterface CardProps extends React.ComponentProps<'div'>, VariantProps<typeof cardVariants> {}\n\nfunction Card({ className, variant, ...props }: CardProps) {\n\treturn <div data-slot=\"card\" className={cn(cardVariants({ variant }), className)} {...props} />;\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"card-header\"\n\t\t\tclassName={cn(\n\t\t\t\t`@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6\n\t\t\t\thas-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"card-title\"\n\t\t\tclassName={cn('text-balance leading-none font-semibold tracking-tight', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"card-description\"\n\t\t\tclassName={cn('text-muted-foreground text-pretty text-sm', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CardAction({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"card-action\"\n\t\t\tclassName={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn <div data-slot=\"card-content\" className={cn('px-6', className)} {...props} />;\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div data-slot=\"card-footer\" className={cn('flex items-center px-6 [.border-t]:pt-6', className)} {...props} />\n\t);\n}\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, cardVariants };\nexport type { CardProps };\n"],"mappings":";;;;;;;;;;AAKA,MAAM,iDAEJ,oEACD;CACC,UAAU,EACT,SAAS;EACR,SAAS;EACT,UAAU;EACV,MAAM;EACN,OAAO;EACP,aAAa;GACZ;GACA;GACA;GACA;EACD;CACD,EACD;CACA,iBAAiB,EAChB,SAAS,UACV;AACD,CACD;AAIA,SAAS,KAAK,EAAE,WAAW,SAAS,GAAG,SAAoB;CAC1D,OAAO,2CAAC,OAAD;EAAK,aAAU;EAAO,WAAWA,iBAAG,aAAa,EAAE,QAAQ,CAAC,GAAG,SAAS;EAAG,GAAI;CAAQ;AAC/F;AAEA,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;CACzE,OACC,2CAAC,OAAD;EACC,aAAU;EACV,WAAWA,iBACV;wEAEA,SACD;EACA,GAAI;CACJ;AAEH;AAEA,SAAS,UAAU,EAAE,WAAW,GAAG,SAAsC;CACxE,OACC,2CAAC,OAAD;EACC,aAAU;EACV,WAAWA,iBAAG,0DAA0D,SAAS;EACjF,GAAI;CACJ;AAEH;AAEA,SAAS,gBAAgB,EAAE,WAAW,GAAG,SAAsC;CAC9E,OACC,2CAAC,OAAD;EACC,aAAU;EACV,WAAWA,iBAAG,6CAA6C,SAAS;EACpE,GAAI;CACJ;AAEH;AAEA,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;CACzE,OACC,2CAAC,OAAD;EACC,aAAU;EACV,WAAWA,iBAAG,kEAAkE,SAAS;EACzF,GAAI;CACJ;AAEH;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAAsC;CAC1E,OAAO,2CAAC,OAAD;EAAK,aAAU;EAAe,WAAWA,iBAAG,QAAQ,SAAS;EAAG,GAAI;CAAQ;AACpF;AAEA,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;CACzE,OACC,2CAAC,OAAD;EAAK,aAAU;EAAc,WAAWA,iBAAG,2CAA2C,SAAS;EAAG,GAAI;CAAQ;AAEhH"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
//#region src/components/card.d.ts
|
|
4
|
+
declare const cardVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "ghost" | "elevated" | "flat" | "interactive" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
interface CardProps extends React$1.ComponentProps<'div'>, VariantProps<typeof cardVariants> {}
|
|
8
|
+
declare function Card({ className, variant, ...props }: CardProps): React$1.JSX.Element;
|
|
9
|
+
declare function CardHeader({ className, ...props }: React$1.ComponentProps<'div'>): React$1.JSX.Element;
|
|
10
|
+
declare function CardTitle({ className, ...props }: React$1.ComponentProps<'div'>): React$1.JSX.Element;
|
|
11
|
+
declare function CardDescription({ className, ...props }: React$1.ComponentProps<'div'>): React$1.JSX.Element;
|
|
12
|
+
declare function CardAction({ className, ...props }: React$1.ComponentProps<'div'>): React$1.JSX.Element;
|
|
13
|
+
declare function CardContent({ className, ...props }: React$1.ComponentProps<'div'>): React$1.JSX.Element;
|
|
14
|
+
declare function CardFooter({ className, ...props }: React$1.ComponentProps<'div'>): React$1.JSX.Element;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, cardVariants };
|
|
17
|
+
//# sourceMappingURL=card.d.cts.map
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import { VariantProps } from 'class-variance-authority';
|
|
5
|
-
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
//#region src/components/card.d.ts
|
|
6
4
|
declare const cardVariants: (props?: ({
|
|
7
|
-
|
|
8
|
-
} &
|
|
9
|
-
interface CardProps extends React.ComponentProps<'div'>, VariantProps<typeof cardVariants> {
|
|
10
|
-
}
|
|
11
|
-
declare function
|
|
12
|
-
declare function
|
|
13
|
-
declare function
|
|
14
|
-
declare function
|
|
15
|
-
declare function
|
|
16
|
-
declare function
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
variant?: "default" | "ghost" | "elevated" | "flat" | "interactive" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
interface CardProps extends React$1.ComponentProps<'div'>, VariantProps<typeof cardVariants> {}
|
|
8
|
+
declare function Card({ className, variant, ...props }: CardProps): React$1.JSX.Element;
|
|
9
|
+
declare function CardHeader({ className, ...props }: React$1.ComponentProps<'div'>): React$1.JSX.Element;
|
|
10
|
+
declare function CardTitle({ className, ...props }: React$1.ComponentProps<'div'>): React$1.JSX.Element;
|
|
11
|
+
declare function CardDescription({ className, ...props }: React$1.ComponentProps<'div'>): React$1.JSX.Element;
|
|
12
|
+
declare function CardAction({ className, ...props }: React$1.ComponentProps<'div'>): React$1.JSX.Element;
|
|
13
|
+
declare function CardContent({ className, ...props }: React$1.ComponentProps<'div'>): React$1.JSX.Element;
|
|
14
|
+
declare function CardFooter({ className, ...props }: React$1.ComponentProps<'div'>): React$1.JSX.Element;
|
|
15
|
+
//#endregion
|
|
19
16
|
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, cardVariants };
|
|
17
|
+
//# sourceMappingURL=card.d.ts.map
|
package/dist/components/card.js
CHANGED
|
@@ -1,75 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
'use client';
|
|
2
|
+
import { t as cn } from "../utils-BkMLyah9.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"hover:shadow-card-lg hover:border-border/70 hover:-translate-y-0.5",
|
|
24
|
-
"cursor-pointer"
|
|
25
|
-
]
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
defaultVariants: {
|
|
29
|
-
variant: "default"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
);
|
|
7
|
+
//#region src/components/card.tsx
|
|
8
|
+
const cardVariants = cva("bg-card text-card-foreground flex flex-col gap-6 rounded-xl py-6", {
|
|
9
|
+
variants: { variant: {
|
|
10
|
+
default: "shadow-card",
|
|
11
|
+
elevated: "shadow-card-lg",
|
|
12
|
+
flat: "border border-border/60 shadow-none",
|
|
13
|
+
ghost: "bg-transparent shadow-none",
|
|
14
|
+
interactive: [
|
|
15
|
+
"shadow-card",
|
|
16
|
+
"hover:shadow-card-lg motion-safe:hover:-translate-y-0.5",
|
|
17
|
+
"transition-[box-shadow,translate] duration-200 motion-reduce:transition-shadow",
|
|
18
|
+
"cursor-pointer"
|
|
19
|
+
]
|
|
20
|
+
} },
|
|
21
|
+
defaultVariants: { variant: "default" }
|
|
22
|
+
});
|
|
33
23
|
function Card({ className, variant, ...props }) {
|
|
34
|
-
|
|
24
|
+
return /* @__PURE__ */ jsx("div", {
|
|
25
|
+
"data-slot": "card",
|
|
26
|
+
className: cn(cardVariants({ variant }), className),
|
|
27
|
+
...props
|
|
28
|
+
});
|
|
35
29
|
}
|
|
36
30
|
function CardHeader({ className, ...props }) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6`,
|
|
44
|
-
className
|
|
45
|
-
),
|
|
46
|
-
...props
|
|
47
|
-
}
|
|
48
|
-
);
|
|
31
|
+
return /* @__PURE__ */ jsx("div", {
|
|
32
|
+
"data-slot": "card-header",
|
|
33
|
+
className: cn(`@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6
|
|
34
|
+
has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6`, className),
|
|
35
|
+
...props
|
|
36
|
+
});
|
|
49
37
|
}
|
|
50
38
|
function CardTitle({ className, ...props }) {
|
|
51
|
-
|
|
39
|
+
return /* @__PURE__ */ jsx("div", {
|
|
40
|
+
"data-slot": "card-title",
|
|
41
|
+
className: cn("text-balance leading-none font-semibold tracking-tight", className),
|
|
42
|
+
...props
|
|
43
|
+
});
|
|
52
44
|
}
|
|
53
45
|
function CardDescription({ className, ...props }) {
|
|
54
|
-
|
|
46
|
+
return /* @__PURE__ */ jsx("div", {
|
|
47
|
+
"data-slot": "card-description",
|
|
48
|
+
className: cn("text-muted-foreground text-pretty text-sm", className),
|
|
49
|
+
...props
|
|
50
|
+
});
|
|
55
51
|
}
|
|
56
52
|
function CardAction({ className, ...props }) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
...props
|
|
63
|
-
}
|
|
64
|
-
);
|
|
53
|
+
return /* @__PURE__ */ jsx("div", {
|
|
54
|
+
"data-slot": "card-action",
|
|
55
|
+
className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className),
|
|
56
|
+
...props
|
|
57
|
+
});
|
|
65
58
|
}
|
|
66
59
|
function CardContent({ className, ...props }) {
|
|
67
|
-
|
|
60
|
+
return /* @__PURE__ */ jsx("div", {
|
|
61
|
+
"data-slot": "card-content",
|
|
62
|
+
className: cn("px-6", className),
|
|
63
|
+
...props
|
|
64
|
+
});
|
|
68
65
|
}
|
|
69
66
|
function CardFooter({ className, ...props }) {
|
|
70
|
-
|
|
67
|
+
return /* @__PURE__ */ jsx("div", {
|
|
68
|
+
"data-slot": "card-footer",
|
|
69
|
+
className: cn("flex items-center px-6 [.border-t]:pt-6", className),
|
|
70
|
+
...props
|
|
71
|
+
});
|
|
71
72
|
}
|
|
72
73
|
|
|
74
|
+
//#endregion
|
|
73
75
|
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, cardVariants };
|
|
74
|
-
//# sourceMappingURL=card.js.map
|
|
75
76
|
//# sourceMappingURL=card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"card.js","names":[],"sources":["../../src/components/card.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../lib/utils';\n\nconst cardVariants = cva(\n\t// Base styles\n\t\t'bg-card text-card-foreground flex flex-col gap-6 rounded-xl py-6',\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: 'shadow-card',\n\t\t\t\televated: 'shadow-card-lg',\n\t\t\t\tflat: 'border border-border/60 shadow-none',\n\t\t\t\tghost: 'bg-transparent shadow-none',\n\t\t\t\tinteractive: [\n\t\t\t\t\t'shadow-card',\n\t\t\t\t\t'hover:shadow-card-lg motion-safe:hover:-translate-y-0.5',\n\t\t\t\t\t'transition-[box-shadow,translate] duration-200 motion-reduce:transition-shadow',\n\t\t\t\t\t'cursor-pointer',\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: 'default',\n\t\t},\n\t},\n);\n\ninterface CardProps extends React.ComponentProps<'div'>, VariantProps<typeof cardVariants> {}\n\nfunction Card({ className, variant, ...props }: CardProps) {\n\treturn <div data-slot=\"card\" className={cn(cardVariants({ variant }), className)} {...props} />;\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"card-header\"\n\t\t\tclassName={cn(\n\t\t\t\t`@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6\n\t\t\t\thas-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"card-title\"\n\t\t\tclassName={cn('text-balance leading-none font-semibold tracking-tight', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"card-description\"\n\t\t\tclassName={cn('text-muted-foreground text-pretty text-sm', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CardAction({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"card-action\"\n\t\t\tclassName={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn <div data-slot=\"card-content\" className={cn('px-6', className)} {...props} />;\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div data-slot=\"card-footer\" className={cn('flex items-center px-6 [.border-t]:pt-6', className)} {...props} />\n\t);\n}\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, cardVariants };\nexport type { CardProps };\n"],"mappings":";;;;;;;AAKA,MAAM,eAAe,IAEnB,oEACD;CACC,UAAU,EACT,SAAS;EACR,SAAS;EACT,UAAU;EACV,MAAM;EACN,OAAO;EACP,aAAa;GACZ;GACA;GACA;GACA;EACD;CACD,EACD;CACA,iBAAiB,EAChB,SAAS,UACV;AACD,CACD;AAIA,SAAS,KAAK,EAAE,WAAW,SAAS,GAAG,SAAoB;CAC1D,OAAO,oBAAC,OAAD;EAAK,aAAU;EAAO,WAAW,GAAG,aAAa,EAAE,QAAQ,CAAC,GAAG,SAAS;EAAG,GAAI;CAAQ;AAC/F;AAEA,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;CACzE,OACC,oBAAC,OAAD;EACC,aAAU;EACV,WAAW,GACV;wEAEA,SACD;EACA,GAAI;CACJ;AAEH;AAEA,SAAS,UAAU,EAAE,WAAW,GAAG,SAAsC;CACxE,OACC,oBAAC,OAAD;EACC,aAAU;EACV,WAAW,GAAG,0DAA0D,SAAS;EACjF,GAAI;CACJ;AAEH;AAEA,SAAS,gBAAgB,EAAE,WAAW,GAAG,SAAsC;CAC9E,OACC,oBAAC,OAAD;EACC,aAAU;EACV,WAAW,GAAG,6CAA6C,SAAS;EACpE,GAAI;CACJ;AAEH;AAEA,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;CACzE,OACC,oBAAC,OAAD;EACC,aAAU;EACV,WAAW,GAAG,kEAAkE,SAAS;EACzF,GAAI;CACJ;AAEH;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAAsC;CAC1E,OAAO,oBAAC,OAAD;EAAK,aAAU;EAAe,WAAW,GAAG,QAAQ,SAAS;EAAG,GAAI;CAAQ;AACpF;AAEA,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;CACzE,OACC,oBAAC,OAAD;EAAK,aAAU;EAAc,WAAW,GAAG,2CAA2C,SAAS;EAAG,GAAI;CAAQ;AAEhH"}
|