@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,67 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
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 _constructive_io_ui_portal = require("@constructive-io/ui/portal");
|
|
10
|
+
let _base_ui_react_tooltip = require("@base-ui/react/tooltip");
|
|
11
|
+
|
|
12
|
+
//#region src/components/tooltip.tsx
|
|
13
|
+
function TooltipProvider({ delay = 0, delayDuration, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_tooltip.Tooltip.Provider, {
|
|
15
|
+
"data-slot": "tooltip-provider",
|
|
16
|
+
delay: delayDuration ?? delay,
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function Tooltip({ delayDuration: _delayDuration, ...props }) {
|
|
21
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_tooltip.Tooltip.Root, {
|
|
22
|
+
"data-slot": "tooltip",
|
|
23
|
+
...props
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function TooltipTrigger({ delay = 0, asChild, children, render, ...props }) {
|
|
27
|
+
const childRender = render === void 0 && asChild && react.isValidElement(children) ? children : void 0;
|
|
28
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_tooltip.Tooltip.Trigger, {
|
|
29
|
+
"data-slot": "tooltip-trigger",
|
|
30
|
+
delay,
|
|
31
|
+
render: render ?? childRender,
|
|
32
|
+
...props,
|
|
33
|
+
children: childRender ? void 0 : children
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function TooltipContent({ className, sideOffset = 4, showArrow = false, side = "top", align = "center", children, ...props }) {
|
|
37
|
+
const { container, zIndexClass } = (0, _constructive_io_ui_portal.useFloatingOverlayPortalProps)();
|
|
38
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_tooltip.Tooltip.Portal, {
|
|
39
|
+
container,
|
|
40
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_tooltip.Tooltip.Positioner, {
|
|
41
|
+
side,
|
|
42
|
+
align,
|
|
43
|
+
sideOffset,
|
|
44
|
+
className: zIndexClass,
|
|
45
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_base_ui_react_tooltip.Tooltip.Popup, {
|
|
46
|
+
"data-slot": "tooltip-content",
|
|
47
|
+
className: require_utils.cn(`bg-popover text-popover-foreground origin-(--transform-origin) relative max-w-70 rounded-md border px-2 py-1
|
|
48
|
+
text-xs transition-[scale,opacity,translate] duration-150 ease-out data-starting-style:scale-95
|
|
49
|
+
data-ending-style:scale-95 data-starting-style:opacity-0 data-ending-style:opacity-0
|
|
50
|
+
data-[side=bottom]:data-starting-style:-translate-y-2
|
|
51
|
+
data-[side=left]:data-starting-style:translate-x-2
|
|
52
|
+
data-[side=right]:data-starting-style:-translate-x-2
|
|
53
|
+
data-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`, className),
|
|
54
|
+
...props,
|
|
55
|
+
role: "tooltip",
|
|
56
|
+
children: [children, showArrow && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_tooltip.Tooltip.Arrow, { className: "fill-popover -my-px drop-shadow-[0_1px_0_hsl(var(--border))]" })]
|
|
57
|
+
})
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
exports.Tooltip = Tooltip;
|
|
64
|
+
exports.TooltipContent = TooltipContent;
|
|
65
|
+
exports.TooltipProvider = TooltipProvider;
|
|
66
|
+
exports.TooltipTrigger = TooltipTrigger;
|
|
67
|
+
//# sourceMappingURL=tooltip.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.cjs","names":["TooltipPrimitive","React","cn"],"sources":["../../src/components/tooltip.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';\n\nimport { useFloatingOverlayPortalProps } from '@constructive-io/ui/portal';\nimport { cn } from '../lib/utils';\n\ntype TooltipProviderProps = React.ComponentProps<typeof TooltipPrimitive.Provider> & {\n\t/** @deprecated Use delay instead */\n\tdelayDuration?: number;\n};\n\nfunction TooltipProvider({ delay = 0, delayDuration, ...props }: TooltipProviderProps) {\n\treturn <TooltipPrimitive.Provider data-slot=\"tooltip-provider\" delay={delayDuration ?? delay} {...props} />;\n}\n\ntype TooltipProps = React.ComponentProps<typeof TooltipPrimitive.Root> & {\n\t/** @deprecated Use delay on Trigger instead */\n\tdelayDuration?: number;\n};\n\nfunction Tooltip({ delayDuration: _delayDuration, ...props }: TooltipProps) {\n\treturn <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />;\n}\n\ntype TooltipTriggerProps = React.ComponentProps<typeof TooltipPrimitive.Trigger> & {\n\tdelay?: number;\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction TooltipTrigger({ delay = 0, asChild, children, render, ...props }: TooltipTriggerProps) {\n\tconst childRender = render === undefined && asChild && React.isValidElement(children) ? children : undefined;\n\n\treturn (\n\t\t<TooltipPrimitive.Trigger\n\t\t\tdata-slot=\"tooltip-trigger\"\n\t\t\tdelay={delay}\n\t\t\trender={render ?? childRender}\n\t\t\t{...props}\n\t\t>\n\t\t\t{childRender ? undefined : children}\n\t\t</TooltipPrimitive.Trigger>\n\t);\n}\n\ntype TooltipContentProps = React.ComponentProps<typeof TooltipPrimitive.Popup> & {\n\tsideOffset?: number;\n\tshowArrow?: boolean;\n\tside?: 'top' | 'bottom' | 'left' | 'right';\n\talign?: 'start' | 'center' | 'end';\n};\n\nfunction TooltipContent({\n\tclassName,\n\tsideOffset = 4,\n\tshowArrow = false,\n\tside = 'top',\n\talign = 'center',\n\tchildren,\n\t...props\n}: TooltipContentProps) {\n\tconst { container, zIndexClass } = useFloatingOverlayPortalProps();\n\n\treturn (\n\t\t<TooltipPrimitive.Portal container={container}>\n\t\t\t<TooltipPrimitive.Positioner side={side} align={align} sideOffset={sideOffset} className={zIndexClass}>\n\t\t\t\t<TooltipPrimitive.Popup\n\t\t\t\t\tdata-slot=\"tooltip-content\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t`bg-popover text-popover-foreground origin-(--transform-origin) relative max-w-70 rounded-md border px-2 py-1\n\t\t\t\t\t\ttext-xs transition-[scale,opacity,translate] duration-150 ease-out data-starting-style:scale-95\n\t\t\t\t\t\tdata-ending-style:scale-95 data-starting-style:opacity-0 data-ending-style:opacity-0\n\t\t\t\t\t\tdata-[side=bottom]:data-starting-style:-translate-y-2\n\t\t\t\t\t\tdata-[side=left]:data-starting-style:translate-x-2\n\t\t\t\t\t\tdata-[side=right]:data-starting-style:-translate-x-2\n\t\t\t\t\t\tdata-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`,\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t\trole=\"tooltip\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t\t{showArrow && (\n\t\t\t\t\t\t<TooltipPrimitive.Arrow className='fill-popover -my-px drop-shadow-[0_1px_0_hsl(var(--border))]' />\n\t\t\t\t\t)}\n\t\t\t\t</TooltipPrimitive.Popup>\n\t\t\t</TooltipPrimitive.Positioner>\n\t\t</TooltipPrimitive.Portal>\n\t);\n}\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };\n"],"mappings":";;;;;;;;;;;;AAaA,SAAS,gBAAgB,EAAE,QAAQ,GAAG,eAAe,GAAG,SAA+B;CACtF,OAAO,2CAACA,+BAAiB,UAAlB;EAA2B,aAAU;EAAmB,OAAO,iBAAiB;EAAO,GAAI;CAAQ;AAC3G;AAOA,SAAS,QAAQ,EAAE,eAAe,gBAAgB,GAAG,SAAuB;CAC3E,OAAO,2CAACA,+BAAiB,MAAlB;EAAuB,aAAU;EAAU,GAAI;CAAQ;AAC/D;AAQA,SAAS,eAAe,EAAE,QAAQ,GAAG,SAAS,UAAU,QAAQ,GAAG,SAA8B;CAChG,MAAM,cAAc,WAAW,UAAa,WAAWC,MAAM,eAAe,QAAQ,IAAI,WAAW;CAEnG,OACC,2CAACD,+BAAiB,SAAlB;EACC,aAAU;EACH;EACP,QAAQ,UAAU;EAClB,GAAI;YAEH,cAAc,SAAY;CACF;AAE5B;AASA,SAAS,eAAe,EACvB,WACA,aAAa,GACb,YAAY,OACZ,OAAO,OACP,QAAQ,UACR,UACA,GAAG,SACoB;CACvB,MAAM,EAAE,WAAW,8EAA8C;CAEjE,OACC,2CAACA,+BAAiB,QAAlB;EAAoC;YACnC,2CAACA,+BAAiB,YAAlB;GAAmC;GAAa;GAAmB;GAAY,WAAW;aACzF,4CAACA,+BAAiB,OAAlB;IACC,aAAU;IACV,WAAWE,iBACV;;;;;;wFAOA,SACD;IACA,GAAI;IACJ,MAAK;cAbN,CAeE,UACA,aACA,2CAACF,+BAAiB,OAAlB,EAAwB,WAAU,+DAAgE,EAE5E;;EACI;CACL;AAE3B"}
|
|
@@ -1,29 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { Tooltip as Tooltip$1 } from '@base-ui/react/tooltip';
|
|
4
|
-
|
|
5
|
-
type TooltipProviderProps = React.ComponentProps<typeof Tooltip$1.Provider> & {
|
|
6
|
-
/** @deprecated Use delay instead */
|
|
7
|
-
delayDuration?: number;
|
|
8
|
-
};
|
|
9
|
-
declare function TooltipProvider({ delay, delayDuration, ...props }: TooltipProviderProps): react_jsx_runtime.JSX.Element;
|
|
10
|
-
type TooltipProps = React.ComponentProps<typeof Tooltip$1.Root> & {
|
|
11
|
-
/** @deprecated Use delay on Trigger instead */
|
|
12
|
-
delayDuration?: number;
|
|
13
|
-
};
|
|
14
|
-
declare function Tooltip({ delayDuration: _delayDuration, ...props }: TooltipProps): react_jsx_runtime.JSX.Element;
|
|
15
|
-
type TooltipTriggerProps = Omit<React.ComponentProps<typeof Tooltip$1.Trigger>, 'render'> & {
|
|
16
|
-
delay?: number;
|
|
17
|
-
/** When true, merges props onto the child element instead of rendering a button */
|
|
18
|
-
asChild?: boolean;
|
|
19
|
-
};
|
|
20
|
-
declare function TooltipTrigger({ delay, asChild, children, ...props }: TooltipTriggerProps): react_jsx_runtime.JSX.Element;
|
|
21
|
-
type TooltipContentProps = React.ComponentProps<typeof Tooltip$1.Popup> & {
|
|
22
|
-
sideOffset?: number;
|
|
23
|
-
showArrow?: boolean;
|
|
24
|
-
side?: 'top' | 'bottom' | 'left' | 'right';
|
|
25
|
-
align?: 'start' | 'center' | 'end';
|
|
26
|
-
};
|
|
27
|
-
declare function TooltipContent({ className, sideOffset, showArrow, side, align, children, ...props }: TooltipContentProps): react_jsx_runtime.JSX.Element;
|
|
28
|
-
|
|
29
|
-
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
1
|
+
import { i as TooltipTrigger, n as TooltipContent, r as TooltipProvider, t as Tooltip } from "../tooltip-CTRQoN1A.js";
|
|
2
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
@@ -1,174 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
import * as React2 from 'react';
|
|
3
|
-
import { Tooltip as Tooltip$1 } from '@base-ui/react/tooltip';
|
|
4
|
-
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
5
|
-
import { clsx } from 'clsx';
|
|
6
|
-
import { twMerge } from 'tailwind-merge';
|
|
1
|
+
'use client';
|
|
7
2
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
function useRootPortalContainer() {
|
|
16
|
-
const [container, setContainer] = React2.useState(null);
|
|
17
|
-
React2.useLayoutEffect(() => {
|
|
18
|
-
const el = document.getElementById(PORTAL_ROOT_ID);
|
|
19
|
-
setContainer(el);
|
|
20
|
-
}, []);
|
|
21
|
-
return container;
|
|
22
|
-
}
|
|
23
|
-
function useFloatingOverlayPortalProps() {
|
|
24
|
-
const rootContainer = useRootPortalContainer();
|
|
25
|
-
const { floatingPortalStrategy, floatingZIndex } = React2.useContext(PortalContext);
|
|
26
|
-
const container = floatingPortalStrategy === "nested" ? void 0 : rootContainer ?? null;
|
|
27
|
-
const zIndexClass = floatingZIndex === "elevated" ? "z-[var(--z-layer-floating-elevated)]" : "z-[var(--z-layer-floating)]";
|
|
28
|
-
return { container, zIndexClass };
|
|
29
|
-
}
|
|
30
|
-
function composeRefs(...refs) {
|
|
31
|
-
return (node) => {
|
|
32
|
-
refs.forEach((ref) => {
|
|
33
|
-
if (typeof ref === "function") {
|
|
34
|
-
ref(node);
|
|
35
|
-
} else if (ref != null) {
|
|
36
|
-
ref.current = node;
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
function mergeProps(slotProps, childProps) {
|
|
42
|
-
const overrideProps = { ...childProps };
|
|
43
|
-
for (const propName in childProps) {
|
|
44
|
-
if (propName === "ref") continue;
|
|
45
|
-
const slotPropValue = slotProps[propName];
|
|
46
|
-
const childPropValue = childProps[propName];
|
|
47
|
-
if (/^on[A-Z]/.test(propName) && typeof slotPropValue === "function" && typeof childPropValue === "function") {
|
|
48
|
-
overrideProps[propName] = (...args) => {
|
|
49
|
-
childPropValue(...args);
|
|
50
|
-
slotPropValue(...args);
|
|
51
|
-
};
|
|
52
|
-
} else if (propName === "className" && typeof slotPropValue === "string" && typeof childPropValue === "string") {
|
|
53
|
-
overrideProps[propName] = `${slotPropValue} ${childPropValue}`.trim();
|
|
54
|
-
} else if (propName === "style" && typeof slotPropValue === "object" && typeof childPropValue === "object") {
|
|
55
|
-
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return { ...slotProps, ...overrideProps };
|
|
59
|
-
}
|
|
60
|
-
function mergePropsWithRef(parentProps, childElement) {
|
|
61
|
-
const childProps = childElement.props;
|
|
62
|
-
const parentRef = parentProps.ref;
|
|
63
|
-
const childRef = childProps.ref;
|
|
64
|
-
const mergedProps = mergeProps(parentProps, childProps);
|
|
65
|
-
if (parentRef || childRef) {
|
|
66
|
-
mergedProps.ref = composeRefs(parentRef, childRef);
|
|
67
|
-
}
|
|
68
|
-
return mergedProps;
|
|
69
|
-
}
|
|
70
|
-
function isSlottable(child) {
|
|
71
|
-
return React2.isValidElement(child);
|
|
72
|
-
}
|
|
73
|
-
var Slot = React2.forwardRef((props, forwardedRef) => {
|
|
74
|
-
const { children, ...slotProps } = props;
|
|
75
|
-
if (isSlottable(children)) {
|
|
76
|
-
const childProps = children.props;
|
|
77
|
-
const childRef = childProps.ref;
|
|
78
|
-
return React2.cloneElement(children, {
|
|
79
|
-
...mergeProps(slotProps, childProps),
|
|
80
|
-
ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
if (React2.Children.count(children) > 1) {
|
|
84
|
-
const childrenArray = React2.Children.toArray(children);
|
|
85
|
-
const slottableChild = childrenArray.find(
|
|
86
|
-
(child) => React2.isValidElement(child) && child.type === Slottable
|
|
87
|
-
);
|
|
88
|
-
if (slottableChild) {
|
|
89
|
-
const newElement = slottableChild.props.children;
|
|
90
|
-
if (isSlottable(newElement)) {
|
|
91
|
-
const newElementProps = newElement.props;
|
|
92
|
-
const newChildren = childrenArray.map((child) => {
|
|
93
|
-
if (child === slottableChild) {
|
|
94
|
-
return React2.Children.count(newElementProps.children) > 1 ? React2.Children.only(null) : newElementProps.children;
|
|
95
|
-
}
|
|
96
|
-
return child;
|
|
97
|
-
});
|
|
98
|
-
const childRef = newElementProps.ref;
|
|
99
|
-
return React2.cloneElement(newElement, {
|
|
100
|
-
...mergeProps(slotProps, newElementProps),
|
|
101
|
-
ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,
|
|
102
|
-
children: newChildren
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
108
|
-
});
|
|
109
|
-
Slot.displayName = "Slot";
|
|
110
|
-
function Slottable({ children }) {
|
|
111
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
112
|
-
}
|
|
113
|
-
function cn(...inputs) {
|
|
114
|
-
return twMerge(clsx(inputs));
|
|
115
|
-
}
|
|
3
|
+
import { t as cn } from "../utils-BkMLyah9.js";
|
|
4
|
+
import * as React$1 from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { useFloatingOverlayPortalProps } from "@constructive-io/ui/portal";
|
|
7
|
+
import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
|
|
8
|
+
|
|
9
|
+
//#region src/components/tooltip.tsx
|
|
116
10
|
function TooltipProvider({ delay = 0, delayDuration, ...props }) {
|
|
117
|
-
|
|
11
|
+
return /* @__PURE__ */ jsx(Tooltip$1.Provider, {
|
|
12
|
+
"data-slot": "tooltip-provider",
|
|
13
|
+
delay: delayDuration ?? delay,
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
118
16
|
}
|
|
119
17
|
function Tooltip({ delayDuration: _delayDuration, ...props }) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2
|
|
160
|
-
relative max-w-70 rounded-md border px-2 py-1 text-xs`,
|
|
161
|
-
className
|
|
162
|
-
),
|
|
163
|
-
...props,
|
|
164
|
-
children: [
|
|
165
|
-
children,
|
|
166
|
-
showArrow && /* @__PURE__ */ jsx(Tooltip$1.Arrow, { className: "fill-popover -my-px drop-shadow-[0_1px_0_hsl(var(--border))]" })
|
|
167
|
-
]
|
|
168
|
-
}
|
|
169
|
-
) }) });
|
|
18
|
+
return /* @__PURE__ */ jsx(Tooltip$1.Root, {
|
|
19
|
+
"data-slot": "tooltip",
|
|
20
|
+
...props
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function TooltipTrigger({ delay = 0, asChild, children, render, ...props }) {
|
|
24
|
+
const childRender = render === void 0 && asChild && React$1.isValidElement(children) ? children : void 0;
|
|
25
|
+
return /* @__PURE__ */ jsx(Tooltip$1.Trigger, {
|
|
26
|
+
"data-slot": "tooltip-trigger",
|
|
27
|
+
delay,
|
|
28
|
+
render: render ?? childRender,
|
|
29
|
+
...props,
|
|
30
|
+
children: childRender ? void 0 : children
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function TooltipContent({ className, sideOffset = 4, showArrow = false, side = "top", align = "center", children, ...props }) {
|
|
34
|
+
const { container, zIndexClass } = useFloatingOverlayPortalProps();
|
|
35
|
+
return /* @__PURE__ */ jsx(Tooltip$1.Portal, {
|
|
36
|
+
container,
|
|
37
|
+
children: /* @__PURE__ */ jsx(Tooltip$1.Positioner, {
|
|
38
|
+
side,
|
|
39
|
+
align,
|
|
40
|
+
sideOffset,
|
|
41
|
+
className: zIndexClass,
|
|
42
|
+
children: /* @__PURE__ */ jsxs(Tooltip$1.Popup, {
|
|
43
|
+
"data-slot": "tooltip-content",
|
|
44
|
+
className: cn(`bg-popover text-popover-foreground origin-(--transform-origin) relative max-w-70 rounded-md border px-2 py-1
|
|
45
|
+
text-xs transition-[scale,opacity,translate] duration-150 ease-out data-starting-style:scale-95
|
|
46
|
+
data-ending-style:scale-95 data-starting-style:opacity-0 data-ending-style:opacity-0
|
|
47
|
+
data-[side=bottom]:data-starting-style:-translate-y-2
|
|
48
|
+
data-[side=left]:data-starting-style:translate-x-2
|
|
49
|
+
data-[side=right]:data-starting-style:-translate-x-2
|
|
50
|
+
data-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`, className),
|
|
51
|
+
...props,
|
|
52
|
+
role: "tooltip",
|
|
53
|
+
children: [children, showArrow && /* @__PURE__ */ jsx(Tooltip$1.Arrow, { className: "fill-popover -my-px drop-shadow-[0_1px_0_hsl(var(--border))]" })]
|
|
54
|
+
})
|
|
55
|
+
})
|
|
56
|
+
});
|
|
170
57
|
}
|
|
171
58
|
|
|
59
|
+
//#endregion
|
|
172
60
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
173
|
-
//# sourceMappingURL=tooltip.js.map
|
|
174
61
|
//# sourceMappingURL=tooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/portal.tsx","../../src/lib/slot.tsx","../../src/lib/utils.ts","../../src/components/tooltip.tsx"],"names":["React","jsx","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A,kBAAAD,GAAAA,CAACC,SAAA,CAAiB,YAAjB,EAA4B,IAAA,EAAY,KAAA,EAAc,UAAA,EAAwB,WAAW,WAAA,EACzF,QAAA,kBAAA,IAAA;AAAA,IAACA,SAAA,CAAiB,KAAA;AAAA,IAAjB;AAAA,MACA,WAAA,EAAU,iBAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,CAAA;AAAA;AAAA;AAAA;AAAA,2DAAA,CAAA;AAAA,QAKA;AAAA,OACD;AAAA,MACC,GAAG,KAAA;AAAA,MAEH,QAAA,EAAA;AAAA,QAAA,QAAA;AAAA,QACA,6BACAD,GAAAA,CAACC,UAAiB,KAAA,EAAjB,EAAuB,WAAU,8DAAA,EAA+D;AAAA;AAAA;AAAA,KAGpG,CAAA,EACD,CAAA;AAEF","file":"tooltip.js","sourcesContent":["'use client';\n\nimport * as React from 'react';\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Overlay layer type:\n * - 'base': Root level (page content, base floating elements)\n * - 'modal': Inside a modal overlay (dialog, sheet, drawer)\n */\nexport type OverlayLayer = 'base' | 'modal';\n\n/**\n * Where floating overlays should portal:\n * - 'root': always portal into #portal-root\n * - 'nested': let Base UI nest portals into the nearest Base UI portal node\n */\nexport type FloatingPortalStrategy = 'root' | 'nested';\n\n/**\n * Z-index mode for floating overlays.\n * - 'default': --z-layer-floating\n * - 'elevated': --z-layer-floating-elevated\n */\nexport type FloatingZIndex = 'default' | 'elevated';\n\ninterface PortalContextValue {\n\t/** Current overlay layer */\n\tlayer: OverlayLayer;\n\t/** Modal nesting depth (0 for first modal, 1 for nested, etc.) */\n\tdepth: number;\n\t/** Strategy for where floating overlays should portal */\n\tfloatingPortalStrategy: FloatingPortalStrategy;\n\t/** Z-index mode for floating overlays */\n\tfloatingZIndex: FloatingZIndex;\n}\n\n// ============================================================================\n// Constants\n// ============================================================================\n\nexport const PORTAL_ROOT_ID = 'portal-root';\n\n// ============================================================================\n// Context\n// ============================================================================\n\nconst PortalContext = React.createContext<PortalContextValue>({\n\tlayer: 'base',\n\tdepth: 0,\n\tfloatingPortalStrategy: 'root',\n\tfloatingZIndex: 'default',\n});\n\n// ============================================================================\n// Providers\n// ============================================================================\n\n/**\n * Provider for modal overlays (Dialog, Sheet, Drawer, etc.)\n *\n * Wraps modal content to:\n * 1. Create a scoped portal container for nested floating elements\n * 2. Track the overlay layer (so floating elements know to use elevated z-index)\n * 3. Track nesting depth for stacked modals\n *\n * Usage:\n * ```tsx\n * <DialogPopup>\n * <ModalPortalScope>\n * {children} // Popovers inside here will render in the scoped container\n * </ModalPortalScope>\n * </DialogPopup>\n * ```\n */\nexport function ModalPortalScope({\n\tchildren,\n\tfloatingPortalStrategy = 'nested',\n\tfloatingZIndex = 'default',\n}: {\n\tchildren: React.ReactNode;\n\tfloatingPortalStrategy?: FloatingPortalStrategy;\n\tfloatingZIndex?: FloatingZIndex;\n}) {\n\tconst parentContext = React.useContext(PortalContext);\n\n\t// Increment depth from parent if already in modal layer\n\tconst depth = parentContext.layer === 'modal' ? parentContext.depth + 1 : 0;\n\n\tconst value = React.useMemo<PortalContextValue>(\n\t\t() => ({\n\t\t\tlayer: 'modal',\n\t\t\tdepth,\n\t\t\tfloatingPortalStrategy,\n\t\t\tfloatingZIndex,\n\t\t}),\n\t\t[depth, floatingPortalStrategy, floatingZIndex],\n\t);\n\n\treturn <PortalContext.Provider value={value}>{children}</PortalContext.Provider>;\n}\n\n// ============================================================================\n// Hooks\n// ============================================================================\n\n/**\n * Get the current portal context value.\n * Used internally by other hooks.\n */\nexport function usePortalContext(): PortalContextValue {\n\treturn React.useContext(PortalContext);\n}\n\nexport function useInModalOverlay(): boolean {\n\treturn React.useContext(PortalContext).layer === 'modal';\n}\n\n/**\n * Get the root portal container element.\n * Used by modal components (Dialog, Sheet, etc.) to render their portals.\n *\n * @returns The root portal container, or null during SSR/before mount\n */\nexport function useRootPortalContainer(): HTMLElement | null {\n\tconst [container, setContainer] = React.useState<HTMLElement | null>(null);\n\n\tReact.useLayoutEffect(() => {\n\t\tconst el = document.getElementById(PORTAL_ROOT_ID);\n\t\tsetContainer(el);\n\t}, []);\n\n\treturn container;\n}\n\n/**\n * Centralized portal + z-index policy for floating overlays.\n *\n * - When `floatingPortalStrategy` is 'nested', Base UI will automatically portal\n * into the nearest Base UI portal node (so dialog \"inert\" behavior includes it).\n * - When it's 'root', we portal into #portal-root.\n */\nexport function useFloatingOverlayPortalProps(): {\n\tcontainer?: HTMLElement | null;\n\tzIndexClass: string;\n} {\n\tconst rootContainer = useRootPortalContainer();\n\tconst { floatingPortalStrategy, floatingZIndex } = React.useContext(PortalContext);\n\n\tconst container = floatingPortalStrategy === 'nested' ? undefined : (rootContainer ?? null);\n\tconst zIndexClass =\n\t\tfloatingZIndex === 'elevated'\n\t\t\t? 'z-[var(--z-layer-floating-elevated)]'\n\t\t\t: 'z-[var(--z-layer-floating)]';\n\n\treturn { container, zIndexClass };\n}\n\n// ============================================================================\n// Components\n// ============================================================================\n\n/**\n * Portal root component to render in app layout.\n * All overlay components will render their portals inside this container.\n *\n * Usage in layout.tsx:\n * ```tsx\n * import { PortalRoot } from '@constructive-io/ui/portal';\n *\n * export default function RootLayout({ children }) {\n * return (\n * <html>\n * <body>\n * {children}\n * <PortalRoot />\n * </body>\n * </html>\n * );\n * }\n * ```\n */\nexport function PortalRoot() {\n\treturn (\n\t\t<div\n\t\t\tid={PORTAL_ROOT_ID}\n\t\t\tdata-slot=\"portal-root\"\n\t\t\tstyle={{\n\t\t\t\tposition: 'fixed',\n\t\t\t\tinset: 0,\n\t\t\t\tzIndex: 'var(--z-layer-portal-root)',\n\t\t\t\tpointerEvents: 'none',\n\t\t\t\t// Children (portal contents) will have pointer-events: auto\n\t\t\t}}\n\t\t/>\n\t);\n}\n\n/**\n * Hook to get the portal container element for rendering floating UI elements.\n * Returns the element with id=\"portal-root\" if it exists in the DOM.\n *\n * @deprecated Use useRootPortalContainer or useFloatingOverlayPortalProps instead\n */\nexport function usePortalContainer(): HTMLElement | undefined {\n\tif (typeof document === 'undefined') return undefined;\n\tconst el = document.getElementById(PORTAL_ROOT_ID);\n\treturn el instanceof HTMLElement ? el : undefined;\n}\n","'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 { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';\n\nimport { useFloatingOverlayPortalProps } from './portal';\nimport { mergePropsWithRef } from '../lib/slot';\nimport { cn } from '../lib/utils';\n\ntype TooltipProviderProps = React.ComponentProps<typeof TooltipPrimitive.Provider> & {\n\t/** @deprecated Use delay instead */\n\tdelayDuration?: number;\n};\n\nfunction TooltipProvider({ delay = 0, delayDuration, ...props }: TooltipProviderProps) {\n\treturn <TooltipPrimitive.Provider data-slot=\"tooltip-provider\" delay={delayDuration ?? delay} {...props} />;\n}\n\ntype TooltipProps = React.ComponentProps<typeof TooltipPrimitive.Root> & {\n\t/** @deprecated Use delay on Trigger instead */\n\tdelayDuration?: number;\n};\n\nfunction Tooltip({ delayDuration: _delayDuration, ...props }: TooltipProps) {\n\treturn <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />;\n}\n\ntype TooltipTriggerProps = Omit<React.ComponentProps<typeof TooltipPrimitive.Trigger>, 'render'> & {\n\tdelay?: number;\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction TooltipTrigger({ delay = 0, asChild, children, ...props }: TooltipTriggerProps) {\n\tif (asChild && React.isValidElement(children)) {\n\t\treturn (\n\t\t\t<TooltipPrimitive.Trigger\n\t\t\t\tdata-slot=\"tooltip-trigger\"\n\t\t\t\tdelay={delay}\n\t\t\t\t{...props}\n\t\t\trender={(triggerProps) => {\n\t\t\t\treturn React.cloneElement(\n\t\t\t\t\tchildren as React.ReactElement<Record<string, unknown>>,\n\t\t\t\t\tmergePropsWithRef(triggerProps as Record<string, unknown>, children as React.ReactElement),\n\t\t\t\t);\n\t\t\t}}\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" delay={delay} {...props}>\n\t\t\t{children}\n\t\t</TooltipPrimitive.Trigger>\n\t);\n}\n\ntype TooltipContentProps = React.ComponentProps<typeof TooltipPrimitive.Popup> & {\n\tsideOffset?: number;\n\tshowArrow?: boolean;\n\tside?: 'top' | 'bottom' | 'left' | 'right';\n\talign?: 'start' | 'center' | 'end';\n};\n\nfunction TooltipContent({\n\tclassName,\n\tsideOffset = 4,\n\tshowArrow = false,\n\tside = 'top',\n\talign = 'center',\n\tchildren,\n\t...props\n}: TooltipContentProps) {\n\tconst { container, zIndexClass } = useFloatingOverlayPortalProps();\n\n\treturn (\n\t\t<TooltipPrimitive.Portal container={container}>\n\t\t\t<TooltipPrimitive.Positioner side={side} align={align} sideOffset={sideOffset} className={zIndexClass}>\n\t\t\t\t<TooltipPrimitive.Popup\n\t\t\t\t\tdata-slot=\"tooltip-content\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t`bg-popover text-popover-foreground data-[open]:animate-in data-[open]:fade-in-0 data-[open]:zoom-in-95\n\t\t\t\t\t\tdata-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:zoom-out-95\n\t\t\t\t\t\tdata-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2\n\t\t\t\t\t\tdata-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\n\t\t\t\t\t\trelative max-w-70 rounded-md border px-2 py-1 text-xs`,\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t\t{showArrow && (\n\t\t\t\t\t\t<TooltipPrimitive.Arrow className='fill-popover -my-px drop-shadow-[0_1px_0_hsl(var(--border))]' />\n\t\t\t\t\t)}\n\t\t\t\t</TooltipPrimitive.Popup>\n\t\t\t</TooltipPrimitive.Positioner>\n\t\t</TooltipPrimitive.Portal>\n\t);\n}\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };\n"]}
|
|
1
|
+
{"version":3,"file":"tooltip.js","names":["TooltipPrimitive","React"],"sources":["../../src/components/tooltip.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';\n\nimport { useFloatingOverlayPortalProps } from '@constructive-io/ui/portal';\nimport { cn } from '../lib/utils';\n\ntype TooltipProviderProps = React.ComponentProps<typeof TooltipPrimitive.Provider> & {\n\t/** @deprecated Use delay instead */\n\tdelayDuration?: number;\n};\n\nfunction TooltipProvider({ delay = 0, delayDuration, ...props }: TooltipProviderProps) {\n\treturn <TooltipPrimitive.Provider data-slot=\"tooltip-provider\" delay={delayDuration ?? delay} {...props} />;\n}\n\ntype TooltipProps = React.ComponentProps<typeof TooltipPrimitive.Root> & {\n\t/** @deprecated Use delay on Trigger instead */\n\tdelayDuration?: number;\n};\n\nfunction Tooltip({ delayDuration: _delayDuration, ...props }: TooltipProps) {\n\treturn <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />;\n}\n\ntype TooltipTriggerProps = React.ComponentProps<typeof TooltipPrimitive.Trigger> & {\n\tdelay?: number;\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction TooltipTrigger({ delay = 0, asChild, children, render, ...props }: TooltipTriggerProps) {\n\tconst childRender = render === undefined && asChild && React.isValidElement(children) ? children : undefined;\n\n\treturn (\n\t\t<TooltipPrimitive.Trigger\n\t\t\tdata-slot=\"tooltip-trigger\"\n\t\t\tdelay={delay}\n\t\t\trender={render ?? childRender}\n\t\t\t{...props}\n\t\t>\n\t\t\t{childRender ? undefined : children}\n\t\t</TooltipPrimitive.Trigger>\n\t);\n}\n\ntype TooltipContentProps = React.ComponentProps<typeof TooltipPrimitive.Popup> & {\n\tsideOffset?: number;\n\tshowArrow?: boolean;\n\tside?: 'top' | 'bottom' | 'left' | 'right';\n\talign?: 'start' | 'center' | 'end';\n};\n\nfunction TooltipContent({\n\tclassName,\n\tsideOffset = 4,\n\tshowArrow = false,\n\tside = 'top',\n\talign = 'center',\n\tchildren,\n\t...props\n}: TooltipContentProps) {\n\tconst { container, zIndexClass } = useFloatingOverlayPortalProps();\n\n\treturn (\n\t\t<TooltipPrimitive.Portal container={container}>\n\t\t\t<TooltipPrimitive.Positioner side={side} align={align} sideOffset={sideOffset} className={zIndexClass}>\n\t\t\t\t<TooltipPrimitive.Popup\n\t\t\t\t\tdata-slot=\"tooltip-content\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t`bg-popover text-popover-foreground origin-(--transform-origin) relative max-w-70 rounded-md border px-2 py-1\n\t\t\t\t\t\ttext-xs transition-[scale,opacity,translate] duration-150 ease-out data-starting-style:scale-95\n\t\t\t\t\t\tdata-ending-style:scale-95 data-starting-style:opacity-0 data-ending-style:opacity-0\n\t\t\t\t\t\tdata-[side=bottom]:data-starting-style:-translate-y-2\n\t\t\t\t\t\tdata-[side=left]:data-starting-style:translate-x-2\n\t\t\t\t\t\tdata-[side=right]:data-starting-style:-translate-x-2\n\t\t\t\t\t\tdata-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`,\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t\trole=\"tooltip\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t\t{showArrow && (\n\t\t\t\t\t\t<TooltipPrimitive.Arrow className='fill-popover -my-px drop-shadow-[0_1px_0_hsl(var(--border))]' />\n\t\t\t\t\t)}\n\t\t\t\t</TooltipPrimitive.Popup>\n\t\t\t</TooltipPrimitive.Positioner>\n\t\t</TooltipPrimitive.Portal>\n\t);\n}\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };\n"],"mappings":";;;;;;;;;AAaA,SAAS,gBAAgB,EAAE,QAAQ,GAAG,eAAe,GAAG,SAA+B;CACtF,OAAO,oBAACA,UAAiB,UAAlB;EAA2B,aAAU;EAAmB,OAAO,iBAAiB;EAAO,GAAI;CAAQ;AAC3G;AAOA,SAAS,QAAQ,EAAE,eAAe,gBAAgB,GAAG,SAAuB;CAC3E,OAAO,oBAACA,UAAiB,MAAlB;EAAuB,aAAU;EAAU,GAAI;CAAQ;AAC/D;AAQA,SAAS,eAAe,EAAE,QAAQ,GAAG,SAAS,UAAU,QAAQ,GAAG,SAA8B;CAChG,MAAM,cAAc,WAAW,UAAa,WAAWC,QAAM,eAAe,QAAQ,IAAI,WAAW;CAEnG,OACC,oBAACD,UAAiB,SAAlB;EACC,aAAU;EACH;EACP,QAAQ,UAAU;EAClB,GAAI;YAEH,cAAc,SAAY;CACF;AAE5B;AASA,SAAS,eAAe,EACvB,WACA,aAAa,GACb,YAAY,OACZ,OAAO,OACP,QAAQ,UACR,UACA,GAAG,SACoB;CACvB,MAAM,EAAE,WAAW,gBAAgB,8BAA8B;CAEjE,OACC,oBAACA,UAAiB,QAAlB;EAAoC;YACnC,oBAACA,UAAiB,YAAlB;GAAmC;GAAa;GAAmB;GAAY,WAAW;aACzF,qBAACA,UAAiB,OAAlB;IACC,aAAU;IACV,WAAW,GACV;;;;;;wFAOA,SACD;IACA,GAAI;IACJ,MAAK;cAbN,CAeE,UACA,aACA,oBAACA,UAAiB,OAAlB,EAAwB,WAAU,+DAAgE,EAE5E;;EACI;CACL;AAE3B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
3
|
+
const require_utils = require('../utils-CzTQ3-VI.cjs');
|
|
4
|
+
const require_components_button = require('./button.cjs');
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
let _remixicon_react = require("@remixicon/react");
|
|
7
|
+
|
|
8
|
+
//#region src/components/unlink-button.tsx
|
|
9
|
+
function UnlinkButton({ onUnlink, isUnlinking = false, disabled = false, size = "xs", variant = "ghost", className, "aria-label": ariaLabel = "Unlink record" }) {
|
|
10
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_button.Button, {
|
|
11
|
+
variant,
|
|
12
|
+
size,
|
|
13
|
+
onClick: onUnlink,
|
|
14
|
+
disabled: disabled || isUnlinking,
|
|
15
|
+
className: require_utils.cn("hover:bg-destructive/10 hover:text-destructive h-5 w-5 p-0", "focus:ring-destructive/20 focus:ring-2 focus:ring-offset-1", isUnlinking && "cursor-not-allowed opacity-50", className),
|
|
16
|
+
"aria-label": ariaLabel,
|
|
17
|
+
title: isUnlinking ? "Unlinking..." : "Unlink record",
|
|
18
|
+
children: isUnlinking ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_remixicon_react.RiLoader4Line, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_remixicon_react.RiCloseLine, { className: "h-3 w-3" })
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.UnlinkButton = UnlinkButton;
|
|
24
|
+
//# sourceMappingURL=unlink-button.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unlink-button.cjs","names":["Button","cn","RiLoader4Line","RiCloseLine"],"sources":["../../src/components/unlink-button.tsx"],"sourcesContent":["import { RiCloseLine, RiLoader4Line } from '@remixicon/react';\n\nimport { cn } from '../lib/utils';\nimport { Button } from './button';\n\ninterface UnlinkButtonProps {\n\tonUnlink: () => void;\n\tisUnlinking?: boolean;\n\tdisabled?: boolean;\n\tsize?: 'sm' | 'xs';\n\tvariant?: 'destructive' | 'ghost';\n\tclassName?: string;\n\t'aria-label'?: string;\n}\n\nexport function UnlinkButton({\n\tonUnlink,\n\tisUnlinking = false,\n\tdisabled = false,\n\tsize = 'xs',\n\tvariant = 'ghost',\n\tclassName,\n\t'aria-label': ariaLabel = 'Unlink record',\n}: UnlinkButtonProps) {\n\treturn (\n\t\t<Button\n\t\t\tvariant={variant}\n\t\t\tsize={size}\n\t\t\tonClick={onUnlink}\n\t\t\tdisabled={disabled || isUnlinking}\n\t\t\tclassName={cn(\n\t\t\t\t'hover:bg-destructive/10 hover:text-destructive h-5 w-5 p-0',\n\t\t\t\t'focus:ring-destructive/20 focus:ring-2 focus:ring-offset-1',\n\t\t\t\tisUnlinking && 'cursor-not-allowed opacity-50',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\taria-label={ariaLabel}\n\t\t\ttitle={isUnlinking ? 'Unlinking...' : 'Unlink record'}\n\t\t>\n\t\t\t{isUnlinking ? <RiLoader4Line className='h-3 w-3 animate-spin' /> : <RiCloseLine className='h-3 w-3' />}\n\t\t</Button>\n\t);\n}\n"],"mappings":";;;;;;;;AAeA,SAAgB,aAAa,EAC5B,UACA,cAAc,OACd,WAAW,OACX,OAAO,MACP,UAAU,SACV,WACA,cAAc,YAAY,mBACL;CACrB,OACC,2CAACA,kCAAD;EACU;EACH;EACN,SAAS;EACT,UAAU,YAAY;EACtB,WAAWC,iBACV,8DACA,8DACA,eAAe,iCACf,SACD;EACA,cAAY;EACZ,OAAO,cAAc,iBAAiB;YAErC,cAAc,2CAACC,gCAAD,EAAe,WAAU,uBAAwB,KAAI,2CAACC,8BAAD,EAAa,WAAU,UAAW;CAC/F;AAEV"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/components/unlink-button.d.ts
|
|
2
|
+
interface UnlinkButtonProps {
|
|
3
|
+
onUnlink: () => void;
|
|
4
|
+
isUnlinking?: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
size?: 'sm' | 'xs';
|
|
7
|
+
variant?: 'destructive' | 'ghost';
|
|
8
|
+
className?: string;
|
|
9
|
+
'aria-label'?: string;
|
|
10
|
+
}
|
|
11
|
+
declare function UnlinkButton({ onUnlink, isUnlinking, disabled, size, variant, className, 'aria-label': ariaLabel }: UnlinkButtonProps): import("react").JSX.Element;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { UnlinkButton };
|
|
14
|
+
//# sourceMappingURL=unlink-button.d.cts.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/components/unlink-button.d.ts
|
|
3
2
|
interface UnlinkButtonProps {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
onUnlink: () => void;
|
|
4
|
+
isUnlinking?: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
size?: 'sm' | 'xs';
|
|
7
|
+
variant?: 'destructive' | 'ghost';
|
|
8
|
+
className?: string;
|
|
9
|
+
'aria-label'?: string;
|
|
11
10
|
}
|
|
12
|
-
declare function UnlinkButton({ onUnlink, isUnlinking, disabled, size, variant, className, 'aria-label': ariaLabel
|
|
13
|
-
|
|
11
|
+
declare function UnlinkButton({ onUnlink, isUnlinking, disabled, size, variant, className, 'aria-label': ariaLabel }: UnlinkButtonProps): import("react").JSX.Element;
|
|
12
|
+
//#endregion
|
|
14
13
|
export { UnlinkButton };
|
|
14
|
+
//# sourceMappingURL=unlink-button.d.ts.map
|
|
@@ -1,91 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { cva } from 'class-variance-authority';
|
|
7
|
-
import { jsx } from 'react/jsx-runtime';
|
|
1
|
+
'use client';
|
|
2
|
+
import { t as cn } from "../utils-BkMLyah9.js";
|
|
3
|
+
import { Button } from "./button.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { RiCloseLine, RiLoader4Line } from "@remixicon/react";
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
size: {
|
|
22
|
-
default: "h-9 px-[calc(--spacing(3)-1px)] sm:h-8",
|
|
23
|
-
icon: "size-9 sm:size-8",
|
|
24
|
-
"icon-lg": "size-10 sm:size-9",
|
|
25
|
-
"icon-sm": "size-8 sm:size-7",
|
|
26
|
-
"icon-xl": 'size-11 sm:size-10 [&_svg:not([class*="size-"])]:size-5 sm:[&_svg:not([class*="size-"])]:size-4.5',
|
|
27
|
-
"icon-xs": 'size-7 rounded-md before:rounded-[calc(var(--radius-md)-1px)] sm:size-6 not-in-data-[slot=input-group]:[&_svg:not([class*="size-"])]:size-4 sm:not-in-data-[slot=input-group]:[&_svg:not([class*="size-"])]:size-3.5',
|
|
28
|
-
lg: "h-10 px-[calc(--spacing(3.5)-1px)] sm:h-9",
|
|
29
|
-
sm: "h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] sm:h-7",
|
|
30
|
-
xl: 'h-11 px-[calc(--spacing(4)-1px)] text-lg sm:h-10 sm:text-base [&_svg:not([class*="size-"])]:size-5 sm:[&_svg:not([class*="size-"])]:size-4.5',
|
|
31
|
-
xs: 'h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-sm before:rounded-[calc(var(--radius-md)-1px)] sm:h-6 sm:text-xs [&_svg:not([class*="size-"])]:size-4 sm:[&_svg:not([class*="size-"])]:size-3.5'
|
|
32
|
-
},
|
|
33
|
-
variant: {
|
|
34
|
-
default: "not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-primary bg-primary text-primary-foreground shadow-primary/24 shadow-xs hover:bg-primary/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none",
|
|
35
|
-
destructive: "not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-destructive bg-destructive text-white shadow-destructive/24 shadow-xs hover:bg-destructive/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none",
|
|
36
|
-
"destructive-outline": "border-destructive/40 bg-transparent bg-clip-padding text-destructive shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:border-destructive/60 [:hover,[data-pressed]]:bg-destructive/8",
|
|
37
|
-
ghost: "border-transparent hover:bg-accent data-pressed:bg-accent",
|
|
38
|
-
link: "border-transparent underline-offset-4 hover:underline",
|
|
39
|
-
outline: "border-border bg-background bg-clip-padding shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:bg-accent/50 dark:[:hover,[data-pressed]]:bg-input/64",
|
|
40
|
-
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/90 [:active,[data-pressed]]:bg-secondary/80"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
);
|
|
45
|
-
var Button = React.forwardRef(
|
|
46
|
-
({ className, variant, size, asChild, children, type = "button", ...props }, ref) => {
|
|
47
|
-
const buttonClasses = cn(buttonVariants({ className, size, variant }));
|
|
48
|
-
if (asChild && React.isValidElement(children)) {
|
|
49
|
-
const childProps = children.props;
|
|
50
|
-
return React.cloneElement(children, {
|
|
51
|
-
...props,
|
|
52
|
-
className: cn(buttonClasses, childProps.className),
|
|
53
|
-
"data-slot": "button"
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
return /* @__PURE__ */ jsx("button", { ref, type, className: buttonClasses, "data-slot": "button", ...props, children });
|
|
57
|
-
}
|
|
58
|
-
);
|
|
59
|
-
Button.displayName = "Button";
|
|
60
|
-
function UnlinkButton({
|
|
61
|
-
onUnlink,
|
|
62
|
-
isUnlinking = false,
|
|
63
|
-
disabled = false,
|
|
64
|
-
size = "xs",
|
|
65
|
-
variant = "ghost",
|
|
66
|
-
className,
|
|
67
|
-
"aria-label": ariaLabel = "Unlink record"
|
|
68
|
-
}) {
|
|
69
|
-
return /* @__PURE__ */ jsx(
|
|
70
|
-
Button,
|
|
71
|
-
{
|
|
72
|
-
variant,
|
|
73
|
-
size,
|
|
74
|
-
onClick: onUnlink,
|
|
75
|
-
disabled: disabled || isUnlinking,
|
|
76
|
-
className: cn(
|
|
77
|
-
"hover:bg-destructive/10 hover:text-destructive h-5 w-5 p-0",
|
|
78
|
-
"focus:ring-destructive/20 focus:ring-2 focus:ring-offset-1",
|
|
79
|
-
isUnlinking && "cursor-not-allowed opacity-50",
|
|
80
|
-
className
|
|
81
|
-
),
|
|
82
|
-
"aria-label": ariaLabel,
|
|
83
|
-
title: isUnlinking ? "Unlinking..." : "Unlink record",
|
|
84
|
-
children: isUnlinking ? /* @__PURE__ */ jsx(RiLoader4Line, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ jsx(RiCloseLine, { className: "h-3 w-3" })
|
|
85
|
-
}
|
|
86
|
-
);
|
|
7
|
+
//#region src/components/unlink-button.tsx
|
|
8
|
+
function UnlinkButton({ onUnlink, isUnlinking = false, disabled = false, size = "xs", variant = "ghost", className, "aria-label": ariaLabel = "Unlink record" }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
10
|
+
variant,
|
|
11
|
+
size,
|
|
12
|
+
onClick: onUnlink,
|
|
13
|
+
disabled: disabled || isUnlinking,
|
|
14
|
+
className: cn("hover:bg-destructive/10 hover:text-destructive h-5 w-5 p-0", "focus:ring-destructive/20 focus:ring-2 focus:ring-offset-1", isUnlinking && "cursor-not-allowed opacity-50", className),
|
|
15
|
+
"aria-label": ariaLabel,
|
|
16
|
+
title: isUnlinking ? "Unlinking..." : "Unlink record",
|
|
17
|
+
children: isUnlinking ? /* @__PURE__ */ jsx(RiLoader4Line, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ jsx(RiCloseLine, { className: "h-3 w-3" })
|
|
18
|
+
});
|
|
87
19
|
}
|
|
88
20
|
|
|
21
|
+
//#endregion
|
|
89
22
|
export { UnlinkButton };
|
|
90
|
-
//# sourceMappingURL=unlink-button.js.map
|
|
91
23
|
//# sourceMappingURL=unlink-button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"unlink-button.js","names":[],"sources":["../../src/components/unlink-button.tsx"],"sourcesContent":["import { RiCloseLine, RiLoader4Line } from '@remixicon/react';\n\nimport { cn } from '../lib/utils';\nimport { Button } from './button';\n\ninterface UnlinkButtonProps {\n\tonUnlink: () => void;\n\tisUnlinking?: boolean;\n\tdisabled?: boolean;\n\tsize?: 'sm' | 'xs';\n\tvariant?: 'destructive' | 'ghost';\n\tclassName?: string;\n\t'aria-label'?: string;\n}\n\nexport function UnlinkButton({\n\tonUnlink,\n\tisUnlinking = false,\n\tdisabled = false,\n\tsize = 'xs',\n\tvariant = 'ghost',\n\tclassName,\n\t'aria-label': ariaLabel = 'Unlink record',\n}: UnlinkButtonProps) {\n\treturn (\n\t\t<Button\n\t\t\tvariant={variant}\n\t\t\tsize={size}\n\t\t\tonClick={onUnlink}\n\t\t\tdisabled={disabled || isUnlinking}\n\t\t\tclassName={cn(\n\t\t\t\t'hover:bg-destructive/10 hover:text-destructive h-5 w-5 p-0',\n\t\t\t\t'focus:ring-destructive/20 focus:ring-2 focus:ring-offset-1',\n\t\t\t\tisUnlinking && 'cursor-not-allowed opacity-50',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\taria-label={ariaLabel}\n\t\t\ttitle={isUnlinking ? 'Unlinking...' : 'Unlink record'}\n\t\t>\n\t\t\t{isUnlinking ? <RiLoader4Line className='h-3 w-3 animate-spin' /> : <RiCloseLine className='h-3 w-3' />}\n\t\t</Button>\n\t);\n}\n"],"mappings":";;;;;;;AAeA,SAAgB,aAAa,EAC5B,UACA,cAAc,OACd,WAAW,OACX,OAAO,MACP,UAAU,SACV,WACA,cAAc,YAAY,mBACL;CACrB,OACC,oBAAC,QAAD;EACU;EACH;EACN,SAAS;EACT,UAAU,YAAY;EACtB,WAAW,GACV,8DACA,8DACA,eAAe,iCACf,SACD;EACA,cAAY;EACZ,OAAO,cAAc,iBAAiB;YAErC,cAAc,oBAAC,eAAD,EAAe,WAAU,uBAAwB,KAAI,oBAAC,aAAD,EAAa,WAAU,UAAW;CAC/F;AAEV"}
|