@uselets/ui 1.16.0 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/accordion-BCo2odjy.js +2 -0
- package/dist/accordion-BCo2odjy.js.map +1 -0
- package/dist/accordion-DtSr3uiA.d.ts +15 -0
- package/dist/alert-CJRgRQVF.js +2 -0
- package/dist/alert-CJRgRQVF.js.map +1 -0
- package/dist/alert-dialog-B_nAiD4Y.js +2 -0
- package/dist/alert-dialog-B_nAiD4Y.js.map +1 -0
- package/dist/alert-dialog-Bf41-OnT.d.ts +34 -0
- package/dist/alert-eivgSC_S.d.ts +18 -0
- package/dist/anchor-DCOyn0Xa.d.ts +15 -0
- package/dist/anchor-srhmShjN.js +2 -0
- package/dist/anchor-srhmShjN.js.map +1 -0
- package/dist/area-chart-DdDy8Vm3.js +2 -0
- package/dist/area-chart-DdDy8Vm3.js.map +1 -0
- package/dist/area-chart-F_4ZL20j.d.ts +40 -0
- package/dist/avatar-2ZS3Tx76.d.ts +21 -0
- package/dist/avatar-CFUwrOwG.js +2 -0
- package/dist/avatar-CFUwrOwG.js.map +1 -0
- package/dist/badge-BqpQcDFd.d.ts +16 -0
- package/dist/badge-Cuq_DqRS.js +2 -0
- package/dist/badge-Cuq_DqRS.js.map +1 -0
- package/dist/badge-DEgLmZYC.js +2 -0
- package/dist/badge-DEgLmZYC.js.map +1 -0
- package/dist/badge-gkezuSZY.d.ts +19 -0
- package/dist/bar-chart-DIgSnh_j.js +2 -0
- package/dist/bar-chart-DIgSnh_j.js.map +1 -0
- package/dist/bar-chart-DRrrfMQR.d.ts +42 -0
- package/dist/breadcrumb-CqNDAI8V.js +2 -0
- package/dist/breadcrumb-CqNDAI8V.js.map +1 -0
- package/dist/breadcrumb-DZFS9htN.d.ts +22 -0
- package/dist/button-BNGy28pv.d.ts +17 -0
- package/dist/button-CQbH5Glc.d.ts +19 -0
- package/dist/button-DGewx2nE.js +2 -0
- package/dist/button-DGewx2nE.js.map +1 -0
- package/dist/button-group-DRgqsyjS.d.ts +18 -0
- package/dist/button-group-WJ5LeouK.js +2 -0
- package/dist/button-group-WJ5LeouK.js.map +1 -0
- package/dist/button-oI3hbOgp.js +2 -0
- package/dist/button-oI3hbOgp.js.map +1 -0
- package/dist/calendar-C1GgjzIA.d.ts +17 -0
- package/dist/calendar-CW1kGXom.js +2 -0
- package/dist/calendar-CW1kGXom.js.map +1 -0
- package/dist/card-Bx6iiocl.js +2 -0
- package/dist/card-Bx6iiocl.js.map +1 -0
- package/dist/card-pWjtkTKw.d.ts +22 -0
- package/dist/carousel-C6e4eRJD.d.ts +43 -0
- package/dist/carousel-D0OTImO7.js +2 -0
- package/dist/carousel-D0OTImO7.js.map +1 -0
- package/dist/center-CFQDr205.d.ts +13 -0
- package/dist/center-Dl1rnq7S.js +2 -0
- package/dist/center-Dl1rnq7S.js.map +1 -0
- package/dist/chart-Ci4V8B8v.js +8 -0
- package/dist/chart-Ci4V8B8v.js.map +1 -0
- package/dist/checkbox-DPvW_m7k.js +2 -0
- package/dist/checkbox-DPvW_m7k.js.map +1 -0
- package/dist/checkbox-y0XBdH4a.d.ts +21 -0
- package/dist/code-A6JERAsm.js +2 -0
- package/dist/code-A6JERAsm.js.map +1 -0
- package/dist/code-Cqoacc61.d.ts +8 -0
- package/dist/collapsible-BH8BqfTd.js +2 -0
- package/dist/collapsible-BH8BqfTd.js.map +1 -0
- package/dist/collapsible-CLSCZ630.d.ts +12 -0
- package/dist/color-DJvQFSl5.d.ts +19 -0
- package/dist/color-Don4qaht.js +2 -0
- package/dist/color-Don4qaht.js.map +1 -0
- package/dist/combobox-DkCRXUxd.d.ts +51 -0
- package/dist/combobox-fNAIovsN.js +2 -0
- package/dist/combobox-fNAIovsN.js.map +1 -0
- package/dist/command-0wTb46Ym.js +2 -0
- package/dist/command-0wTb46Ym.js.map +1 -0
- package/dist/command-D4pNOx0J.d.ts +31 -0
- package/dist/components/accordion.d.ts +2 -15
- package/dist/components/accordion.js +1 -2
- package/dist/components/accordion.spec.d.ts +1 -0
- package/dist/components/accordion.spec.js +2 -0
- package/dist/components/accordion.spec.js.map +1 -0
- package/dist/components/alert-dialog.d.ts +2 -34
- package/dist/components/alert-dialog.js +1 -2
- package/dist/components/alert-dialog.spec.d.ts +1 -0
- package/dist/components/alert-dialog.spec.js +2 -0
- package/dist/components/alert-dialog.spec.js.map +1 -0
- package/dist/components/alert.d.ts +2 -18
- package/dist/components/alert.js +1 -2
- package/dist/components/alert.spec.d.ts +1 -0
- package/dist/components/alert.spec.js +2 -0
- package/dist/components/alert.spec.js.map +1 -0
- package/dist/components/anchor.d.ts +2 -15
- package/dist/components/anchor.js +1 -2
- package/dist/components/anchor.spec.d.ts +1 -0
- package/dist/components/anchor.spec.js +2 -0
- package/dist/components/anchor.spec.js.map +1 -0
- package/dist/components/area-chart.d.ts +2 -40
- package/dist/components/area-chart.js +1 -2
- package/dist/components/area-chart.spec.d.ts +1 -0
- package/dist/components/area-chart.spec.js +2 -0
- package/dist/components/area-chart.spec.js.map +1 -0
- package/dist/components/avatar.d.ts +2 -21
- package/dist/components/avatar.js +1 -2
- package/dist/components/avatar.spec.d.ts +1 -0
- package/dist/components/avatar.spec.js +2 -0
- package/dist/components/avatar.spec.js.map +1 -0
- package/dist/components/badge.d.ts +2 -16
- package/dist/components/badge.js +1 -2
- package/dist/components/badge.spec.d.ts +1 -0
- package/dist/components/badge.spec.js +2 -0
- package/dist/components/badge.spec.js.map +1 -0
- package/dist/components/bar-chart.d.ts +2 -42
- package/dist/components/bar-chart.js +1 -2
- package/dist/components/bar-chart.spec.d.ts +1 -0
- package/dist/components/bar-chart.spec.js +2 -0
- package/dist/components/bar-chart.spec.js.map +1 -0
- package/dist/components/breadcrumb.d.ts +2 -22
- package/dist/components/breadcrumb.js +1 -2
- package/dist/components/breadcrumb.spec.d.ts +1 -0
- package/dist/components/breadcrumb.spec.js +2 -0
- package/dist/components/breadcrumb.spec.js.map +1 -0
- package/dist/components/button-group.d.ts +2 -18
- package/dist/components/button-group.js +1 -2
- package/dist/components/button-group.spec.d.ts +1 -0
- package/dist/components/button-group.spec.js +2 -0
- package/dist/components/button-group.spec.js.map +1 -0
- package/dist/components/button.d.ts +2 -17
- package/dist/components/button.js +1 -2
- package/dist/components/button.spec.d.ts +1 -0
- package/dist/components/button.spec.js +2 -0
- package/dist/components/button.spec.js.map +1 -0
- package/dist/components/calendar.d.ts +2 -17
- package/dist/components/calendar.js +1 -2
- package/dist/components/calendar.spec.d.ts +1 -0
- package/dist/components/calendar.spec.js +2 -0
- package/dist/components/calendar.spec.js.map +1 -0
- package/dist/components/card.d.ts +2 -22
- package/dist/components/card.js +1 -2
- package/dist/components/card.spec.d.ts +1 -0
- package/dist/components/card.spec.js +2 -0
- package/dist/components/card.spec.js.map +1 -0
- package/dist/components/carousel.d.ts +2 -43
- package/dist/components/carousel.js +1 -2
- package/dist/components/carousel.spec.js +1 -93
- package/dist/components/carousel.spec.js.map +1 -1
- package/dist/components/center.d.ts +2 -13
- package/dist/components/center.js +1 -2
- package/dist/components/center.spec.d.ts +1 -0
- package/dist/components/center.spec.js +2 -0
- package/dist/components/center.spec.js.map +1 -0
- package/dist/components/chart.js +1 -8
- package/dist/components/chart.spec.d.ts +1 -0
- package/dist/components/chart.spec.js +2 -0
- package/dist/components/chart.spec.js.map +1 -0
- package/dist/components/checkbox.d.ts +2 -21
- package/dist/components/checkbox.js +1 -2
- package/dist/components/checkbox.spec.d.ts +1 -0
- package/dist/components/checkbox.spec.js +2 -0
- package/dist/components/checkbox.spec.js.map +1 -0
- package/dist/components/code.d.ts +2 -8
- package/dist/components/code.js +1 -2
- package/dist/components/code.spec.d.ts +1 -0
- package/dist/components/code.spec.js +2 -0
- package/dist/components/code.spec.js.map +1 -0
- package/dist/components/collapsible.d.ts +2 -12
- package/dist/components/collapsible.js +1 -2
- package/dist/components/collapsible.spec.d.ts +1 -0
- package/dist/components/collapsible.spec.js +2 -0
- package/dist/components/collapsible.spec.js.map +1 -0
- package/dist/components/combobox.d.ts +2 -51
- package/dist/components/combobox.js +1 -2
- package/dist/components/combobox.spec.d.ts +1 -0
- package/dist/components/combobox.spec.js +2 -0
- package/dist/components/combobox.spec.js.map +1 -0
- package/dist/components/command.d.ts +2 -31
- package/dist/components/command.js +1 -2
- package/dist/components/command.spec.d.ts +1 -0
- package/dist/components/command.spec.js +2 -0
- package/dist/components/command.spec.js.map +1 -0
- package/dist/components/container.d.ts +2 -12
- package/dist/components/container.js +1 -2
- package/dist/components/container.spec.d.ts +1 -0
- package/dist/components/container.spec.js +2 -0
- package/dist/components/container.spec.js.map +1 -0
- package/dist/components/data-table.d.ts +2 -111
- package/dist/components/data-table.js +1 -2
- package/dist/components/data-table.spec.d.ts +1 -0
- package/dist/components/data-table.spec.js +2 -0
- package/dist/components/data-table.spec.js.map +1 -0
- package/dist/components/date-range-picker.d.ts +3 -55
- package/dist/components/date-range-picker.js +1 -2
- package/dist/components/date-range-picker.spec.d.ts +1 -0
- package/dist/components/date-range-picker.spec.js +2 -0
- package/dist/components/date-range-picker.spec.js.map +1 -0
- package/dist/components/dialog.d.ts +2 -42
- package/dist/components/dialog.js +1 -2
- package/dist/components/dialog.spec.d.ts +1 -0
- package/dist/components/dialog.spec.js +2 -0
- package/dist/components/dialog.spec.js.map +1 -0
- package/dist/components/donut-chart.d.ts +2 -13
- package/dist/components/donut-chart.js +1 -2
- package/dist/components/donut-chart.spec.d.ts +1 -0
- package/dist/components/donut-chart.spec.js +2 -0
- package/dist/components/donut-chart.spec.js.map +1 -0
- package/dist/components/drawer.d.ts +2 -43
- package/dist/components/drawer.js +1 -2
- package/dist/components/drawer.spec.d.ts +1 -0
- package/dist/components/drawer.spec.js +2 -0
- package/dist/components/drawer.spec.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +2 -48
- package/dist/components/dropdown-menu.js +1 -2
- package/dist/components/dropdown-menu.spec.d.ts +1 -0
- package/dist/components/dropdown-menu.spec.js +2 -0
- package/dist/components/dropdown-menu.spec.js.map +1 -0
- package/dist/components/dropzone.d.ts +2 -102
- package/dist/components/dropzone.js +1 -2
- package/dist/components/dropzone.spec.d.ts +1 -0
- package/dist/components/dropzone.spec.js +2 -0
- package/dist/components/dropzone.spec.js.map +1 -0
- package/dist/components/empty.d.ts +2 -21
- package/dist/components/empty.js +1 -2
- package/dist/components/empty.spec.d.ts +1 -0
- package/dist/components/empty.spec.js +2 -0
- package/dist/components/empty.spec.js.map +1 -0
- package/dist/components/field.d.ts +2 -39
- package/dist/components/field.js +1 -2
- package/dist/components/field.spec.js +1 -1
- package/dist/components/field.spec.js.map +1 -1
- package/dist/components/flex.d.ts +2 -16
- package/dist/components/flex.js +1 -2
- package/dist/components/flex.spec.d.ts +1 -0
- package/dist/components/flex.spec.js +2 -0
- package/dist/components/flex.spec.js.map +1 -0
- package/dist/components/grid.d.ts +2 -20
- package/dist/components/grid.js +1 -2
- package/dist/components/grid.spec.d.ts +1 -0
- package/dist/components/grid.spec.js +2 -0
- package/dist/components/grid.spec.js.map +1 -0
- package/dist/components/group.d.ts +2 -15
- package/dist/components/group.js +1 -2
- package/dist/components/group.spec.d.ts +1 -0
- package/dist/components/group.spec.js +2 -0
- package/dist/components/group.spec.js.map +1 -0
- package/dist/components/heading.d.ts +2 -14
- package/dist/components/heading.js +1 -2
- package/dist/components/heading.spec.d.ts +1 -0
- package/dist/components/heading.spec.js +2 -0
- package/dist/components/heading.spec.js.map +1 -0
- package/dist/components/hover-card.d.ts +2 -13
- package/dist/components/hover-card.js +1 -2
- package/dist/components/hover-card.spec.d.ts +1 -0
- package/dist/components/hover-card.spec.js +2 -0
- package/dist/components/hover-card.spec.js.map +1 -0
- package/dist/components/input-group.d.ts +2 -26
- package/dist/components/input-group.js +1 -2
- package/dist/components/input-group.spec.d.ts +1 -0
- package/dist/components/input-group.spec.js +2 -0
- package/dist/components/input-group.spec.js.map +1 -0
- package/dist/components/input-otp.d.ts +2 -19
- package/dist/components/input-otp.js +1 -2
- package/dist/components/input-otp.spec.d.ts +1 -0
- package/dist/components/input-otp.spec.js +2 -0
- package/dist/components/input-otp.spec.js.map +1 -0
- package/dist/components/input.d.ts +2 -8
- package/dist/components/input.js +1 -2
- package/dist/components/input.spec.d.ts +1 -0
- package/dist/components/input.spec.js +2 -0
- package/dist/components/input.spec.js.map +1 -0
- package/dist/components/kbd.d.ts +2 -10
- package/dist/components/kbd.js +1 -2
- package/dist/components/kbd.spec.d.ts +1 -0
- package/dist/components/kbd.spec.js +2 -0
- package/dist/components/kbd.spec.js.map +1 -0
- package/dist/components/label.d.ts +2 -9
- package/dist/components/label.js +1 -2
- package/dist/components/label.spec.d.ts +1 -0
- package/dist/components/label.spec.js +2 -0
- package/dist/components/label.spec.js.map +1 -0
- package/dist/components/list.d.ts +2 -25
- package/dist/components/list.js +1 -2
- package/dist/components/list.spec.d.ts +1 -0
- package/dist/components/list.spec.js +2 -0
- package/dist/components/list.spec.js.map +1 -0
- package/dist/components/logo.d.ts +2 -0
- package/dist/components/logo.js +1 -0
- package/dist/components/logo.spec.d.ts +1 -0
- package/dist/components/logo.spec.js +2 -0
- package/dist/components/logo.spec.js.map +1 -0
- package/dist/components/marker.d.ts +2 -18
- package/dist/components/marker.js +1 -2
- package/dist/components/marker.spec.d.ts +1 -0
- package/dist/components/marker.spec.js +2 -0
- package/dist/components/marker.spec.js.map +1 -0
- package/dist/components/mask-input.d.ts +2 -16
- package/dist/components/mask-input.js +1 -2
- package/dist/components/mask-input.spec.d.ts +1 -0
- package/dist/components/mask-input.spec.js +2 -0
- package/dist/components/mask-input.spec.js.map +1 -0
- package/dist/components/native-select.d.ts +2 -14
- package/dist/components/native-select.js +1 -2
- package/dist/components/native-select.spec.d.ts +1 -0
- package/dist/components/native-select.spec.js +2 -0
- package/dist/components/native-select.spec.js.map +1 -0
- package/dist/components/navigation-menu.d.ts +2 -26
- package/dist/components/navigation-menu.js +1 -2
- package/dist/components/navigation-menu.spec.d.ts +1 -0
- package/dist/components/navigation-menu.spec.js +2 -0
- package/dist/components/navigation-menu.spec.js.map +1 -0
- package/dist/components/number-field.d.ts +2 -35
- package/dist/components/number-field.js +1 -2
- package/dist/components/number-field.spec.d.ts +1 -0
- package/dist/components/number-field.spec.js +2 -0
- package/dist/components/number-field.spec.js.map +1 -0
- package/dist/components/pagination.d.ts +2 -27
- package/dist/components/pagination.js +1 -2
- package/dist/components/pagination.spec.d.ts +1 -0
- package/dist/components/pagination.spec.js +2 -0
- package/dist/components/pagination.spec.js.map +1 -0
- package/dist/components/phone-input.d.ts +2 -13
- package/dist/components/phone-input.js +1 -2
- package/dist/components/phone-input.spec.d.ts +1 -0
- package/dist/components/phone-input.spec.js +2 -0
- package/dist/components/phone-input.spec.js.map +1 -0
- package/dist/components/pie-chart.d.ts +2 -42
- package/dist/components/pie-chart.js +1 -2
- package/dist/components/pie-chart.spec.d.ts +1 -0
- package/dist/components/pie-chart.spec.js +2 -0
- package/dist/components/pie-chart.spec.js.map +1 -0
- package/dist/components/popover.d.ts +2 -21
- package/dist/components/popover.js +1 -2
- package/dist/components/popover.spec.d.ts +1 -0
- package/dist/components/popover.spec.js +2 -0
- package/dist/components/popover.spec.js.map +1 -0
- package/dist/components/progress.d.ts +2 -14
- package/dist/components/progress.js +1 -2
- package/dist/components/progress.spec.d.ts +1 -0
- package/dist/components/progress.spec.js +2 -0
- package/dist/components/progress.spec.js.map +1 -0
- package/dist/components/radio-group.d.ts +2 -25
- package/dist/components/radio-group.js +1 -2
- package/dist/components/radio-group.spec.d.ts +1 -0
- package/dist/components/radio-group.spec.js +2 -0
- package/dist/components/radio-group.spec.js.map +1 -0
- package/dist/components/resizable.d.ts +2 -14
- package/dist/components/resizable.js +1 -2
- package/dist/components/resizable.spec.d.ts +1 -0
- package/dist/components/resizable.spec.js +2 -0
- package/dist/components/resizable.spec.js.map +1 -0
- package/dist/components/ring-progress.d.ts +2 -17
- package/dist/components/ring-progress.js +1 -2
- package/dist/components/ring-progress.spec.d.ts +1 -0
- package/dist/components/ring-progress.spec.js +2 -0
- package/dist/components/ring-progress.spec.js.map +1 -0
- package/dist/components/scroll-area.d.ts +2 -11
- package/dist/components/scroll-area.js +1 -2
- package/dist/components/scroll-area.spec.d.ts +1 -0
- package/dist/components/scroll-area.spec.js +2 -0
- package/dist/components/scroll-area.spec.js.map +1 -0
- package/dist/components/select.d.ts +2 -29
- package/dist/components/select.js +1 -2
- package/dist/components/select.spec.d.ts +1 -0
- package/dist/components/select.spec.js +2 -0
- package/dist/components/select.spec.js.map +1 -0
- package/dist/components/separator.d.ts +2 -9
- package/dist/components/separator.js +1 -2
- package/dist/components/separator.spec.d.ts +1 -0
- package/dist/components/separator.spec.js +2 -0
- package/dist/components/separator.spec.js.map +1 -0
- package/dist/components/sidebar.d.ts +2 -96
- package/dist/components/sidebar.js +1 -2
- package/dist/components/sidebar.spec.d.ts +1 -0
- package/dist/components/sidebar.spec.js +2 -0
- package/dist/components/sidebar.spec.js.map +1 -0
- package/dist/components/simple-grid.d.ts +2 -14
- package/dist/components/simple-grid.js +1 -2
- package/dist/components/simple-grid.spec.d.ts +1 -0
- package/dist/components/simple-grid.spec.js +2 -0
- package/dist/components/simple-grid.spec.js.map +1 -0
- package/dist/components/skeleton.d.ts +2 -10
- package/dist/components/skeleton.js +1 -2
- package/dist/components/skeleton.spec.js +1 -1
- package/dist/components/skeleton.spec.js.map +1 -1
- package/dist/components/slider.d.ts +2 -9
- package/dist/components/slider.js +1 -2
- package/dist/components/slider.spec.d.ts +1 -0
- package/dist/components/slider.spec.js +2 -0
- package/dist/components/slider.spec.js.map +1 -0
- package/dist/components/sonner.d.ts +2 -8
- package/dist/components/sonner.js +1 -2
- package/dist/components/sonner.spec.d.ts +1 -0
- package/dist/components/sonner.spec.js +2 -0
- package/dist/components/sonner.spec.js.map +1 -0
- package/dist/components/spinner.d.ts +2 -12
- package/dist/components/spinner.js +1 -2
- package/dist/components/spinner.spec.d.ts +1 -0
- package/dist/components/spinner.spec.js +2 -0
- package/dist/components/spinner.spec.js.map +1 -0
- package/dist/components/stack.d.ts +2 -14
- package/dist/components/stack.js +1 -2
- package/dist/components/stack.spec.d.ts +1 -0
- package/dist/components/stack.spec.js +2 -0
- package/dist/components/stack.spec.js.map +1 -0
- package/dist/components/stepper.d.ts +2 -71
- package/dist/components/stepper.js +1 -2
- package/dist/components/stepper.spec.d.ts +1 -0
- package/dist/components/stepper.spec.js +2 -0
- package/dist/components/stepper.spec.js.map +1 -0
- package/dist/components/switch.d.ts +2 -17
- package/dist/components/switch.js +1 -2
- package/dist/components/switch.spec.d.ts +1 -0
- package/dist/components/switch.spec.js +2 -0
- package/dist/components/switch.spec.js.map +1 -0
- package/dist/components/table.d.ts +2 -33
- package/dist/components/table.js +1 -2
- package/dist/components/table.spec.d.ts +1 -0
- package/dist/components/table.spec.js +2 -0
- package/dist/components/table.spec.js.map +1 -0
- package/dist/components/tabs.d.ts +2 -21
- package/dist/components/tabs.js +1 -2
- package/dist/components/tabs.spec.d.ts +1 -0
- package/dist/components/tabs.spec.js +2 -0
- package/dist/components/tabs.spec.js.map +1 -0
- package/dist/components/text.d.ts +2 -14
- package/dist/components/text.js +1 -2
- package/dist/components/text.spec.d.ts +1 -0
- package/dist/components/text.spec.js +2 -0
- package/dist/components/text.spec.js.map +1 -0
- package/dist/components/textarea.d.ts +2 -8
- package/dist/components/textarea.js +1 -2
- package/dist/components/textarea.spec.d.ts +1 -0
- package/dist/components/textarea.spec.js +2 -0
- package/dist/components/textarea.spec.js.map +1 -0
- package/dist/components/theme.d.ts +2 -22
- package/dist/components/theme.js +1 -2
- package/dist/components/theme.spec.d.ts +1 -0
- package/dist/components/theme.spec.js +2 -0
- package/dist/components/theme.spec.js.map +1 -0
- package/dist/components/timeline.d.ts +2 -61
- package/dist/components/timeline.js +1 -2
- package/dist/components/timeline.spec.d.ts +1 -0
- package/dist/components/timeline.spec.js +2 -0
- package/dist/components/timeline.spec.js.map +1 -0
- package/dist/components/toggle-group.d.ts +2 -16
- package/dist/components/toggle-group.js +1 -2
- package/dist/components/toggle-group.spec.d.ts +1 -0
- package/dist/components/toggle-group.spec.js +2 -0
- package/dist/components/toggle-group.spec.js.map +1 -0
- package/dist/components/toggle.d.ts +2 -15
- package/dist/components/toggle.js +1 -2
- package/dist/components/toggle.spec.d.ts +1 -0
- package/dist/components/toggle.spec.js +2 -0
- package/dist/components/toggle.spec.js.map +1 -0
- package/dist/components/tooltip.d.ts +2 -21
- package/dist/components/tooltip.js +1 -2
- package/dist/components/tooltip.spec.d.ts +1 -0
- package/dist/components/tooltip.spec.js +2 -0
- package/dist/components/tooltip.spec.js.map +1 -0
- package/dist/components/unstyled-button.d.ts +2 -10
- package/dist/components/unstyled-button.js +1 -2
- package/dist/components/unstyled-button.spec.d.ts +1 -0
- package/dist/components/unstyled-button.spec.js +2 -0
- package/dist/components/unstyled-button.spec.js.map +1 -0
- package/dist/components/visibility.d.ts +2 -17
- package/dist/components/visibility.js +1 -2
- package/dist/components/visibility.spec.d.ts +1 -0
- package/dist/components/visibility.spec.js +2 -0
- package/dist/components/visibility.spec.js.map +1 -0
- package/dist/compose-refs-DUtp7lGn.js +2 -0
- package/dist/compose-refs-DUtp7lGn.js.map +1 -0
- package/dist/compose-refs-GP3zdokU.d.ts +8 -0
- package/dist/container-B8-lt-oX.d.ts +12 -0
- package/dist/container-CikeKdez.js +2 -0
- package/dist/container-CikeKdez.js.map +1 -0
- package/dist/data-table-BT75MSO9.d.ts +111 -0
- package/dist/data-table-DcyKClKz.js +2 -0
- package/dist/data-table-DcyKClKz.js.map +1 -0
- package/dist/date-range-picker-BngvCWcR.d.ts +55 -0
- package/dist/date-range-picker-CJVpTZdT.js +2 -0
- package/dist/date-range-picker-CJVpTZdT.js.map +1 -0
- package/dist/dialog-B7I4Ky1i.js +2 -0
- package/dist/dialog-B7I4Ky1i.js.map +1 -0
- package/dist/dialog-Ej7pnact.d.ts +42 -0
- package/dist/donut-chart-BDJR8TXh.d.ts +13 -0
- package/dist/donut-chart-BHU4kDE6.js +2 -0
- package/dist/donut-chart-BHU4kDE6.js.map +1 -0
- package/dist/drawer-BO4mP6y1.js +2 -0
- package/dist/drawer-BO4mP6y1.js.map +1 -0
- package/dist/drawer-DUfJzrKE.d.ts +43 -0
- package/dist/dropdown-menu-CVDIf0Rd.d.ts +48 -0
- package/dist/dropdown-menu-zRuQQS5S.js +2 -0
- package/dist/dropdown-menu-zRuQQS5S.js.map +1 -0
- package/dist/dropzone-43h3L9Ko.d.ts +102 -0
- package/dist/dropzone-BLZkZThJ.js +2 -0
- package/dist/dropzone-BLZkZThJ.js.map +1 -0
- package/dist/empty-BhKsDYZ5.js +2 -0
- package/dist/empty-BhKsDYZ5.js.map +1 -0
- package/dist/empty-D8ZiTCVK.d.ts +21 -0
- package/dist/field-C209yHO9.d.ts +39 -0
- package/dist/field-DzR-XrO7.js +2 -0
- package/dist/field-DzR-XrO7.js.map +1 -0
- package/dist/flex-BC4Diiy4.js +2 -0
- package/dist/flex-BC4Diiy4.js.map +1 -0
- package/dist/flex-aJXipTAz.d.ts +16 -0
- package/dist/grid-B3He1bGe.js +2 -0
- package/dist/grid-B3He1bGe.js.map +1 -0
- package/dist/grid-D_aEANA7.d.ts +20 -0
- package/dist/group-B6n_lMc4.js +2 -0
- package/dist/group-B6n_lMc4.js.map +1 -0
- package/dist/group-DBtx8eSe.d.ts +15 -0
- package/dist/heading-BTXl4JfI.d.ts +14 -0
- package/dist/heading-DaxKLVRm.js +2 -0
- package/dist/heading-DaxKLVRm.js.map +1 -0
- package/dist/hooks/use-breakpoint-value.d.ts +2 -8
- package/dist/hooks/use-breakpoint-value.js +1 -2
- package/dist/hooks/use-breakpoint-value.spec.js +34 -1
- package/dist/hooks/use-breakpoint-value.spec.js.map +1 -1
- package/dist/hooks/use-breakpoint.d.ts +2 -8
- package/dist/hooks/use-breakpoint.js +1 -2
- package/dist/hooks/use-breakpoint.spec.js +1 -1
- package/dist/hooks/use-breakpoint.spec.js.map +1 -1
- package/dist/hooks/use-disclosure.d.ts +2 -22
- package/dist/hooks/use-disclosure.js +1 -2
- package/dist/hooks/use-disclosure.spec.js +1 -1
- package/dist/hooks/use-disclosure.spec.js.map +1 -1
- package/dist/hooks/use-document-visibility.d.ts +2 -6
- package/dist/hooks/use-document-visibility.js +1 -2
- package/dist/hooks/use-document-visibility.spec.js +1 -1
- package/dist/hooks/use-document-visibility.spec.js.map +1 -1
- package/dist/hooks/use-hotkeys.spec.js +1 -1
- package/dist/hooks/use-idle.d.ts +2 -13
- package/dist/hooks/use-idle.js +1 -2
- package/dist/hooks/use-idle.spec.js +1 -1
- package/dist/hooks/use-idle.spec.js.map +1 -1
- package/dist/hooks/use-interval.d.ts +2 -24
- package/dist/hooks/use-interval.js +1 -2
- package/dist/hooks/use-interval.spec.js +1 -1
- package/dist/hooks/use-local-storage.d.ts +2 -16
- package/dist/hooks/use-local-storage.js +1 -2
- package/dist/hooks/use-local-storage.spec.js +1 -1
- package/dist/hooks/use-local-storage.spec.js.map +1 -1
- package/dist/hooks/use-mask.d.ts +2 -8
- package/dist/hooks/use-mask.js +1 -2
- package/dist/hooks/use-mask.spec.d.ts +1 -0
- package/dist/hooks/use-mask.spec.js +2 -0
- package/dist/hooks/use-mask.spec.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +2 -6
- package/dist/hooks/use-mobile.js +1 -2
- package/dist/hooks/use-mobile.spec.js +1 -1
- package/dist/hover-card-C3yz2zQi.d.ts +13 -0
- package/dist/hover-card-Dc8yLsm-.js +2 -0
- package/dist/hover-card-Dc8yLsm-.js.map +1 -0
- package/dist/index.d.ts +94 -93
- package/dist/index.js +1 -1
- package/dist/input-CI3RPXz0.d.ts +8 -0
- package/dist/input-Cmjl8YdK.js +2 -0
- package/dist/input-Cmjl8YdK.js.map +1 -0
- package/dist/input-group-CBn36aMg.d.ts +26 -0
- package/dist/input-group-DsO2W3Lw.js +2 -0
- package/dist/input-group-DsO2W3Lw.js.map +1 -0
- package/dist/input-otp-CzfRHf2V.js +2 -0
- package/dist/input-otp-CzfRHf2V.js.map +1 -0
- package/dist/input-otp-gIEkdiIC.d.ts +19 -0
- package/dist/kbd-BTl3AgkY.js +2 -0
- package/dist/kbd-BTl3AgkY.js.map +1 -0
- package/dist/kbd-DELCQBD0.d.ts +10 -0
- package/dist/label-BQDEej_c.js +2 -0
- package/dist/label-BQDEej_c.js.map +1 -0
- package/dist/label-KZl6I5Ey.d.ts +9 -0
- package/dist/lib/badge.d.ts +2 -19
- package/dist/lib/badge.js +1 -2
- package/dist/lib/badge.spec.d.ts +1 -0
- package/dist/lib/badge.spec.js +2 -0
- package/dist/lib/badge.spec.js.map +1 -0
- package/dist/lib/button.d.ts +2 -19
- package/dist/lib/button.js +1 -2
- package/dist/lib/button.spec.d.ts +1 -0
- package/dist/lib/button.spec.js +2 -0
- package/dist/lib/button.spec.js.map +1 -0
- package/dist/lib/color.d.ts +2 -19
- package/dist/lib/color.js +1 -2
- package/dist/lib/color.spec.d.ts +1 -0
- package/dist/lib/color.spec.js +2 -0
- package/dist/lib/color.spec.js.map +1 -0
- package/dist/lib/compose-refs.d.ts +2 -8
- package/dist/lib/compose-refs.js +1 -2
- package/dist/lib/compose-refs.spec.d.ts +1 -0
- package/dist/lib/compose-refs.spec.js +2 -0
- package/dist/lib/compose-refs.spec.js.map +1 -0
- package/dist/lib/progress.d.ts +2 -19
- package/dist/lib/progress.js +1 -2
- package/dist/lib/progress.spec.d.ts +1 -0
- package/dist/lib/progress.spec.js +2 -0
- package/dist/lib/progress.spec.js.map +1 -0
- package/dist/lib/utils.d.ts +2 -8
- package/dist/lib/utils.js +1 -2
- package/dist/lib/utils.spec.d.ts +1 -0
- package/dist/lib/utils.spec.js +2 -0
- package/dist/lib/utils.spec.js.map +1 -0
- package/dist/list-BbCg-ndB.js +2 -0
- package/dist/list-BbCg-ndB.js.map +1 -0
- package/dist/list-DMa2j1rk.d.ts +25 -0
- package/dist/logo-B0v9bNJH.js +2 -0
- package/dist/logo-B0v9bNJH.js.map +1 -0
- package/dist/logo-Buo7sqqn.d.ts +69 -0
- package/dist/marker-4_EnMIHk.js +2 -0
- package/dist/marker-4_EnMIHk.js.map +1 -0
- package/dist/marker-C4wLa1c0.d.ts +18 -0
- package/dist/mask-input-B4R5K1h6.d.ts +16 -0
- package/dist/mask-input-ssK7U_Pl.js +2 -0
- package/dist/mask-input-ssK7U_Pl.js.map +1 -0
- package/dist/native-select-BVmdMkHY.d.ts +14 -0
- package/dist/native-select-DZW3Y7nq.js +2 -0
- package/dist/native-select-DZW3Y7nq.js.map +1 -0
- package/dist/navigation-menu-B6drNL1-.js +2 -0
- package/dist/navigation-menu-B6drNL1-.js.map +1 -0
- package/dist/navigation-menu-siQVRMUF.d.ts +26 -0
- package/dist/number-field-IdgO_BUa.d.ts +35 -0
- package/dist/number-field-rEMfZa6A.js +2 -0
- package/dist/number-field-rEMfZa6A.js.map +1 -0
- package/dist/pagination-BZ3xMXsy.d.ts +27 -0
- package/dist/pagination-gnUKddCN.js +2 -0
- package/dist/pagination-gnUKddCN.js.map +1 -0
- package/dist/phone-input-By5lNF03.d.ts +13 -0
- package/dist/phone-input-D72tVPWH.js +2 -0
- package/dist/phone-input-D72tVPWH.js.map +1 -0
- package/dist/pie-chart-CvG27kFN.d.ts +42 -0
- package/dist/pie-chart-S4nMKbsW.js +2 -0
- package/dist/pie-chart-S4nMKbsW.js.map +1 -0
- package/dist/popover-BtX3tX8M.js +2 -0
- package/dist/popover-BtX3tX8M.js.map +1 -0
- package/dist/popover-DchAqyKn.d.ts +21 -0
- package/dist/progress-DeXRCHUw.d.ts +19 -0
- package/dist/progress-QvpY7tiy.js +2 -0
- package/dist/progress-QvpY7tiy.js.map +1 -0
- package/dist/progress-icFwrvnE.js +2 -0
- package/dist/progress-icFwrvnE.js.map +1 -0
- package/dist/progress-mEAw9ZhK.d.ts +14 -0
- package/dist/radio-group-BNbepK_U.d.ts +25 -0
- package/dist/radio-group-DM8n0XPS.js +2 -0
- package/dist/radio-group-DM8n0XPS.js.map +1 -0
- package/dist/{react.esm-D5AipFQb.js → react.esm-BkhVXJ8s.js} +2 -2
- package/dist/{react.esm-D5AipFQb.js.map → react.esm-BkhVXJ8s.js.map} +1 -1
- package/dist/resizable-DMQG3xF_.d.ts +14 -0
- package/dist/resizable-Dbg7r7nF.js +2 -0
- package/dist/resizable-Dbg7r7nF.js.map +1 -0
- package/dist/ring-progress-65ccdTQQ.d.ts +17 -0
- package/dist/ring-progress-Bfqq_HHA.js +2 -0
- package/dist/ring-progress-Bfqq_HHA.js.map +1 -0
- package/dist/scroll-area-DFcj5q66.d.ts +11 -0
- package/dist/scroll-area-DKS4QPHg.js +2 -0
- package/dist/scroll-area-DKS4QPHg.js.map +1 -0
- package/dist/select-BoYp-Xyc.d.ts +29 -0
- package/dist/select-C3QYNv4t.js +2 -0
- package/dist/select-C3QYNv4t.js.map +1 -0
- package/dist/separator-BsRLiqWE.d.ts +9 -0
- package/dist/separator-CCMmbXL0.js +2 -0
- package/dist/separator-CCMmbXL0.js.map +1 -0
- package/dist/sidebar-B5bEgDy5.js +2 -0
- package/dist/sidebar-B5bEgDy5.js.map +1 -0
- package/dist/sidebar-D7HQlj5O.d.ts +96 -0
- package/dist/simple-grid-9EryoUWI.js +2 -0
- package/dist/simple-grid-9EryoUWI.js.map +1 -0
- package/dist/simple-grid-B2zjpwZ3.d.ts +14 -0
- package/dist/skeleton-Cn3zBJRe.js +2 -0
- package/dist/skeleton-Cn3zBJRe.js.map +1 -0
- package/dist/skeleton-Co8pevj-.d.ts +10 -0
- package/dist/skills/uselets-ui/references/component-catalog.md +3 -0
- package/dist/skills/uselets-ui/references/package-guide.md +1 -1
- package/dist/slider-CC-gQawq.js +2 -0
- package/dist/slider-CC-gQawq.js.map +1 -0
- package/dist/slider-DmZ1YfLg.d.ts +9 -0
- package/dist/sonner-Binx8JJ2.d.ts +8 -0
- package/dist/sonner-DrKqhTDI.js +2 -0
- package/dist/sonner-DrKqhTDI.js.map +1 -0
- package/dist/spinner-Dz63Ltq-.d.ts +12 -0
- package/dist/spinner-ntLrcDLN.js +2 -0
- package/dist/spinner-ntLrcDLN.js.map +1 -0
- package/dist/stack-BbLllsqk.js +2 -0
- package/dist/stack-BbLllsqk.js.map +1 -0
- package/dist/stack-WiND8Dxq.d.ts +14 -0
- package/dist/stepper-BQ-59_UO.js +2 -0
- package/dist/stepper-BQ-59_UO.js.map +1 -0
- package/dist/stepper-DK5_o7RG.d.ts +71 -0
- package/dist/switch-DjdOGECT.js +2 -0
- package/dist/switch-DjdOGECT.js.map +1 -0
- package/dist/switch-OtBakZHc.d.ts +17 -0
- package/dist/table-CuE0Aenj.js +2 -0
- package/dist/table-CuE0Aenj.js.map +1 -0
- package/dist/table-qIAtG7Y5.d.ts +33 -0
- package/dist/tabs-BgWxTTah.d.ts +21 -0
- package/dist/tabs-DK9-RHkP.js +2 -0
- package/dist/tabs-DK9-RHkP.js.map +1 -0
- package/dist/text-CKFZ9Xsj.d.ts +14 -0
- package/dist/text-Kg1xuinT.js +2 -0
- package/dist/text-Kg1xuinT.js.map +1 -0
- package/dist/textarea-C8zrf9Rz.js +2 -0
- package/dist/textarea-C8zrf9Rz.js.map +1 -0
- package/dist/textarea-Cr9_P-bV.d.ts +8 -0
- package/dist/theme-BwEhfTyl.d.ts +22 -0
- package/dist/theme-DZJ_cJYp.js +2 -0
- package/dist/theme-DZJ_cJYp.js.map +1 -0
- package/dist/timeline-BDY3YzeJ.d.ts +61 -0
- package/dist/timeline-pBm0t1tb.js +2 -0
- package/dist/timeline-pBm0t1tb.js.map +1 -0
- package/dist/toggle-DJJkcqDy.js +2 -0
- package/dist/toggle-DJJkcqDy.js.map +1 -0
- package/dist/toggle-group-C3iNDYqI.d.ts +16 -0
- package/dist/toggle-group-D0OIpZN-.js +2 -0
- package/dist/toggle-group-D0OIpZN-.js.map +1 -0
- package/dist/toggle-jc8s_Z3T.d.ts +15 -0
- package/dist/tooltip-BZjnEqw5.d.ts +21 -0
- package/dist/tooltip-CNUNWZvs.js +2 -0
- package/dist/tooltip-CNUNWZvs.js.map +1 -0
- package/dist/unstyled-button-C-Zs4Qv2.d.ts +10 -0
- package/dist/unstyled-button-lGbDJA55.js +2 -0
- package/dist/unstyled-button-lGbDJA55.js.map +1 -0
- package/dist/use-breakpoint-D6YACz8C.js +2 -0
- package/dist/use-breakpoint-D6YACz8C.js.map +1 -0
- package/dist/use-breakpoint-DDuQFekj.d.ts +8 -0
- package/dist/use-breakpoint-value-BDjKflDX.js +2 -0
- package/dist/use-breakpoint-value-BDjKflDX.js.map +1 -0
- package/dist/use-breakpoint-value-CRbHqGAu.d.ts +8 -0
- package/dist/use-disclosure-CNaFpYFQ.d.ts +22 -0
- package/dist/use-disclosure-Cr405eRD.js +2 -0
- package/dist/use-disclosure-Cr405eRD.js.map +1 -0
- package/dist/use-document-visibility-CoWjCswu.js +2 -0
- package/dist/use-document-visibility-CoWjCswu.js.map +1 -0
- package/dist/use-document-visibility-DIzUN4tB.d.ts +6 -0
- package/dist/use-idle-Bsi10VE9.d.ts +13 -0
- package/dist/use-idle-DgheJlxd.js +2 -0
- package/dist/use-idle-DgheJlxd.js.map +1 -0
- package/dist/use-interval-B1aNo3tA.js +2 -0
- package/dist/use-interval-B1aNo3tA.js.map +1 -0
- package/dist/use-interval-CJVmE_lC.d.ts +24 -0
- package/dist/use-local-storage-CJBqB1GC.js +2 -0
- package/dist/use-local-storage-CJBqB1GC.js.map +1 -0
- package/dist/use-local-storage-Cmq4PWJc.d.ts +16 -0
- package/dist/use-mask-DBvFShXA.js +2 -0
- package/dist/use-mask-DBvFShXA.js.map +1 -0
- package/dist/use-mask-DRJVVcdh.d.ts +8 -0
- package/dist/use-mobile-BYwiljVq.d.ts +6 -0
- package/dist/use-mobile-OMmp56u2.js +2 -0
- package/dist/use-mobile-OMmp56u2.js.map +1 -0
- package/dist/utils-DGsdoA5l.d.ts +8 -0
- package/dist/utils-DP9KtG7I.js +2 -0
- package/dist/utils-DP9KtG7I.js.map +1 -0
- package/dist/visibility-_3zV3l-A.d.ts +17 -0
- package/dist/visibility-twHwe9Xp.js +2 -0
- package/dist/visibility-twHwe9Xp.js.map +1 -0
- package/package.json +10 -8
- package/skills/uselets-ui/references/component-catalog.md +3 -0
- package/skills/uselets-ui/references/package-guide.md +1 -1
- package/dist/components/accordion.js.map +0 -1
- package/dist/components/alert-dialog.js.map +0 -1
- package/dist/components/alert.js.map +0 -1
- package/dist/components/anchor.js.map +0 -1
- package/dist/components/area-chart.js.map +0 -1
- package/dist/components/avatar.js.map +0 -1
- package/dist/components/badge.js.map +0 -1
- package/dist/components/bar-chart.js.map +0 -1
- package/dist/components/breadcrumb.js.map +0 -1
- package/dist/components/button-group.js.map +0 -1
- package/dist/components/button.js.map +0 -1
- package/dist/components/calendar.js.map +0 -1
- package/dist/components/card.js.map +0 -1
- package/dist/components/carousel.js.map +0 -1
- package/dist/components/center.js.map +0 -1
- package/dist/components/chart.js.map +0 -1
- package/dist/components/checkbox.js.map +0 -1
- package/dist/components/code.js.map +0 -1
- package/dist/components/collapsible.js.map +0 -1
- package/dist/components/combobox.js.map +0 -1
- package/dist/components/command.js.map +0 -1
- package/dist/components/container.js.map +0 -1
- package/dist/components/data-table.js.map +0 -1
- package/dist/components/date-range-picker.js.map +0 -1
- package/dist/components/dialog.js.map +0 -1
- package/dist/components/donut-chart.js.map +0 -1
- package/dist/components/drawer.js.map +0 -1
- package/dist/components/dropdown-menu.js.map +0 -1
- package/dist/components/dropzone.js.map +0 -1
- package/dist/components/empty.js.map +0 -1
- package/dist/components/field.js.map +0 -1
- package/dist/components/flex.js.map +0 -1
- package/dist/components/grid.js.map +0 -1
- package/dist/components/group.js.map +0 -1
- package/dist/components/heading.js.map +0 -1
- package/dist/components/hover-card.js.map +0 -1
- package/dist/components/input-group.js.map +0 -1
- package/dist/components/input-otp.js.map +0 -1
- package/dist/components/input.js.map +0 -1
- package/dist/components/kbd.js.map +0 -1
- package/dist/components/label.js.map +0 -1
- package/dist/components/list.js.map +0 -1
- package/dist/components/marker.js.map +0 -1
- package/dist/components/mask-input.js.map +0 -1
- package/dist/components/native-select.js.map +0 -1
- package/dist/components/navigation-menu.js.map +0 -1
- package/dist/components/number-field.js.map +0 -1
- package/dist/components/pagination.js.map +0 -1
- package/dist/components/phone-input.js.map +0 -1
- package/dist/components/pie-chart.js.map +0 -1
- package/dist/components/popover.js.map +0 -1
- package/dist/components/progress.js.map +0 -1
- package/dist/components/radio-group.js.map +0 -1
- package/dist/components/resizable.js.map +0 -1
- package/dist/components/ring-progress.js.map +0 -1
- package/dist/components/scroll-area.js.map +0 -1
- package/dist/components/select.js.map +0 -1
- package/dist/components/separator.js.map +0 -1
- package/dist/components/sidebar.js.map +0 -1
- package/dist/components/simple-grid.js.map +0 -1
- package/dist/components/skeleton.js.map +0 -1
- package/dist/components/slider.js.map +0 -1
- package/dist/components/sonner.js.map +0 -1
- package/dist/components/spinner.js.map +0 -1
- package/dist/components/stack.js.map +0 -1
- package/dist/components/stepper.js.map +0 -1
- package/dist/components/switch.js.map +0 -1
- package/dist/components/table.js.map +0 -1
- package/dist/components/tabs.js.map +0 -1
- package/dist/components/text.js.map +0 -1
- package/dist/components/textarea.js.map +0 -1
- package/dist/components/theme.js.map +0 -1
- package/dist/components/timeline.js.map +0 -1
- package/dist/components/toggle-group.js.map +0 -1
- package/dist/components/toggle.js.map +0 -1
- package/dist/components/tooltip.js.map +0 -1
- package/dist/components/unstyled-button.js.map +0 -1
- package/dist/components/visibility.js.map +0 -1
- package/dist/hooks/use-breakpoint-value.js.map +0 -1
- package/dist/hooks/use-breakpoint.js.map +0 -1
- package/dist/hooks/use-disclosure.js.map +0 -1
- package/dist/hooks/use-document-visibility.js.map +0 -1
- package/dist/hooks/use-idle.js.map +0 -1
- package/dist/hooks/use-interval.js.map +0 -1
- package/dist/hooks/use-local-storage.js.map +0 -1
- package/dist/hooks/use-mask.js.map +0 -1
- package/dist/hooks/use-mobile.js.map +0 -1
- package/dist/lib/badge.js.map +0 -1
- package/dist/lib/button.js.map +0 -1
- package/dist/lib/color.js.map +0 -1
- package/dist/lib/compose-refs.js.map +0 -1
- package/dist/lib/progress.js.map +0 -1
- package/dist/lib/utils.js.map +0 -1
- package/dist/magic-string.es-oADFB1hu.js +0 -15
- package/dist/magic-string.es-oADFB1hu.js.map +0 -1
- package/dist/utils-Cj3IZeiu.js +0 -37
- package/dist/utils-Cj3IZeiu.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./rolldown-runtime-Bdj-bS2b.js";import{t as e}from"./utils-DP9KtG7I.js";import{t}from"./button-oI3hbOgp.js";import{IconX as n}from"@tabler/icons-react";import{Dialog as r}from"radix-ui";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{cva as o}from"class-variance-authority";import*as s from"react";const c=o([`bg-background flex h-auto flex-col text-sm fixed z-50 outline-none duration-200`,`data-open:animate-in data-closed:animate-out`],{variants:{direction:{top:`inset-x-0 top-0 rounded-b-xl border-b data-closed:slide-out-to-top data-open:slide-in-from-top-10`,right:`inset-y-0 right-0 rounded-l-xl border-l data-closed:slide-out-to-right data-open:slide-in-from-right-10`,bottom:`inset-x-0 bottom-0 rounded-t-xl border-t data-closed:slide-out-to-bottom data-open:slide-in-from-bottom-10`,left:`inset-y-0 left-0 rounded-r-xl border-r data-closed:slide-out-to-left data-open:slide-in-from-left-10`},size:{sm:``,md:``,lg:``,xl:``,"2xl":``,"3xl":``,full:``}},compoundVariants:[{direction:[`left`,`right`],size:`sm`,className:`w-3/4 sm:max-w-sm`},{direction:[`left`,`right`],size:`md`,className:`w-4/5 sm:max-w-md`},{direction:[`left`,`right`],size:`lg`,className:`w-[90%] sm:max-w-lg`},{direction:[`left`,`right`],size:`xl`,className:`w-[90%] sm:max-w-195`},{direction:[`left`,`right`],size:`2xl`,className:`w-[90%] sm:max-w-240`},{direction:[`left`,`right`],size:`3xl`,className:`w-[90%] sm:max-w-300`},{direction:[`left`,`right`],size:`full`,className:`w-full`},{direction:`top`,size:`sm`,className:`mb-24 h-full max-h-96`},{direction:`top`,size:`md`,className:`mb-20 h-full max-h-112`},{direction:`top`,size:`lg`,className:`mb-12 h-full max-h-128`},{direction:`top`,size:`xl`,className:`mb-12 h-full max-h-195`},{direction:`top`,size:`2xl`,className:`mb-12 h-full max-h-240`},{direction:`top`,size:`3xl`,className:`mb-12 h-full max-h-300`},{direction:`top`,size:`full`,className:`mb-0 h-full`},{direction:`bottom`,size:`sm`,className:`mt-24 h-full max-h-96`},{direction:`bottom`,size:`md`,className:`mt-20 h-full max-h-112`},{direction:`bottom`,size:`lg`,className:`mt-12 h-full max-h-128`},{direction:`bottom`,size:`xl`,className:`mt-12 h-full max-h-195`},{direction:`bottom`,size:`2xl`,className:`mt-12 h-full max-h-240`},{direction:`bottom`,size:`3xl`,className:`mt-12 h-full max-h-300`},{direction:`bottom`,size:`full`,className:`mt-0 h-full`}],defaultVariants:{direction:`right`,size:`md`}}),l=s.createContext({size:`md`,direction:`right`,dismissible:!0});function Drawer({size:e=`md`,direction:t=`right`,dismissible:n=!0,...a}){let o=s.useMemo(()=>({size:e,direction:t,dismissible:n}),[e,t,n]);return i(l.Provider,{value:o,children:i(r.Root,{"data-slot":`drawer`,...a})})}function DrawerTrigger({...e}){return i(r.Trigger,{"data-slot":`drawer-trigger`,...e})}function DrawerPortal({...e}){return i(r.Portal,{"data-slot":`drawer-portal`,...e})}function DrawerClose({...e}){return i(r.Close,{"data-slot":`drawer-close`,...e})}function DrawerOverlay({className:t,...n}){return i(r.Overlay,{"data-slot":`drawer-overlay`,className:e(`bg-black/10 fixed inset-0 z-50`,`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0`,`supports-backdrop-filter:backdrop-blur-xs`,t),...n})}function DrawerContent({className:o,children:u,showCloseButton:d=!0,overlayProps:f,...p}){let{size:m,direction:h,dismissible:g}=s.useContext(l);return a(DrawerPortal,{children:[i(DrawerOverlay,{...f}),a(r.Content,{"data-slot":`drawer-content`,className:e(c({size:m,direction:h}),o),...p,onEscapeKeyDown:e=>{g||e.preventDefault(),p.onEscapeKeyDown?.(e)},onInteractOutside:e=>{g||e.preventDefault(),p.onInteractOutside?.(e)},children:[u,d&&i(DrawerClose,{asChild:!0,children:a(t,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[i(n,{}),i(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function DrawerHeader({className:t,...n}){let{direction:r}=s.useContext(l);return i(`div`,{"data-slot":`drawer-header`,className:e(`p-4 flex flex-col gap-0.5 md:gap-0.5`,(r===`top`||r===`bottom`)&&`text-center md:text-left`,t),...n})}function DrawerBody({className:t,...n}){return i(`div`,{"data-slot":`drawer-body`,className:e(`px-4 pb-4 flex-1 min-h-0 overflow-y-auto`,t),...n})}function DrawerFooter({className:t,...n}){return i(`div`,{"data-slot":`drawer-footer`,className:e(`gap-2 p-4 mt-auto flex flex-col sm:flex-row sm:justify-end`,t),...n})}function DrawerTitle({className:t,...n}){return i(r.Title,{"data-slot":`drawer-title`,className:e(`text-foreground text-base font-medium`,t),...n})}function DrawerDescription({className:t,...n}){return i(r.Description,{"data-slot":`drawer-description`,className:e(`text-muted-foreground text-sm`,t),...n})}export{DrawerDescription as a,DrawerOverlay as c,DrawerTrigger as d,DrawerContent as i,DrawerPortal as l,DrawerBody as n,DrawerFooter as o,DrawerClose as r,DrawerHeader as s,Drawer as t,DrawerTitle as u};
|
|
2
|
+
//# sourceMappingURL=drawer-BO4mP6y1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer-BO4mP6y1.js","names":["DrawerPrimitive"],"sources":["../src/components/drawer.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { IconX } from '@tabler/icons-react'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Dialog as DrawerPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\nimport { Button } from './button'\n\nconst drawerContentVariants = cva(\n [\n 'bg-background flex h-auto flex-col text-sm fixed z-50 outline-none duration-200',\n 'data-open:animate-in data-closed:animate-out'\n ],\n {\n variants: {\n direction: {\n top: 'inset-x-0 top-0 rounded-b-xl border-b data-closed:slide-out-to-top data-open:slide-in-from-top-10',\n right:\n 'inset-y-0 right-0 rounded-l-xl border-l data-closed:slide-out-to-right data-open:slide-in-from-right-10',\n bottom:\n 'inset-x-0 bottom-0 rounded-t-xl border-t data-closed:slide-out-to-bottom data-open:slide-in-from-bottom-10',\n left: 'inset-y-0 left-0 rounded-r-xl border-r data-closed:slide-out-to-left data-open:slide-in-from-left-10'\n },\n size: {\n sm: '',\n md: '',\n lg: '',\n xl: '',\n '2xl': '',\n '3xl': '',\n full: ''\n }\n },\n compoundVariants: [\n { direction: ['left', 'right'], size: 'sm', className: 'w-3/4 sm:max-w-sm' },\n { direction: ['left', 'right'], size: 'md', className: 'w-4/5 sm:max-w-md' },\n { direction: ['left', 'right'], size: 'lg', className: 'w-[90%] sm:max-w-lg' },\n { direction: ['left', 'right'], size: 'xl', className: 'w-[90%] sm:max-w-195' },\n { direction: ['left', 'right'], size: '2xl', className: 'w-[90%] sm:max-w-240' },\n { direction: ['left', 'right'], size: '3xl', className: 'w-[90%] sm:max-w-300' },\n { direction: ['left', 'right'], size: 'full', className: 'w-full' },\n { direction: 'top', size: 'sm', className: 'mb-24 h-full max-h-96' },\n { direction: 'top', size: 'md', className: 'mb-20 h-full max-h-112' },\n { direction: 'top', size: 'lg', className: 'mb-12 h-full max-h-128' },\n { direction: 'top', size: 'xl', className: 'mb-12 h-full max-h-195' },\n { direction: 'top', size: '2xl', className: 'mb-12 h-full max-h-240' },\n { direction: 'top', size: '3xl', className: 'mb-12 h-full max-h-300' },\n { direction: 'top', size: 'full', className: 'mb-0 h-full' },\n { direction: 'bottom', size: 'sm', className: 'mt-24 h-full max-h-96' },\n { direction: 'bottom', size: 'md', className: 'mt-20 h-full max-h-112' },\n { direction: 'bottom', size: 'lg', className: 'mt-12 h-full max-h-128' },\n { direction: 'bottom', size: 'xl', className: 'mt-12 h-full max-h-195' },\n { direction: 'bottom', size: '2xl', className: 'mt-12 h-full max-h-240' },\n { direction: 'bottom', size: '3xl', className: 'mt-12 h-full max-h-300' },\n { direction: 'bottom', size: 'full', className: 'mt-0 h-full' }\n ],\n defaultVariants: {\n direction: 'right',\n size: 'md'\n }\n }\n)\n\ntype DrawerDirection = NonNullable<VariantProps<typeof drawerContentVariants>['direction']>\ntype DrawerSize = NonNullable<VariantProps<typeof drawerContentVariants>['size']>\ntype DrawerContextValue = { size: DrawerSize; direction: DrawerDirection; dismissible: boolean }\nconst DrawerContext = React.createContext<DrawerContextValue>({ size: 'md', direction: 'right', dismissible: true })\n\nexport type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root> & {\n size?: DrawerSize\n direction?: DrawerDirection\n dismissible?: boolean\n}\nexport type DrawerTriggerProps = React.ComponentProps<typeof DrawerPrimitive.Trigger>\nexport type DrawerPortalProps = React.ComponentProps<typeof DrawerPrimitive.Portal>\nexport type DrawerCloseProps = React.ComponentProps<typeof DrawerPrimitive.Close>\nexport type DrawerOverlayProps = React.ComponentProps<typeof DrawerPrimitive.Overlay>\nexport type DrawerContentProps = React.ComponentProps<typeof DrawerPrimitive.Content> & {\n showCloseButton?: boolean\n overlayProps?: DrawerOverlayProps\n}\nexport type DrawerHeaderProps = React.ComponentProps<'div'>\nexport type DrawerBodyProps = React.ComponentProps<'div'>\nexport type DrawerFooterProps = React.ComponentProps<'div'>\nexport type DrawerTitleProps = React.ComponentProps<typeof DrawerPrimitive.Title>\nexport type DrawerDescriptionProps = React.ComponentProps<typeof DrawerPrimitive.Description>\n\nfunction Drawer({ size = 'md', direction = 'right', dismissible = true, ...props }: DrawerProps) {\n const contextValue = React.useMemo<DrawerContextValue>(\n () => ({ size, direction, dismissible }),\n [size, direction, dismissible]\n )\n\n return (\n <DrawerContext.Provider value={contextValue}>\n <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />\n </DrawerContext.Provider>\n )\n}\n\nfunction DrawerTrigger({ ...props }: DrawerTriggerProps) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />\n}\n\nfunction DrawerPortal({ ...props }: DrawerPortalProps) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />\n}\n\nfunction DrawerClose({ ...props }: DrawerCloseProps) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />\n}\n\nfunction DrawerOverlay({ className, ...props }: DrawerOverlayProps) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n 'bg-black/10 fixed inset-0 z-50',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0',\n 'supports-backdrop-filter:backdrop-blur-xs',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DrawerContent({ className, children, showCloseButton = true, overlayProps, ...props }: DrawerContentProps) {\n const { size, direction, dismissible } = React.useContext(DrawerContext)\n\n return (\n <DrawerPortal>\n <DrawerOverlay {...overlayProps} />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(drawerContentVariants({ size, direction }), className)}\n {...props}\n onEscapeKeyDown={(event) => {\n if (!dismissible) event.preventDefault()\n props.onEscapeKeyDown?.(event)\n }}\n onInteractOutside={(event) => {\n if (!dismissible) event.preventDefault()\n props.onInteractOutside?.(event)\n }}\n >\n {children}\n {showCloseButton && (\n <DrawerClose asChild>\n <Button variant=\"ghost\" className=\"absolute top-3 right-3\" size=\"icon-sm\">\n <IconX />\n <span className=\"sr-only\">Close</span>\n </Button>\n </DrawerClose>\n )}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n )\n}\n\nfunction DrawerHeader({ className, ...props }: DrawerHeaderProps) {\n const { direction } = React.useContext(DrawerContext)\n const isVertical = direction === 'top' || direction === 'bottom'\n\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn('p-4 flex flex-col gap-0.5 md:gap-0.5', isVertical && 'text-center md:text-left', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerBody({ className, ...props }: DrawerBodyProps) {\n return (\n <div data-slot=\"drawer-body\" className={cn('px-4 pb-4 flex-1 min-h-0 overflow-y-auto', className)} {...props} />\n )\n}\n\nfunction DrawerFooter({ className, ...props }: DrawerFooterProps) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn('gap-2 p-4 mt-auto flex flex-col sm:flex-row sm:justify-end', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerTitle({ className, ...props }: DrawerTitleProps) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn('text-foreground text-base font-medium', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerDescription({ className, ...props }: DrawerDescriptionProps) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n )\n}\n\nexport {\n Drawer,\n DrawerBody,\n DrawerClose,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerOverlay,\n DrawerPortal,\n DrawerTitle,\n DrawerTrigger\n}\n"],"mappings":"0TASA,MAAM,EAAwB,EAC5B,CACE,kFACA,8CACF,EACA,CACE,SAAU,CACR,UAAW,CACT,IAAK,oGACL,MACE,0GACF,OACE,6GACF,KAAM,sGACR,EACA,KAAM,CACJ,GAAI,GACJ,GAAI,GACJ,GAAI,GACJ,GAAI,GACJ,MAAO,GACP,MAAO,GACP,KAAM,EACR,CACF,EACA,iBAAkB,CAChB,CAAE,UAAW,CAAC,OAAQ,OAAO,EAAG,KAAM,KAAM,UAAW,mBAAoB,EAC3E,CAAE,UAAW,CAAC,OAAQ,OAAO,EAAG,KAAM,KAAM,UAAW,mBAAoB,EAC3E,CAAE,UAAW,CAAC,OAAQ,OAAO,EAAG,KAAM,KAAM,UAAW,qBAAsB,EAC7E,CAAE,UAAW,CAAC,OAAQ,OAAO,EAAG,KAAM,KAAM,UAAW,sBAAuB,EAC9E,CAAE,UAAW,CAAC,OAAQ,OAAO,EAAG,KAAM,MAAO,UAAW,sBAAuB,EAC/E,CAAE,UAAW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Q,CACb,CAAA,CAAA,CAAA,CAAA,CAElB,CAEA,SAAS,aAAa,CAAE,YAAW,GAAG,GAA4B,CAChE,GAAM,CAAE,aAAc,EAAM,WAAW,CAAa,EAGpD,OACE,EAAC,MAAD,CACE,YAAU,gBACV,UAAW,EAAG,wCALC,IAAc,OAAS,IAAc,WAKgB,2BAA4B,CAAS,EACzG,GAAI,CACL,CAAA,CAEL,CAEA,SAAS,WAAW,CAAE,YAAW,GAAG,GAA0B,CAC5D,OACE,EAAC,MAAD,CAAK,YAAU,cAAc,UAAW,EAAG,2CAA4C,CAAS,EAAG,GAAI,CAAQ,CAAA,CAEnH,CAEA,SAAS,aAAa,CAAE,YAAW,GAAG,GAA4B,CAChE,OACE,EAAC,MAAD,CACE,YAAU,gBACV,UAAW,EAAG,6DAA8D,CAAS,EACrF,GAAI,CACL,CAAA,CAEL,CAEA,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OACE,EAACA,EAAgB,MAAjB,CACE,YAAU,eACV,UAAW,EAAG,wCAAyC,CAAS,EAChE,GAAI,CACL,CAAA,CAEL,CAEA,SAAS,kBAAkB,CAAE,YAAW,GAAG,GAAiC,CAC1E,OACE,EAACA,EAAgB,YAAjB,CACE,YAAU,qBACV,UAAW,EAAG,gCAAiC,CAAS,EACxD,GAAI,CACL,CAAA,CAEL"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { n as __name } from "./rolldown-runtime-Bdj-bS2b.js";
|
|
2
|
+
import { Dialog } from "radix-ui";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
//#region src/components/drawer.d.ts
|
|
6
|
+
declare const drawerContentVariants: (props?: ({
|
|
7
|
+
direction?: "bottom" | "left" | "right" | "top" | null | undefined;
|
|
8
|
+
size?: "2xl" | "3xl" | "full" | "lg" | "md" | "sm" | "xl" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
type DrawerDirection = NonNullable<VariantProps<typeof drawerContentVariants>['direction']>;
|
|
11
|
+
type DrawerSize = NonNullable<VariantProps<typeof drawerContentVariants>['size']>;
|
|
12
|
+
type DrawerProps = React.ComponentProps<typeof Dialog.Root> & {
|
|
13
|
+
size?: DrawerSize;
|
|
14
|
+
direction?: DrawerDirection;
|
|
15
|
+
dismissible?: boolean;
|
|
16
|
+
};
|
|
17
|
+
type DrawerTriggerProps = React.ComponentProps<typeof Dialog.Trigger>;
|
|
18
|
+
type DrawerPortalProps = React.ComponentProps<typeof Dialog.Portal>;
|
|
19
|
+
type DrawerCloseProps = React.ComponentProps<typeof Dialog.Close>;
|
|
20
|
+
type DrawerOverlayProps = React.ComponentProps<typeof Dialog.Overlay>;
|
|
21
|
+
type DrawerContentProps = React.ComponentProps<typeof Dialog.Content> & {
|
|
22
|
+
showCloseButton?: boolean;
|
|
23
|
+
overlayProps?: DrawerOverlayProps;
|
|
24
|
+
};
|
|
25
|
+
type DrawerHeaderProps = React.ComponentProps<'div'>;
|
|
26
|
+
type DrawerBodyProps = React.ComponentProps<'div'>;
|
|
27
|
+
type DrawerFooterProps = React.ComponentProps<'div'>;
|
|
28
|
+
type DrawerTitleProps = React.ComponentProps<typeof Dialog.Title>;
|
|
29
|
+
type DrawerDescriptionProps = React.ComponentProps<typeof Dialog.Description>;
|
|
30
|
+
declare function Drawer({ size, direction, dismissible, ...props }: DrawerProps): React.JSX.Element;
|
|
31
|
+
declare function DrawerTrigger({ ...props }: DrawerTriggerProps): React.JSX.Element;
|
|
32
|
+
declare function DrawerPortal({ ...props }: DrawerPortalProps): React.JSX.Element;
|
|
33
|
+
declare function DrawerClose({ ...props }: DrawerCloseProps): React.JSX.Element;
|
|
34
|
+
declare function DrawerOverlay({ className, ...props }: DrawerOverlayProps): React.JSX.Element;
|
|
35
|
+
declare function DrawerContent({ className, children, showCloseButton, overlayProps, ...props }: DrawerContentProps): React.JSX.Element;
|
|
36
|
+
declare function DrawerHeader({ className, ...props }: DrawerHeaderProps): React.JSX.Element;
|
|
37
|
+
declare function DrawerBody({ className, ...props }: DrawerBodyProps): React.JSX.Element;
|
|
38
|
+
declare function DrawerFooter({ className, ...props }: DrawerFooterProps): React.JSX.Element;
|
|
39
|
+
declare function DrawerTitle({ className, ...props }: DrawerTitleProps): React.JSX.Element;
|
|
40
|
+
declare function DrawerDescription({ className, ...props }: DrawerDescriptionProps): React.JSX.Element;
|
|
41
|
+
//#endregion
|
|
42
|
+
export { DrawerTriggerProps as S, DrawerPortalProps as _, DrawerCloseProps as a, DrawerTitleProps as b, DrawerDescription as c, DrawerFooterProps as d, DrawerHeader as f, DrawerPortal as g, DrawerOverlayProps as h, DrawerClose as i, DrawerDescriptionProps as l, DrawerOverlay as m, DrawerBody as n, DrawerContent as o, DrawerHeaderProps as p, DrawerBodyProps as r, DrawerContentProps as s, Drawer as t, DrawerFooter as u, DrawerProps as v, DrawerTrigger as x, DrawerTitle as y };
|
|
43
|
+
//# sourceMappingURL=drawer-DUfJzrKE.d.ts.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { n as __name } from "./rolldown-runtime-Bdj-bS2b.js";
|
|
2
|
+
import { DropdownMenu } from "radix-ui";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
//#region src/components/dropdown-menu.d.ts
|
|
5
|
+
type DropdownMenuProps = React.ComponentProps<typeof DropdownMenu.Root>;
|
|
6
|
+
type DropdownMenuPortalProps = React.ComponentProps<typeof DropdownMenu.Portal>;
|
|
7
|
+
type DropdownMenuTriggerProps = React.ComponentProps<typeof DropdownMenu.Trigger>;
|
|
8
|
+
type DropdownMenuContentProps = React.ComponentProps<typeof DropdownMenu.Content>;
|
|
9
|
+
type DropdownMenuGroupProps = React.ComponentProps<typeof DropdownMenu.Group>;
|
|
10
|
+
type DropdownMenuItemProps = React.ComponentProps<typeof DropdownMenu.Item> & {
|
|
11
|
+
inset?: boolean;
|
|
12
|
+
variant?: 'default' | 'destructive';
|
|
13
|
+
};
|
|
14
|
+
type DropdownMenuCheckboxItemProps = React.ComponentProps<typeof DropdownMenu.CheckboxItem> & {
|
|
15
|
+
inset?: boolean;
|
|
16
|
+
};
|
|
17
|
+
type DropdownMenuRadioGroupProps = React.ComponentProps<typeof DropdownMenu.RadioGroup>;
|
|
18
|
+
type DropdownMenuRadioItemProps = React.ComponentProps<typeof DropdownMenu.RadioItem> & {
|
|
19
|
+
inset?: boolean;
|
|
20
|
+
};
|
|
21
|
+
type DropdownMenuLabelProps = React.ComponentProps<typeof DropdownMenu.Label> & {
|
|
22
|
+
inset?: boolean;
|
|
23
|
+
};
|
|
24
|
+
type DropdownMenuSeparatorProps = React.ComponentProps<typeof DropdownMenu.Separator>;
|
|
25
|
+
type DropdownMenuShortcutProps = React.ComponentProps<'span'>;
|
|
26
|
+
type DropdownMenuSubProps = React.ComponentProps<typeof DropdownMenu.Sub>;
|
|
27
|
+
type DropdownMenuSubTriggerProps = React.ComponentProps<typeof DropdownMenu.SubTrigger> & {
|
|
28
|
+
inset?: boolean;
|
|
29
|
+
};
|
|
30
|
+
type DropdownMenuSubContentProps = React.ComponentProps<typeof DropdownMenu.SubContent>;
|
|
31
|
+
declare function DropdownMenu$1({ ...props }: DropdownMenuProps): React.JSX.Element;
|
|
32
|
+
declare function DropdownMenuPortal({ ...props }: DropdownMenuPortalProps): React.JSX.Element;
|
|
33
|
+
declare function DropdownMenuTrigger({ ...props }: DropdownMenuTriggerProps): React.JSX.Element;
|
|
34
|
+
declare function DropdownMenuContent({ className, align, sideOffset, ...props }: DropdownMenuContentProps): React.JSX.Element;
|
|
35
|
+
declare function DropdownMenuGroup({ ...props }: DropdownMenuGroupProps): React.JSX.Element;
|
|
36
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: DropdownMenuItemProps): React.JSX.Element;
|
|
37
|
+
declare function DropdownMenuCheckboxItem({ className, children, inset, ...props }: DropdownMenuCheckboxItemProps): React.JSX.Element;
|
|
38
|
+
declare function DropdownMenuRadioGroup({ ...props }: DropdownMenuRadioGroupProps): React.JSX.Element;
|
|
39
|
+
declare function DropdownMenuRadioItem({ className, children, inset, ...props }: DropdownMenuRadioItemProps): React.JSX.Element;
|
|
40
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: DropdownMenuLabelProps): React.JSX.Element;
|
|
41
|
+
declare function DropdownMenuSeparator({ className, ...props }: DropdownMenuSeparatorProps): React.JSX.Element;
|
|
42
|
+
declare function DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps): React.JSX.Element;
|
|
43
|
+
declare function DropdownMenuSub({ ...props }: DropdownMenuSubProps): React.JSX.Element;
|
|
44
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: DropdownMenuSubTriggerProps): React.JSX.Element;
|
|
45
|
+
declare function DropdownMenuSubContent({ className, ...props }: DropdownMenuSubContentProps): React.JSX.Element;
|
|
46
|
+
//#endregion
|
|
47
|
+
export { DropdownMenuTriggerProps as A, DropdownMenuSub as C, DropdownMenuSubTrigger as D, DropdownMenuSubProps as E, DropdownMenuSubTriggerProps as O, DropdownMenuShortcutProps as S, DropdownMenuSubContentProps as T, DropdownMenuRadioItem as _, DropdownMenuContentProps as a, DropdownMenuSeparatorProps as b, DropdownMenuItem as c, DropdownMenuLabelProps as d, DropdownMenuPortal as f, DropdownMenuRadioGroupProps as g, DropdownMenuRadioGroup as h, DropdownMenuContent as i, DropdownMenuTrigger as k, DropdownMenuItemProps as l, DropdownMenuProps as m, DropdownMenuCheckboxItem as n, DropdownMenuGroup as o, DropdownMenuPortalProps as p, DropdownMenuCheckboxItemProps as r, DropdownMenuGroupProps as s, DropdownMenu$1 as t, DropdownMenuLabel as u, DropdownMenuRadioItemProps as v, DropdownMenuSubContent as w, DropdownMenuShortcut as x, DropdownMenuSeparator as y };
|
|
48
|
+
//# sourceMappingURL=dropdown-menu-CVDIf0Rd.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-Bdj-bS2b.js";import{t}from"./utils-DP9KtG7I.js";import{IconCheck as n,IconChevronRight as r}from"@tabler/icons-react";import{DropdownMenu as i}from"radix-ui";import{jsx as a,jsxs as o}from"react/jsx-runtime";function DropdownMenu$1({...e}){return a(i.Root,{"data-slot":`dropdown-menu`,...e})}e(DropdownMenu$1,`DropdownMenu`);function DropdownMenuPortal({...e}){return a(i.Portal,{"data-slot":`dropdown-menu-portal`,...e})}function DropdownMenuTrigger({...e}){return a(i.Trigger,{"data-slot":`dropdown-menu-trigger`,...e})}function DropdownMenuContent({className:e,align:n=`start`,sideOffset:r=4,...o}){return a(DropdownMenuPortal,{children:a(i.Content,{"data-slot":`dropdown-menu-content`,align:n,sideOffset:r,className:t(`relative z-50 w-(--radix-dropdown-menu-trigger-width) min-w-32 max-h-(--radix-dropdown-menu-content-available-height)`,`origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg p-1`,`bg-popover/70 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100`,`data-[state=closed]:overflow-hidden`,`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95`,`data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,`before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit]`,`before:backdrop-blur-2xl before:backdrop-saturate-150`,`**:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10`,`**:data-[slot$=-separator]:bg-foreground/5`,`**:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10!`,`**:data-[variant=destructive]:focus:bg-destructive/10! dark:**:data-[variant=destructive]:focus:bg-destructive/20!`,`**:data-[variant=destructive]:text-destructive! **:data-[variant=destructive]:**:text-destructive!`,`animate-none!`,e),...o})})}function DropdownMenuGroup({...e}){return a(i.Group,{"data-slot":`dropdown-menu-group`,...e})}function DropdownMenuItem({className:e,inset:n,variant:r=`default`,...o}){return a(i.Item,{"data-slot":`dropdown-menu-item`,"data-inset":n,"data-variant":r,className:t(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm`,`select-none outline-hidden`,`focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground`,`data-inset:pl-7`,`data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive`,`dark:data-[variant=destructive]:focus:bg-destructive/20`,`data-disabled:pointer-events-none data-disabled:opacity-50`,`[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`data-[variant=destructive]:*:[svg]:text-destructive`,e),...o})}function DropdownMenuCheckboxItem({className:e,children:r,inset:s,...c}){return o(i.CheckboxItem,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":s,className:t(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm`,`select-none outline-hidden`,`focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground`,`data-inset:pl-7`,`data-disabled:pointer-events-none data-disabled:opacity-50`,`[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...c,children:[a(`span`,{"data-slot":`dropdown-menu-checkbox-item-indicator`,className:`pointer-events-none absolute right-2 flex items-center justify-center`,children:a(i.ItemIndicator,{children:a(n,{})})}),r]})}function DropdownMenuRadioGroup({...e}){return a(i.RadioGroup,{"data-slot":`dropdown-menu-radio-group`,...e})}function DropdownMenuRadioItem({className:e,children:r,inset:s,...c}){return o(i.RadioItem,{"data-slot":`dropdown-menu-radio-item`,"data-inset":s,className:t(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm`,`select-none outline-hidden`,`focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground`,`data-inset:pl-7`,`data-disabled:pointer-events-none data-disabled:opacity-50`,`[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...c,children:[a(`span`,{"data-slot":`dropdown-menu-radio-item-indicator`,className:`pointer-events-none absolute right-2 flex items-center justify-center`,children:a(i.ItemIndicator,{children:a(n,{})})}),r]})}function DropdownMenuLabel({className:e,inset:n,...r}){return a(i.Label,{"data-slot":`dropdown-menu-label`,"data-inset":n,className:t(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,e),...r})}function DropdownMenuSeparator({className:e,...n}){return a(i.Separator,{"data-slot":`dropdown-menu-separator`,className:t(`bg-border -mx-1 my-1 h-px`,e),...n})}function DropdownMenuShortcut({className:e,...n}){return a(`span`,{"data-slot":`dropdown-menu-shortcut`,className:t(`ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground`,e),...n})}function DropdownMenuSub({...e}){return a(i.Sub,{"data-slot":`dropdown-menu-sub`,...e})}function DropdownMenuSubTrigger({className:e,inset:n,children:s,...c}){return o(i.SubTrigger,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":n,className:t(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm`,`select-none outline-hidden`,`focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground`,`data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground`,`[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...c,children:[s,a(r,{className:`ml-auto`})]})}function DropdownMenuSubContent({className:e,...n}){return a(i.SubContent,{"data-slot":`dropdown-menu-sub-content`,className:t(`relative z-50 min-w-24 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-lg p-1`,`bg-popover/70 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100`,`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95`,`data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,`before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit]`,`before:backdrop-blur-2xl before:backdrop-saturate-150`,`**:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10`,`**:data-[slot$=-separator]:bg-foreground/5`,`**:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10!`,`**:data-[variant=destructive]:focus:bg-destructive/10! dark:**:data-[variant=destructive]:focus:bg-destructive/20!`,`**:data-[variant=destructive]:text-destructive! **:data-[variant=destructive]:**:text-destructive!`,`animate-none!`,e),...n})}export{DropdownMenuItem as a,DropdownMenuRadioGroup as c,DropdownMenuShortcut as d,DropdownMenuSub as f,DropdownMenuTrigger as h,DropdownMenuGroup as i,DropdownMenuRadioItem as l,DropdownMenuSubTrigger as m,DropdownMenuCheckboxItem as n,DropdownMenuLabel as o,DropdownMenuSubContent as p,DropdownMenuContent as r,DropdownMenuPortal as s,DropdownMenu$1 as t,DropdownMenuSeparator as u};
|
|
2
|
+
//# sourceMappingURL=dropdown-menu-zRuQQS5S.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-menu-zRuQQS5S.js","names":["DropdownMenu","DropdownMenuPrimitive"],"sources":["../src/components/dropdown-menu.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { IconCheck, IconChevronRight } from '@tabler/icons-react'\nimport { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nexport type DropdownMenuProps = React.ComponentProps<typeof DropdownMenuPrimitive.Root>\n\nexport type DropdownMenuPortalProps = React.ComponentProps<typeof DropdownMenuPrimitive.Portal>\n\nexport type DropdownMenuTriggerProps = React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>\n\nexport type DropdownMenuContentProps = React.ComponentProps<typeof DropdownMenuPrimitive.Content>\n\nexport type DropdownMenuGroupProps = React.ComponentProps<typeof DropdownMenuPrimitive.Group>\n\nexport type DropdownMenuItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n variant?: 'default' | 'destructive'\n}\n\nexport type DropdownMenuCheckboxItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem> & {\n inset?: boolean\n}\n\nexport type DropdownMenuRadioGroupProps = React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>\n\nexport type DropdownMenuRadioItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {\n inset?: boolean\n}\n\nexport type DropdownMenuLabelProps = React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n}\n\nexport type DropdownMenuSeparatorProps = React.ComponentProps<typeof DropdownMenuPrimitive.Separator>\n\nexport type DropdownMenuShortcutProps = React.ComponentProps<'span'>\n\nexport type DropdownMenuSubProps = React.ComponentProps<typeof DropdownMenuPrimitive.Sub>\n\nexport type DropdownMenuSubTriggerProps = React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n}\n\nexport type DropdownMenuSubContentProps = React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>\n\nfunction DropdownMenu({ ...props }: DropdownMenuProps) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />\n}\n\nfunction DropdownMenuPortal({ ...props }: DropdownMenuPortalProps) {\n return <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />\n}\n\nfunction DropdownMenuTrigger({ ...props }: DropdownMenuTriggerProps) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />\n}\n\nfunction DropdownMenuContent({ className, align = 'start', sideOffset = 4, ...props }: DropdownMenuContentProps) {\n return (\n <DropdownMenuPortal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'relative z-50 w-(--radix-dropdown-menu-trigger-width) min-w-32 max-h-(--radix-dropdown-menu-content-available-height)',\n 'origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg p-1',\n 'bg-popover/70 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100',\n 'data-[state=closed]:overflow-hidden',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n 'before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit]',\n 'before:backdrop-blur-2xl before:backdrop-saturate-150',\n '**:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10',\n '**:data-[slot$=-separator]:bg-foreground/5',\n '**:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10!',\n '**:data-[variant=destructive]:focus:bg-destructive/10! dark:**:data-[variant=destructive]:focus:bg-destructive/20!',\n '**:data-[variant=destructive]:text-destructive! **:data-[variant=destructive]:**:text-destructive!',\n 'animate-none!',\n className\n )}\n {...props}\n />\n </DropdownMenuPortal>\n )\n}\n\nfunction DropdownMenuGroup({ ...props }: DropdownMenuGroupProps) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />\n}\n\nfunction DropdownMenuItem({ className, inset, variant = 'default', ...props }: DropdownMenuItemProps) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n 'group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm',\n 'select-none outline-hidden',\n 'focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground',\n 'data-inset:pl-7',\n 'data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive',\n 'dark:data-[variant=destructive]:focus:bg-destructive/20',\n 'data-disabled:pointer-events-none data-disabled:opacity-50',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n 'data-[variant=destructive]:*:[svg]:text-destructive',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuCheckboxItem({ className, children, inset, ...props }: DropdownMenuCheckboxItemProps) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n data-inset={inset}\n className={cn(\n 'relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm',\n 'select-none outline-hidden',\n 'focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground',\n 'data-inset:pl-7',\n 'data-disabled:pointer-events-none data-disabled:opacity-50',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span\n data-slot=\"dropdown-menu-checkbox-item-indicator\"\n className=\"pointer-events-none absolute right-2 flex items-center justify-center\"\n >\n <DropdownMenuPrimitive.ItemIndicator>\n <IconCheck />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n )\n}\n\nfunction DropdownMenuRadioGroup({ ...props }: DropdownMenuRadioGroupProps) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />\n}\n\nfunction DropdownMenuRadioItem({ className, children, inset, ...props }: DropdownMenuRadioItemProps) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n data-inset={inset}\n className={cn(\n 'relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm',\n 'select-none outline-hidden',\n 'focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground',\n 'data-inset:pl-7',\n 'data-disabled:pointer-events-none data-disabled:opacity-50',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span\n data-slot=\"dropdown-menu-radio-item-indicator\"\n className=\"pointer-events-none absolute right-2 flex items-center justify-center\"\n >\n <DropdownMenuPrimitive.ItemIndicator>\n <IconCheck />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n )\n}\n\nfunction DropdownMenuLabel({ className, inset, ...props }: DropdownMenuLabelProps) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn('px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7', className)}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuSeparator({ className, ...props }: DropdownMenuSeparatorProps) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn('bg-border -mx-1 my-1 h-px', className)}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\n 'ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuSub({ ...props }: DropdownMenuSubProps) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />\n}\n\nfunction DropdownMenuSubTrigger({ className, inset, children, ...props }: DropdownMenuSubTriggerProps) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n 'flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm',\n 'select-none outline-hidden',\n 'focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground',\n 'data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <IconChevronRight className=\"ml-auto\" />\n </DropdownMenuPrimitive.SubTrigger>\n )\n}\n\nfunction DropdownMenuSubContent({ className, ...props }: DropdownMenuSubContentProps) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n 'relative z-50 min-w-24 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-lg p-1',\n 'bg-popover/70 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n 'before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit]',\n 'before:backdrop-blur-2xl before:backdrop-saturate-150',\n '**:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10',\n '**:data-[slot$=-separator]:bg-foreground/5',\n '**:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10!',\n '**:data-[variant=destructive]:focus:bg-destructive/10! dark:**:data-[variant=destructive]:focus:bg-destructive/20!',\n '**:data-[variant=destructive]:text-destructive! **:data-[variant=destructive]:**:text-destructive!',\n 'animate-none!',\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger\n}\n"],"mappings":"sPAgDA,SAASA,eAAa,CAAE,GAAG,GAA4B,CACrD,OAAO,EAACC,EAAsB,KAAvB,CAA4B,YAAU,gBAAgB,GAAI,CAAQ,CAAA,CAC3E,kCAEA,SAAS,mBAAmB,CAAE,GAAG,GAAkC,CACjE,OAAO,EAACA,EAAsB,OAAvB,CAA8B,YAAU,uBAAuB,GAAI,CAAQ,CAAA,CACpF,CAEA,SAAS,oBAAoB,CAAE,GAAG,GAAmC,CACnE,OAAO,EAACA,EAAsB,QAAvB,CAA+B,YAAU,wBAAwB,GAAI,CAAQ,CAAA,CACtF,CAEA,SAAS,oBAAoB,CAAE,YAAW,QAAQ,QAAS,aAAa,EAAG,GAAG,GAAmC,CAC/G,OACE,EAAC,mBAAD,CAAA,SACE,EAACA,EAAsB,QAAvB,CACE,YAAU,wBACH,QACK,aACZ,UAAW,EACT,wHACA,2GACA,yFACA,sCACA,uIACA,8JACA,iGACA,wDACA,uGACA,6CACA,2GACA,qHACA,qGACA,gBACA,CACF,EACA,GAAI,CACL,CAAA,CACiB,CAAA,CAExB,CAEA,SAAS,kBAAkB,CAAE,GAAG,GAAiC,CAC/D,OAAO,EAACA,EAAsB,MAAvB,CAA6B,YAAU,sBAAsB,GAAI,CAAQ,CAAA,CAClF,CAEA,SAAS,iBAAiB,CAAE,YAAW,QAAO,UAAU,UAAW,GAAG,GAAgC,CACpG,OACE,EAACA,EAAsB,KAAvB,CACE,YAAU,qBACV,aAAY,EACZ,eAAc,EACd,UAAW,EACT,4GACA,6BACA,8GACA,kBACA,mJACA,0DACA,6DACA,oFACA,sDACA,CACF,EACA,GAAI,CACL,CAAA,CAEL,CAEA,SAAS,yBAAyB,CAAE,YAAW,WAAU,QAAO,GAAG,GAAwC,CACzG,OAC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CAC3D,OAAO,EAACA,EAAsB,IAAvB,CAA2B,YAAU,oBAAoB,GAAI,CAAQ,CAAA,CAC9E,CAEA,SAAS,uBAAuB,CAAE,YAAW,QAAO,WAAU,GAAG,GAAsC,CACrG,OACE,EAACA,EAAsB,WAAvB,CACE,YAAU,4BACV,aAAY,EACZ,UAAW,EACT,0EACA,6BACA,8GACA,uEACA,oFACA,CACF,EACA,GAAI,EAXN,SAAA,CAaG,EACD,EAAC,EAAD,CAAkB,UAAU,SAAW,CAAA,CACP,GAEtC,CAEA,SAAS,uBAAuB,CAAE,YAAW,GAAG,GAAsC,CACpF,OACE,EAACA,EAAsB,WAAvB,CACE,YAAU,4BACV,UAAW,EACT,gHACA,yFACA,uIACA,8JACA,iGACA,wDACA,uGACA,6CACA,2GACA,qHACA,qGACA,gBACA,CACF,EACA,GAAI,CACL,CAAA,CAEL"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { n as __name } from "./rolldown-runtime-Bdj-bS2b.js";
|
|
2
|
+
import { n as ButtonProps } from "./button-BNGy28pv.js";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Accept, ErrorCode, FileError, useDropzone } from "react-dropzone";
|
|
5
|
+
//#region src/components/dropzone.d.ts
|
|
6
|
+
type DropzoneUploadResult<TUploadResult, TUploadError> = {
|
|
7
|
+
status: 'error';
|
|
8
|
+
error: TUploadError;
|
|
9
|
+
} | {
|
|
10
|
+
status: 'success';
|
|
11
|
+
result: TUploadResult;
|
|
12
|
+
};
|
|
13
|
+
type DropzoneFileStatus<TUploadResult, TUploadError> = {
|
|
14
|
+
id: string;
|
|
15
|
+
fileName: string;
|
|
16
|
+
file: File;
|
|
17
|
+
tries: number;
|
|
18
|
+
} & ({
|
|
19
|
+
status: 'pending';
|
|
20
|
+
error?: undefined;
|
|
21
|
+
message?: undefined;
|
|
22
|
+
result?: undefined;
|
|
23
|
+
} | {
|
|
24
|
+
status: 'error';
|
|
25
|
+
error: TUploadError;
|
|
26
|
+
message?: string;
|
|
27
|
+
result?: undefined;
|
|
28
|
+
} | {
|
|
29
|
+
status: 'success';
|
|
30
|
+
result: TUploadResult;
|
|
31
|
+
error?: undefined;
|
|
32
|
+
message?: undefined;
|
|
33
|
+
});
|
|
34
|
+
type FileStatus<TUploadResult, TUploadError> = DropzoneFileStatus<TUploadResult, TUploadError>;
|
|
35
|
+
type DropzoneValidation = {
|
|
36
|
+
accept?: Accept;
|
|
37
|
+
minSize?: number;
|
|
38
|
+
maxSize?: number;
|
|
39
|
+
maxFiles?: number;
|
|
40
|
+
};
|
|
41
|
+
type UseDropzoneProps<TUploadResult, TUploadError = string> = {
|
|
42
|
+
onDropFile: (file: File) => Promise<DropzoneUploadResult<TUploadResult, TUploadError>>;
|
|
43
|
+
onRemoveFile?: (id: string) => void | Promise<void>;
|
|
44
|
+
onFileUploaded?: (result: TUploadResult) => void;
|
|
45
|
+
onFileUploadError?: (error: TUploadError) => void;
|
|
46
|
+
onAllUploaded?: () => void;
|
|
47
|
+
onRootError?: (error: string | undefined) => void;
|
|
48
|
+
shapeUploadError?: (error: TUploadError) => string | undefined;
|
|
49
|
+
maxRetryCount?: number;
|
|
50
|
+
autoRetry?: boolean;
|
|
51
|
+
validation?: DropzoneValidation;
|
|
52
|
+
shiftOnMaxFiles?: boolean;
|
|
53
|
+
};
|
|
54
|
+
interface UseDropzoneReturn<TUploadResult, TUploadError> {
|
|
55
|
+
getRootProps: ReturnType<typeof useDropzone>['getRootProps'];
|
|
56
|
+
getInputProps: ReturnType<typeof useDropzone>['getInputProps'];
|
|
57
|
+
open: () => void;
|
|
58
|
+
onRemoveFile: (id: string) => Promise<void>;
|
|
59
|
+
onRetry: (id: string) => Promise<void>;
|
|
60
|
+
canRetry: (id: string) => boolean;
|
|
61
|
+
fileStatuses: DropzoneFileStatus<TUploadResult, TUploadError>[];
|
|
62
|
+
isInvalid: boolean;
|
|
63
|
+
isDragActive: boolean;
|
|
64
|
+
rootError: string | undefined;
|
|
65
|
+
inputId: string;
|
|
66
|
+
rootMessageId: string;
|
|
67
|
+
rootDescriptionId: string;
|
|
68
|
+
getFileMessageId: (id: string) => string;
|
|
69
|
+
}
|
|
70
|
+
type DropzoneProps<TUploadResult, TUploadError> = React.PropsWithChildren<UseDropzoneReturn<TUploadResult, TUploadError>>;
|
|
71
|
+
type DropzoneAreaProps = React.ComponentProps<'div'>;
|
|
72
|
+
type DropzoneDescriptionProps = React.ComponentProps<'p'>;
|
|
73
|
+
type DropzoneFileListProps = React.ComponentProps<'ol'>;
|
|
74
|
+
type DropzoneFileListItemProps<TUploadResult, TUploadError> = React.ComponentProps<'li'> & {
|
|
75
|
+
file: DropzoneFileStatus<TUploadResult, TUploadError>;
|
|
76
|
+
};
|
|
77
|
+
type DropzoneFileMessageProps = React.ComponentProps<'p'>;
|
|
78
|
+
type DropzoneMessageProps = React.ComponentProps<'p'>;
|
|
79
|
+
type DropzoneRemoveFileProps = ButtonProps;
|
|
80
|
+
type DropzoneRetryFileProps = ButtonProps;
|
|
81
|
+
type DropzoneTriggerProps = ButtonProps;
|
|
82
|
+
type InfiniteProgressProps = React.ComponentProps<'div'> & {
|
|
83
|
+
status: 'pending' | 'success' | 'error';
|
|
84
|
+
};
|
|
85
|
+
declare function useDropzone$1<TUploadResult, TUploadError = string>(props: UseDropzoneProps<TUploadResult, TUploadError>): UseDropzoneReturn<TUploadResult, TUploadError>;
|
|
86
|
+
declare function Dropzone<TUploadResult, TUploadError>({ children, ...dropzone }: DropzoneProps<TUploadResult, TUploadError>): React.JSX.Element;
|
|
87
|
+
declare namespace Dropzone {
|
|
88
|
+
var displayName: string;
|
|
89
|
+
}
|
|
90
|
+
declare const DropzoneArea: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
91
|
+
declare const DropzoneDescription: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
92
|
+
declare const DropzoneFileList: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "ref"> & React.RefAttributes<HTMLOListElement>>;
|
|
93
|
+
declare const DropzoneFileListItem: React.ForwardRefExoticComponent<Omit<DropzoneFileListItemProps<unknown, unknown>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
94
|
+
declare const DropzoneFileMessage: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
95
|
+
declare const DropzoneMessage: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
96
|
+
declare const DropzoneRemoveFile: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
97
|
+
declare const DropzoneRetryFile: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
98
|
+
declare const DropzoneTrigger: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
99
|
+
declare const InfiniteProgress: React.ForwardRefExoticComponent<Omit<InfiniteProgressProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
100
|
+
//#endregion
|
|
101
|
+
export { UseDropzoneReturn as A, DropzoneValidation as C, InfiniteProgress as D, FileStatus as E, InfiniteProgressProps as O, DropzoneUploadResult as S, FileError as T, DropzoneRemoveFileProps as _, DropzoneDescriptionProps as a, DropzoneTrigger as b, DropzoneFileListItemProps as c, DropzoneFileMessageProps as d, DropzoneFileStatus as f, DropzoneRemoveFile as g, DropzoneProps as h, DropzoneDescription as i, useDropzone$1 as j, UseDropzoneProps as k, DropzoneFileListProps as l, DropzoneMessageProps as m, DropzoneArea as n, DropzoneFileList as o, DropzoneMessage as p, DropzoneAreaProps as r, DropzoneFileListItem as s, Dropzone as t, DropzoneFileMessage as u, DropzoneRetryFile as v, ErrorCode as w, DropzoneTriggerProps as x, DropzoneRetryFileProps as y };
|
|
102
|
+
//# sourceMappingURL=dropzone-43h3L9Ko.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-Bdj-bS2b.js";import{t}from"./utils-DP9KtG7I.js";import{t as n}from"./button-oI3hbOgp.js";import{t as r}from"./compose-refs-DUtp7lGn.js";import{jsx as i,jsxs as a}from"react/jsx-runtime";import*as o from"react";import{ErrorCode as s,useDropzone as c}from"react-dropzone";const l=[s.FileInvalidType,s.FileTooLarge,s.FileTooSmall,s.TooManyFiles],u=new Set(l),d={pending:`indeterminate`,success:`100%`,error:`error`},f=o.createContext(null),p=o.createContext(null);function fileStatusReducer(e,t){switch(t.type){case`add`:return[...e,{id:t.id,fileName:t.fileName,file:t.file,status:`pending`,tries:1}];case`remove`:return e.filter(e=>e.id!==t.id);case`update-status`:return e.map(e=>e.id===t.id?t.status===`pending`?{...e,status:`pending`,error:void 0,message:void 0,result:void 0,tries:e.tries+1}:t.status===`error`?{...e,status:`error`,error:t.error,message:t.message,result:void 0}:{...e,status:`success`,result:t.result,error:void 0,message:void 0}:e)}}function formatAcceptedTypes(e){if(!e)return;let t=Object.entries(e).flatMap(([e,t])=>t.length>0?t:[e]);return t.length>0?t.join(`, `):void 0}function getDropzoneErrorCodes(e){let t=e.flatMap(e=>e.errors.map(e=>e.code).filter(e=>u.has(e)));return Array.from(new Set(t))}function getRootError(e,t){let n=e.flatMap(e=>{switch(e){case`file-invalid-type`:{let e=formatAcceptedTypes(t.accept);return e?[`only ${e} files are allowed`]:[`this file type is not allowed`]}case`file-too-large`:return t.maxSize?[`max size is ${(t.maxSize/(1024*1024)).toFixed(2)} MB`]:[`this file is too large`];case`file-too-small`:return t.minSize?[`min size is ${(t.minSize/(1024*1024)).toFixed(2)} MB`]:[`this file is too small`];case`too-many-files`:return t.maxFiles?[`max ${t.maxFiles} files`]:[`too many files`];default:return[]}});if(n.length===0)return`Unable to add the selected files`;let[r,...i]=n;return`${r.charAt(0).toUpperCase()}${r.slice(1)}${i.length>0?`, ${i.join(`, `)}`:``}`}function getRejectionMessage(e,t){let n=getDropzoneErrorCodes(e);return n.length>0?getRootError(n,t):e[0]?.errors[0]?.message??`Unable to add the selected files`}function getUploadErrorMessage(e,t){if(t){let n=t(e);if(n!==void 0)return n}if(typeof e==`string`)return e;if(e instanceof Error)return e.message}function useDropzoneContext(){let e=o.useContext(f);if(!e)throw Error(`Dropzone components must be used within a Dropzone.`);return e}function useDropzoneFileListContext(){let e=o.useContext(p);if(!e)throw Error(`Dropzone file actions must be used within a DropzoneFileListItem.`);return e}function useDropzone$1(e){let{onDropFile:t,onRemoveFile:n,shapeUploadError:r,onFileUploaded:i,onFileUploadError:a,onAllUploaded:l,onRootError:u,maxRetryCount:d,autoRetry:f=!1,validation:p,shiftOnMaxFiles:m=!1}=e,h=o.useId(),g=`${h}-message`,_=`${h}-description`,[v,y]=o.useState(void 0),b=o.useCallback(e=>{y(e),u?.(e)},[u]),[x,S]=o.useReducer(fileStatusReducer,[]),C=o.useCallback(e=>`${h}-${e}-message`,[h]),w=o.useMemo(()=>v!==void 0||x.some(e=>e.status===`error`),[x,v]),T=o.useCallback(async(e,n,o=0)=>{try{let s=await t(e);if(s.status===`error`){if(f&&o<(d??1/0))return S({type:`update-status`,id:n,status:`pending`}),T(e,n,o+1);S({type:`update-status`,id:n,status:`error`,error:s.error,message:getUploadErrorMessage(s.error,r)}),a?.(s.error);return}S({type:`update-status`,id:n,status:`success`,result:s.result}),i?.(s.result)}catch(e){let t=e;S({type:`update-status`,id:n,status:`error`,error:t,message:getUploadErrorMessage(t,r)}),a?.(t)}},[f,t,d,a,i,r]),E=o.useCallback(async e=>{await n?.(e),S({type:`remove`,id:e})},[n]),D=o.useCallback(e=>{let t=x.find(t=>t.id===e);return t?.status===`error`&&t.tries<=(d??1/0)},[x,d]),O=o.useCallback(async e=>{if(!D(e))return;let t=x.find(t=>t.id===e);t?.status===`error`&&(S({type:`update-status`,id:e,status:`pending`}),await T(t.file,e))},[D,x,T]),k=c({accept:p?.accept,minSize:p?.minSize,maxSize:p?.maxSize,maxFiles:p?.maxFiles,noClick:!0,noKeyboard:!0,onDropAccepted:async e=>{b(void 0);let t=e,n=p?.maxFiles??1/0,r=Number.isFinite(n)?Math.max(x.length+e.length-n,0):0;if(r>0)if(m){let n=x.slice(0,Math.min(r,x.length));await Promise.all(n.map(e=>E(e.id)));let i=r-n.length;i>0&&(t=e.slice(i))}else{b(getRootError([s.TooManyFiles],p??{}));let r=Math.max(n-x.length,0);t=e.slice(0,r)}t.length!==0&&(await Promise.all(t.map(async e=>{let t=crypto.randomUUID();S({type:`add`,id:t,fileName:e.name,file:e}),await T(e,t)})),l?.())},onDropRejected:e=>{b(getRejectionMessage(e,p??{}))}});return{getRootProps:k.getRootProps,getInputProps:k.getInputProps,open:k.open,onRemoveFile:E,onRetry:O,canRetry:D,fileStatuses:x,isInvalid:w,isDragActive:k.isDragActive,rootError:v,inputId:h,rootMessageId:g,rootDescriptionId:_,getFileMessageId:C}}e(useDropzone$1,`useDropzone`);function Dropzone({children:e,...t}){return i(f.Provider,{value:t,children:e})}const m=o.forwardRef(({className:e,children:n,...o},s)=>{let c=useDropzoneContext(),l=[c.rootDescriptionId,c.isInvalid?c.rootMessageId:void 0].filter(Boolean).join(` `)||void 0,{ref:u,...d}=c.getRootProps({...o,"data-slot":`dropzone-area`,"aria-describedby":l,"aria-invalid":c.isInvalid||void 0,className:t(`flex min-h-44 flex-col items-center justify-center gap-4 rounded-xl border border-dashed border-input bg-muted/20 px-6 py-8 text-center transition-colors`,c.isDragActive&&`border-primary bg-primary/5`,c.isInvalid&&`border-destructive bg-destructive/5`,e)}),f=c.getInputProps({id:c.inputId,className:`sr-only`,"aria-describedby":l,"aria-invalid":c.isInvalid,tabIndex:-1});return a(`div`,{...d,ref:r(s,u),children:[i(`input`,{...f}),n]})}),h=o.forwardRef(({className:e,...n},r)=>i(`p`,{ref:r,id:useDropzoneContext().rootDescriptionId,"data-slot":`dropzone-description`,className:t(`text-sm text-muted-foreground`,e),...n})),g=o.forwardRef(({className:e,...n},r)=>(useDropzoneContext(),i(`ol`,{ref:r,"data-slot":`dropzone-file-list`,className:t(`space-y-3`,e),...n}))),_=o.forwardRef(({className:e,file:n,children:r,...a},s)=>{let c=useDropzoneContext(),l=c.getFileMessageId(n.id),u=n.status===`error`,d=c.canRetry(n.id),f=o.useMemo(()=>({onRemoveFile:()=>c.onRemoveFile(n.id),onRetry:()=>c.onRetry(n.id),fileStatus:n,canRetry:d,dropzoneId:c.inputId,messageId:l}),[d,c,n,l]);return i(p.Provider,{value:f,children:i(`li`,{ref:s,"data-slot":`dropzone-file-item`,"data-status":n.status,"aria-describedby":u?l:void 0,className:t(`rounded-xl border bg-card px-4 py-3 shadow-xs`,n.status===`error`&&`border-destructive/50`,e),...a,children:r})})}),v=o.forwardRef(({className:e,children:n,...r},a)=>{let o=useDropzoneFileListContext(),s=o.fileStatus.status===`error`?o.fileStatus.message??String(o.fileStatus.error):n;return i(`p`,{ref:a,id:o.messageId,"data-slot":`dropzone-file-message`,className:t(`min-h-5 text-[0.8rem] font-medium`,o.fileStatus.status===`error`&&`text-destructive`,e),...r,children:s})}),y=o.forwardRef(({className:e,children:n,...r},a)=>{let o=useDropzoneContext(),s=o.rootError??n;return i(`p`,{ref:a,id:o.rootMessageId,"data-slot":`dropzone-message`,className:t(`min-h-5 text-[0.8rem] font-medium text-destructive`,e),...r,children:s})}),b=o.forwardRef(({className:e,onClick:r,size:a=`icon-sm`,type:s=`button`,variant:c=`ghost`,...l},u)=>{let d=useDropzoneFileListContext(),f=o.useCallback(e=>{r?.(e),!e.defaultPrevented&&d.onRemoveFile()},[d,r]);return i(n,{ref:u,"data-slot":`dropzone-remove-file`,className:t(e),onClick:f,size:a,type:s,variant:c,...l})}),x=o.forwardRef(({className:e,disabled:r,onClick:a,size:s=`icon-sm`,type:c=`button`,variant:l=`ghost`,...u},d)=>{let f=useDropzoneFileListContext(),p=r||!f.canRetry,m=o.useCallback(e=>{a?.(e),!(e.defaultPrevented||p)&&f.onRetry()},[f,p,a]);return i(n,{ref:d,"data-slot":`dropzone-retry-file`,className:t(e),disabled:p,onClick:m,size:s,type:c,variant:l,...u})}),S=o.forwardRef(({className:e,onClick:r,size:a=`sm`,type:s=`button`,variant:c=`subtle`,...l},u)=>{let d=useDropzoneContext(),f=[d.rootDescriptionId,d.isInvalid?d.rootMessageId:void 0].filter(Boolean).join(` `)||void 0,p=o.useCallback(e=>{r?.(e),!e.defaultPrevented&&d.open()},[d,r]);return i(n,{ref:u,"aria-controls":d.inputId,"aria-describedby":f,"aria-invalid":d.isInvalid||void 0,"data-slot":`dropzone-trigger`,className:t(e),onClick:p,size:a,type:s,variant:c,...l})}),C=o.forwardRef(({className:e,status:n,...r},a)=>{let o=n===`success`||n===`error`,s=n===`error`;return i(`div`,{ref:a,"aria-valuemax":100,"aria-valuemin":0,"aria-valuetext":d[n],"data-slot":`dropzone-progress`,"data-status":n,role:`progressbar`,className:t(`relative h-2 w-full overflow-hidden rounded-full bg-muted`,e),...r,children:i(`div`,{className:t(`h-full w-full rounded-full bg-primary transition-transform`,o?`translate-x-0`:`animate-infinite-progress`,s&&`bg-destructive`)})})});Dropzone.displayName=`Dropzone`,m.displayName=`DropzoneArea`,h.displayName=`DropzoneDescription`,g.displayName=`DropzoneFileList`,_.displayName=`DropzoneFileListItem`,v.displayName=`DropzoneFileMessage`,y.displayName=`DropzoneMessage`,b.displayName=`DropzoneRemoveFile`,x.displayName=`DropzoneRetryFile`,S.displayName=`DropzoneTrigger`,C.displayName=`InfiniteProgress`;export{_ as a,b as c,s as d,C as f,g as i,x as l,m as n,v as o,useDropzone$1 as p,h as r,y as s,Dropzone as t,S as u};
|
|
2
|
+
//# sourceMappingURL=dropzone-BLZkZThJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropzone-BLZkZThJ.js","names":["useDropzone","useReactDropzone"],"sources":["../src/components/dropzone.tsx"],"sourcesContent":["import * as React from 'react'\nimport {\n type Accept,\n ErrorCode,\n type FileError,\n type FileRejection,\n useDropzone as useReactDropzone\n} from 'react-dropzone'\n\nimport { composeRefs } from '../lib/compose-refs'\nimport { cn } from '../lib/utils'\nimport { Button, type ButtonProps } from './button'\n\nconst dropzoneErrorCodes = [\n ErrorCode.FileInvalidType,\n ErrorCode.FileTooLarge,\n ErrorCode.FileTooSmall,\n ErrorCode.TooManyFiles\n]\n\ntype DropzoneAction<TUploadResult, TUploadError> =\n | {\n type: 'add'\n id: string\n fileName: string\n file: File\n }\n | {\n type: 'remove'\n id: string\n }\n | {\n type: 'update-status'\n id: string\n status: 'pending'\n }\n | {\n type: 'update-status'\n id: string\n status: 'error'\n error: TUploadError\n message?: string\n }\n | {\n type: 'update-status'\n id: string\n status: 'success'\n result: TUploadResult\n }\n\nexport type DropzoneUploadResult<TUploadResult, TUploadError> =\n | {\n status: 'error'\n error: TUploadError\n }\n | {\n status: 'success'\n result: TUploadResult\n }\n\nexport type DropzoneFileStatus<TUploadResult, TUploadError> = {\n id: string\n fileName: string\n file: File\n tries: number\n} & (\n | {\n status: 'pending'\n error?: undefined\n message?: undefined\n result?: undefined\n }\n | {\n status: 'error'\n error: TUploadError\n message?: string\n result?: undefined\n }\n | {\n status: 'success'\n result: TUploadResult\n error?: undefined\n message?: undefined\n }\n)\n\nexport type FileStatus<TUploadResult, TUploadError> = DropzoneFileStatus<TUploadResult, TUploadError>\n\nexport type DropzoneValidation = {\n accept?: Accept\n minSize?: number\n maxSize?: number\n maxFiles?: number\n}\n\nexport type UseDropzoneProps<TUploadResult, TUploadError = string> = {\n onDropFile: (file: File) => Promise<DropzoneUploadResult<TUploadResult, TUploadError>>\n onRemoveFile?: (id: string) => void | Promise<void>\n onFileUploaded?: (result: TUploadResult) => void\n onFileUploadError?: (error: TUploadError) => void\n onAllUploaded?: () => void\n onRootError?: (error: string | undefined) => void\n shapeUploadError?: (error: TUploadError) => string | undefined\n maxRetryCount?: number\n autoRetry?: boolean\n validation?: DropzoneValidation\n shiftOnMaxFiles?: boolean\n}\n\nexport interface UseDropzoneReturn<TUploadResult, TUploadError> {\n getRootProps: ReturnType<typeof useReactDropzone>['getRootProps']\n getInputProps: ReturnType<typeof useReactDropzone>['getInputProps']\n open: () => void\n onRemoveFile: (id: string) => Promise<void>\n onRetry: (id: string) => Promise<void>\n canRetry: (id: string) => boolean\n fileStatuses: DropzoneFileStatus<TUploadResult, TUploadError>[]\n isInvalid: boolean\n isDragActive: boolean\n rootError: string | undefined\n inputId: string\n rootMessageId: string\n rootDescriptionId: string\n getFileMessageId: (id: string) => string\n}\n\nexport type DropzoneProps<TUploadResult, TUploadError> = React.PropsWithChildren<\n UseDropzoneReturn<TUploadResult, TUploadError>\n>\n\nexport type DropzoneAreaProps = React.ComponentProps<'div'>\n\nexport type DropzoneDescriptionProps = React.ComponentProps<'p'>\n\nexport type DropzoneFileListProps = React.ComponentProps<'ol'>\n\nexport type DropzoneFileListItemProps<TUploadResult, TUploadError> = React.ComponentProps<'li'> & {\n file: DropzoneFileStatus<TUploadResult, TUploadError>\n}\n\nexport type DropzoneFileMessageProps = React.ComponentProps<'p'>\n\nexport type DropzoneMessageProps = React.ComponentProps<'p'>\n\nexport type DropzoneRemoveFileProps = ButtonProps\n\nexport type DropzoneRetryFileProps = ButtonProps\n\nexport type DropzoneTriggerProps = ButtonProps\n\nexport type InfiniteProgressProps = React.ComponentProps<'div'> & {\n status: 'pending' | 'success' | 'error'\n}\n\ntype DropzoneFileListContextValue<TUploadResult, TUploadError> = {\n onRemoveFile: () => Promise<void>\n onRetry: () => Promise<void>\n fileStatus: DropzoneFileStatus<TUploadResult, TUploadError>\n canRetry: boolean\n dropzoneId: string\n messageId: string\n}\n\nconst dropzoneErrorCodeSet = new Set<ErrorCode>(dropzoneErrorCodes)\n\nconst valueTextMap = {\n pending: 'indeterminate',\n success: '100%',\n error: 'error'\n} as const\n\nconst DropzoneContext = React.createContext<UseDropzoneReturn<unknown, unknown> | null>(null)\n\nconst DropzoneFileListContext = React.createContext<DropzoneFileListContextValue<unknown, unknown> | null>(null)\n\nfunction fileStatusReducer<TUploadResult, TUploadError>(\n state: DropzoneFileStatus<TUploadResult, TUploadError>[],\n action: DropzoneAction<TUploadResult, TUploadError>\n): DropzoneFileStatus<TUploadResult, TUploadError>[] {\n switch (action.type) {\n case 'add':\n return [\n ...state,\n {\n id: action.id,\n fileName: action.fileName,\n file: action.file,\n status: 'pending',\n tries: 1\n }\n ]\n case 'remove':\n return state.filter((fileStatus) => fileStatus.id !== action.id)\n case 'update-status':\n return state.map((fileStatus) => {\n if (fileStatus.id !== action.id) {\n return fileStatus\n }\n\n if (action.status === 'pending') {\n return {\n ...fileStatus,\n status: 'pending',\n error: undefined,\n message: undefined,\n result: undefined,\n tries: fileStatus.tries + 1\n }\n }\n\n if (action.status === 'error') {\n return {\n ...fileStatus,\n status: 'error',\n error: action.error,\n message: action.message,\n result: undefined\n }\n }\n\n return {\n ...fileStatus,\n status: 'success',\n result: action.result,\n error: undefined,\n message: undefined\n }\n })\n }\n}\n\nfunction formatAcceptedTypes(accept?: Accept) {\n if (!accept) {\n return undefined\n }\n\n const acceptedTypes = Object.entries(accept).flatMap(([mimeType, extensions]) => {\n return extensions.length > 0 ? extensions : [mimeType]\n })\n\n return acceptedTypes.length > 0 ? acceptedTypes.join(', ') : undefined\n}\n\nfunction getDropzoneErrorCodes(fileRejections: FileRejection[]) {\n const errorCodes = fileRejections.flatMap((rejection) =>\n rejection.errors.map((error) => error.code as ErrorCode).filter((errorCode) => dropzoneErrorCodeSet.has(errorCode))\n )\n\n return Array.from(new Set(errorCodes))\n}\n\nfunction getRootError(errorCodes: ErrorCode[], limits: DropzoneValidation) {\n const errors = errorCodes.flatMap((errorCode) => {\n switch (errorCode) {\n case 'file-invalid-type': {\n const acceptedTypes = formatAcceptedTypes(limits.accept)\n return acceptedTypes ? [`only ${acceptedTypes} files are allowed`] : ['this file type is not allowed']\n }\n case 'file-too-large': {\n if (!limits.maxSize) {\n return ['this file is too large']\n }\n\n return [`max size is ${(limits.maxSize / (1024 * 1024)).toFixed(2)} MB`]\n }\n case 'file-too-small': {\n if (!limits.minSize) {\n return ['this file is too small']\n }\n\n return [`min size is ${(limits.minSize / (1024 * 1024)).toFixed(2)} MB`]\n }\n case 'too-many-files':\n return limits.maxFiles ? [`max ${limits.maxFiles} files`] : ['too many files']\n default:\n return []\n }\n })\n\n if (errors.length === 0) {\n return 'Unable to add the selected files'\n }\n\n const [firstError, ...restErrors] = errors as [string, ...string[]]\n return `${firstError.charAt(0).toUpperCase()}${firstError.slice(1)}${restErrors.length > 0 ? `, ${restErrors.join(', ')}` : ''}`\n}\n\nfunction getRejectionMessage(fileRejections: FileRejection[], limits: DropzoneValidation) {\n const errorCodes = getDropzoneErrorCodes(fileRejections)\n\n if (errorCodes.length > 0) {\n return getRootError(errorCodes, limits)\n }\n\n return fileRejections[0]?.errors[0]?.message ?? 'Unable to add the selected files'\n}\n\nfunction getUploadErrorMessage<TUploadError>(\n error: TUploadError,\n shapeUploadError?: (error: TUploadError) => string | undefined\n) {\n if (shapeUploadError) {\n const message = shapeUploadError(error)\n if (message !== undefined) {\n return message\n }\n }\n\n if (typeof error === 'string') {\n return error\n }\n\n if (error instanceof Error) {\n return error.message\n }\n\n return undefined\n}\n\nfunction useDropzoneContext<TUploadResult, TUploadError>() {\n const context = React.useContext(DropzoneContext)\n\n if (!context) {\n throw new Error('Dropzone components must be used within a Dropzone.')\n }\n\n return context as UseDropzoneReturn<TUploadResult, TUploadError>\n}\n\nfunction useDropzoneFileListContext<TUploadResult, TUploadError>() {\n const context = React.useContext(DropzoneFileListContext)\n\n if (!context) {\n throw new Error('Dropzone file actions must be used within a DropzoneFileListItem.')\n }\n\n return context as DropzoneFileListContextValue<TUploadResult, TUploadError>\n}\n\nfunction useDropzone<TUploadResult, TUploadError = string>(\n props: UseDropzoneProps<TUploadResult, TUploadError>\n): UseDropzoneReturn<TUploadResult, TUploadError> {\n const {\n onDropFile: handleDropFile,\n onRemoveFile: handleRemoveFile,\n shapeUploadError,\n onFileUploaded,\n onFileUploadError,\n onAllUploaded,\n onRootError,\n maxRetryCount,\n autoRetry = false,\n validation,\n shiftOnMaxFiles = false\n } = props\n\n const inputId = React.useId()\n const rootMessageId = `${inputId}-message`\n const rootDescriptionId = `${inputId}-description`\n const [rootError, setRootErrorState] = React.useState<string | undefined>(undefined)\n\n const setRootError = React.useCallback(\n (error: string | undefined) => {\n setRootErrorState(error)\n onRootError?.(error)\n },\n [onRootError]\n )\n\n const [fileStatuses, dispatch] = React.useReducer(\n fileStatusReducer<TUploadResult, TUploadError>,\n [] as DropzoneFileStatus<TUploadResult, TUploadError>[]\n )\n\n const getFileMessageId = React.useCallback((id: string) => `${inputId}-${id}-message`, [inputId])\n\n const isInvalid = React.useMemo(() => {\n return rootError !== undefined || fileStatuses.some((fileStatus) => fileStatus.status === 'error')\n }, [fileStatuses, rootError])\n\n const uploadFile = React.useCallback(\n async (file: File, id: string, retryCount = 0) => {\n try {\n const result = await handleDropFile(file)\n\n if (result.status === 'error') {\n if (autoRetry && retryCount < (maxRetryCount ?? Number.POSITIVE_INFINITY)) {\n dispatch({ type: 'update-status', id, status: 'pending' })\n return uploadFile(file, id, retryCount + 1)\n }\n\n dispatch({\n type: 'update-status',\n id,\n status: 'error',\n error: result.error,\n message: getUploadErrorMessage(result.error, shapeUploadError)\n })\n onFileUploadError?.(result.error)\n return\n }\n\n dispatch({\n type: 'update-status',\n id,\n status: 'success',\n result: result.result\n })\n onFileUploaded?.(result.result)\n } catch (error) {\n const uploadError = error as TUploadError\n\n dispatch({\n type: 'update-status',\n id,\n status: 'error',\n error: uploadError,\n message: getUploadErrorMessage(uploadError, shapeUploadError)\n })\n onFileUploadError?.(uploadError)\n }\n },\n [autoRetry, handleDropFile, maxRetryCount, onFileUploadError, onFileUploaded, shapeUploadError]\n )\n\n const onRemoveFile = React.useCallback(\n async (id: string) => {\n await handleRemoveFile?.(id)\n dispatch({ type: 'remove', id })\n },\n [handleRemoveFile]\n )\n\n const canRetry = React.useCallback(\n (id: string) => {\n const fileStatus = fileStatuses.find((item) => item.id === id)\n\n return fileStatus?.status === 'error' && fileStatus.tries <= (maxRetryCount ?? Number.POSITIVE_INFINITY)\n },\n [fileStatuses, maxRetryCount]\n )\n\n const onRetry = React.useCallback(\n async (id: string) => {\n if (!canRetry(id)) {\n return\n }\n\n const fileStatus = fileStatuses.find((item) => item.id === id)\n\n if (fileStatus?.status !== 'error') {\n return\n }\n\n dispatch({ type: 'update-status', id, status: 'pending' })\n await uploadFile(fileStatus.file, id)\n },\n [canRetry, fileStatuses, uploadFile]\n )\n\n const dropzone = useReactDropzone({\n accept: validation?.accept,\n minSize: validation?.minSize,\n maxSize: validation?.maxSize,\n maxFiles: validation?.maxFiles,\n noClick: true,\n noKeyboard: true,\n onDropAccepted: async (acceptedFiles) => {\n setRootError(undefined)\n\n let nextFiles = acceptedFiles\n const maxFiles = validation?.maxFiles ?? Number.POSITIVE_INFINITY\n const overflow = Number.isFinite(maxFiles)\n ? Math.max(fileStatuses.length + acceptedFiles.length - maxFiles, 0)\n : 0\n\n if (overflow > 0) {\n if (shiftOnMaxFiles) {\n const filesToRemove = fileStatuses.slice(0, Math.min(overflow, fileStatuses.length))\n\n await Promise.all(filesToRemove.map((fileStatus) => onRemoveFile(fileStatus.id)))\n\n const remainingOverflow = overflow - filesToRemove.length\n if (remainingOverflow > 0) {\n nextFiles = acceptedFiles.slice(remainingOverflow)\n }\n } else {\n setRootError(getRootError([ErrorCode.TooManyFiles], validation ?? {}))\n const availableSlots = Math.max(maxFiles - fileStatuses.length, 0)\n nextFiles = acceptedFiles.slice(0, availableSlots)\n }\n }\n\n if (nextFiles.length === 0) {\n return\n }\n\n await Promise.all(\n nextFiles.map(async (file) => {\n const id = crypto.randomUUID()\n dispatch({ type: 'add', id, fileName: file.name, file })\n await uploadFile(file, id)\n })\n )\n\n onAllUploaded?.()\n },\n onDropRejected: (fileRejections) => {\n setRootError(getRejectionMessage(fileRejections, validation ?? {}))\n }\n })\n\n return {\n getRootProps: dropzone.getRootProps,\n getInputProps: dropzone.getInputProps,\n open: dropzone.open,\n onRemoveFile,\n onRetry,\n canRetry,\n fileStatuses,\n isInvalid,\n isDragActive: dropzone.isDragActive,\n rootError,\n inputId,\n rootMessageId,\n rootDescriptionId,\n getFileMessageId\n }\n}\n\nfunction Dropzone<TUploadResult, TUploadError>({ children, ...dropzone }: DropzoneProps<TUploadResult, TUploadError>) {\n return <DropzoneContext.Provider value={dropzone}>{children}</DropzoneContext.Provider>\n}\n\nconst DropzoneArea = React.forwardRef<HTMLDivElement, DropzoneAreaProps>(\n ({ className, children, ...props }, forwardedRef) => {\n const context = useDropzoneContext()\n const describedBy =\n [context.rootDescriptionId, context.isInvalid ? context.rootMessageId : undefined].filter(Boolean).join(' ') ||\n undefined\n\n const { ref: rootRef, ...rootProps } = context.getRootProps({\n ...props,\n 'data-slot': 'dropzone-area',\n 'aria-describedby': describedBy,\n 'aria-invalid': context.isInvalid || undefined,\n className: cn(\n 'flex min-h-44 flex-col items-center justify-center gap-4 rounded-xl border border-dashed border-input bg-muted/20 px-6 py-8 text-center transition-colors',\n context.isDragActive && 'border-primary bg-primary/5',\n context.isInvalid && 'border-destructive bg-destructive/5',\n className\n )\n }) as React.HTMLAttributes<HTMLDivElement> & {\n ref?: React.Ref<HTMLDivElement>\n }\n\n const inputProps = context.getInputProps({\n id: context.inputId,\n className: 'sr-only',\n 'aria-describedby': describedBy,\n 'aria-invalid': context.isInvalid,\n tabIndex: -1\n })\n\n return (\n <div {...rootProps} ref={composeRefs(forwardedRef, rootRef)}>\n <input {...inputProps} />\n {children}\n </div>\n )\n }\n)\n\nconst DropzoneDescription = React.forwardRef<HTMLParagraphElement, DropzoneDescriptionProps>(\n ({ className, ...props }, ref) => {\n const context = useDropzoneContext()\n\n return (\n <p\n ref={ref}\n id={context.rootDescriptionId}\n data-slot=\"dropzone-description\"\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n )\n }\n)\n\nconst DropzoneFileList = React.forwardRef<HTMLOListElement, DropzoneFileListProps>(({ className, ...props }, ref) => {\n useDropzoneContext()\n\n return <ol ref={ref} data-slot=\"dropzone-file-list\" className={cn('space-y-3', className)} {...props} />\n})\n\nconst DropzoneFileListItem = React.forwardRef<HTMLLIElement, DropzoneFileListItemProps<unknown, unknown>>(\n ({ className, file, children, ...props }, ref) => {\n const context = useDropzoneContext()\n const messageId = context.getFileMessageId(file.id)\n const isInvalid = file.status === 'error'\n const canRetry = context.canRetry(file.id)\n\n const value = React.useMemo<DropzoneFileListContextValue<unknown, unknown>>(\n () => ({\n onRemoveFile: () => context.onRemoveFile(file.id),\n onRetry: () => context.onRetry(file.id),\n fileStatus: file,\n canRetry,\n dropzoneId: context.inputId,\n messageId\n }),\n [canRetry, context, file, messageId]\n )\n\n return (\n <DropzoneFileListContext.Provider value={value}>\n <li\n ref={ref}\n data-slot=\"dropzone-file-item\"\n data-status={file.status}\n aria-describedby={isInvalid ? messageId : undefined}\n className={cn(\n 'rounded-xl border bg-card px-4 py-3 shadow-xs',\n file.status === 'error' && 'border-destructive/50',\n className\n )}\n {...props}\n >\n {children}\n </li>\n </DropzoneFileListContext.Provider>\n )\n }\n)\n\nconst DropzoneFileMessage = React.forwardRef<HTMLParagraphElement, DropzoneFileMessageProps>(\n ({ className, children, ...props }, ref) => {\n const context = useDropzoneFileListContext()\n const body =\n context.fileStatus.status === 'error'\n ? (context.fileStatus.message ?? String(context.fileStatus.error))\n : children\n\n return (\n <p\n ref={ref}\n id={context.messageId}\n data-slot=\"dropzone-file-message\"\n className={cn(\n 'min-h-5 text-[0.8rem] font-medium',\n context.fileStatus.status === 'error' && 'text-destructive',\n className\n )}\n {...props}\n >\n {body}\n </p>\n )\n }\n)\n\nconst DropzoneMessage = React.forwardRef<HTMLParagraphElement, DropzoneMessageProps>(\n ({ className, children, ...props }, ref) => {\n const context = useDropzoneContext()\n const body = context.rootError ?? children\n\n return (\n <p\n ref={ref}\n id={context.rootMessageId}\n data-slot=\"dropzone-message\"\n className={cn('min-h-5 text-[0.8rem] font-medium text-destructive', className)}\n {...props}\n >\n {body}\n </p>\n )\n }\n)\n\nconst DropzoneRemoveFile = React.forwardRef<HTMLButtonElement, DropzoneRemoveFileProps>(\n ({ className, onClick, size = 'icon-sm', type = 'button', variant = 'ghost', ...props }, ref) => {\n const context = useDropzoneFileListContext()\n\n const handleClick = React.useCallback<React.MouseEventHandler<HTMLButtonElement>>(\n (event) => {\n onClick?.(event)\n if (event.defaultPrevented) {\n return\n }\n\n void context.onRemoveFile()\n },\n [context, onClick]\n )\n\n return (\n <Button\n ref={ref}\n data-slot=\"dropzone-remove-file\"\n className={cn(className)}\n onClick={handleClick}\n size={size}\n type={type}\n variant={variant}\n {...props}\n />\n )\n }\n)\n\nconst DropzoneRetryFile = React.forwardRef<HTMLButtonElement, DropzoneRetryFileProps>(\n ({ className, disabled, onClick, size = 'icon-sm', type = 'button', variant = 'ghost', ...props }, ref) => {\n const context = useDropzoneFileListContext()\n const isDisabled = disabled || !context.canRetry\n\n const handleClick = React.useCallback<React.MouseEventHandler<HTMLButtonElement>>(\n (event) => {\n onClick?.(event)\n if (event.defaultPrevented || isDisabled) {\n return\n }\n\n void context.onRetry()\n },\n [context, isDisabled, onClick]\n )\n\n return (\n <Button\n ref={ref}\n data-slot=\"dropzone-retry-file\"\n className={cn(className)}\n disabled={isDisabled}\n onClick={handleClick}\n size={size}\n type={type}\n variant={variant}\n {...props}\n />\n )\n }\n)\n\nconst DropzoneTrigger = React.forwardRef<HTMLButtonElement, DropzoneTriggerProps>(\n ({ className, onClick, size = 'sm', type = 'button', variant = 'subtle', ...props }, ref) => {\n const context = useDropzoneContext()\n const describedBy =\n [context.rootDescriptionId, context.isInvalid ? context.rootMessageId : undefined].filter(Boolean).join(' ') ||\n undefined\n\n const handleClick = React.useCallback<React.MouseEventHandler<HTMLButtonElement>>(\n (event) => {\n onClick?.(event)\n if (event.defaultPrevented) {\n return\n }\n\n context.open()\n },\n [context, onClick]\n )\n\n return (\n <Button\n ref={ref}\n aria-controls={context.inputId}\n aria-describedby={describedBy}\n aria-invalid={context.isInvalid || undefined}\n data-slot=\"dropzone-trigger\"\n className={cn(className)}\n onClick={handleClick}\n size={size}\n type={type}\n variant={variant}\n {...props}\n />\n )\n }\n)\n\nconst InfiniteProgress = React.forwardRef<HTMLDivElement, InfiniteProgressProps>(\n ({ className, status, ...props }, ref) => {\n const done = status === 'success' || status === 'error'\n const isError = status === 'error'\n\n return (\n <div\n ref={ref}\n aria-valuemax={100}\n aria-valuemin={0}\n aria-valuetext={valueTextMap[status]}\n data-slot=\"dropzone-progress\"\n data-status={status}\n role=\"progressbar\"\n className={cn('relative h-2 w-full overflow-hidden rounded-full bg-muted', className)}\n {...props}\n >\n <div\n className={cn(\n 'h-full w-full rounded-full bg-primary transition-transform',\n done ? 'translate-x-0' : 'animate-infinite-progress',\n isError && 'bg-destructive'\n )}\n />\n </div>\n )\n }\n)\n\nDropzone.displayName = 'Dropzone'\nDropzoneArea.displayName = 'DropzoneArea'\nDropzoneDescription.displayName = 'DropzoneDescription'\nDropzoneFileList.displayName = 'DropzoneFileList'\nDropzoneFileListItem.displayName = 'DropzoneFileListItem'\nDropzoneFileMessage.displayName = 'DropzoneFileMessage'\nDropzoneMessage.displayName = 'DropzoneMessage'\nDropzoneRemoveFile.displayName = 'DropzoneRemoveFile'\nDropzoneRetryFile.displayName = 'DropzoneRetryFile'\nDropzoneTrigger.displayName = 'DropzoneTrigger'\nInfiniteProgress.displayName = 'InfiniteProgress'\n\nexport {\n Dropzone,\n DropzoneArea,\n DropzoneDescription,\n DropzoneFileList,\n DropzoneFileListItem,\n DropzoneFileMessage,\n DropzoneMessage,\n DropzoneRemoveFile,\n DropzoneRetryFile,\n DropzoneTrigger,\n ErrorCode,\n type FileError,\n InfiniteProgress,\n useDropzone\n}\n"],"mappings":"oTAaA,MAAM,EAAqB,CACzB,EAAU,gBACV,EAAU,aACV,EAAU,aACV,EAAU,YACZ,EAiJM,EAAuB,IAAI,IAAe,CAAkB,EAE5D,EAAe,CACnB,QAAS,gBACT,QAAS,OACT,MAAO,OACT,EAEM,EAAkB,EAAM,cAA0D,IAAI,EAEtF,EAA0B,EAAM,cAAqE,IAAI,EAE/G,SAAS,kBACP,EACA,EACmD,CACnD,OAAQ,EAAO,KAAf,CACE,IAAK,MACH,MAAO,CACL,GAAG,EACH,CACE,GAAI,EAAO,GACX,SAAU,EAAO,SACjB,KAAM,EAAO,KACb,OAAQ,UACR,MAAO,CACT,CACF,EACF,IAAK,SACH,OAAO,EAAM,OAAQ,GAAe,EAAW,KAAO,EAAO,EAAE,EACjE,IAAK,gBACH,OAAO,EAAM,IAAK,GACZ,EAAW,KAAO,EAAO,GAIzB,EAAO,SAAW,UACb,CACL,GAAG,EACH,OAAQ,UACR,MAAO,IAAA,GACP,QAAS,IAAA,GACT,OAAQ,IAAA,GACR,MAAO,EAAW,MAAQ,CAC5B,EAGE,EAAO,SAAW,QACb,CACL,GAAG,EACH,OAAQ,QACR,MAAO,EAAO,MACd,QAAS,EAAO,QAChB,OAAQ,IAAA,EACV,EAGK,CACL,GAAG,EACH,OAAQ,UACR,OAAQ,EAAO,OACf,MAAO,IAAA,GACP,QAAS,IAAA,EACX,EA9BS,CA+BV,CACL,CACF,CAEA,SAAS,oBAAoB,EAAiB,CAC5C,GAAI,CAAC,EACH,OAGF,IAAM,EAAgB,OAAO,QAAQ,CAAM,CAAC,CAAC,SAAS,CAAC,EAAU,KACxD,EAAW,OAAS,EAAI,EAAa,CAAC,CAAQ,CACtD,EAED,OAAO,EAAc,OAAS,EAAI,EAAc,KAAK,IAA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,OACE,EAAC,MAAD,CACO,MACL,gBAAe,IACf,gBAAe,EACf,iBAAgB,EAAa,GAC7B,YAAU,oBACV,cAAa,EACb,KAAK,cACL,UAAW,EAAG,4DAA6D,CAAS,EACpF,GAAI,EAEJ,SAAA,EAAC,MAAD,CACE,UAAW,EACT,6DACA,EAAO,gBAAkB,4BACzB,GAAW,gBACb,CACD,CAAA,CACE,CAAA,CAET,CACF,EAEA,SAAS,YAAc,WACvB,EAAa,YAAc,eAC3B,EAAoB,YAAc,sBAClC,EAAiB,YAAc,mBAC/B,EAAqB,YAAc,uBACnC,EAAoB,YAAc,sBAClC,EAAgB,YAAc,kBAC9B,EAAmB,YAAc,qBACjC,EAAkB,YAAc,oBAChC,EAAgB,YAAc,kBAC9B,EAAiB,YAAc"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./rolldown-runtime-Bdj-bS2b.js";import{t as e}from"./utils-DP9KtG7I.js";import{jsx as t}from"react/jsx-runtime";import{cva as n}from"class-variance-authority";function Empty({className:n,...r}){return t(`div`,{"data-slot":`empty`,className:e(`gap-4 rounded-xl border-dashed p-6 flex w-full min-w-0 flex-1 flex-col items-center justify-center text-center text-balance`,n),...r})}function EmptyHeader({className:n,...r}){return t(`div`,{"data-slot":`empty-header`,className:e(`gap-2 flex max-w-sm flex-col items-center`,n),...r})}const r=n(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`bg-muted text-foreground flex size-8 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-4`}},defaultVariants:{variant:`default`}});function EmptyMedia({className:n,variant:i=`default`,...a}){return t(`div`,{"data-slot":`empty-icon`,"data-variant":i,className:e(r({variant:i,className:n})),...a})}function EmptyTitle({className:n,...r}){return t(`div`,{"data-slot":`empty-title`,className:e(`text-sm font-medium tracking-tight`,n),...r})}function EmptyDescription({className:n,...r}){return t(`div`,{"data-slot":`empty-description`,className:e(`text-sm/relaxed text-muted-foreground [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4`,n),...r})}function EmptyContent({className:n,...r}){return t(`div`,{"data-slot":`empty-content`,className:e(`gap-2.5 text-sm flex w-full max-w-sm min-w-0 flex-col items-center text-balance`,n),...r})}export{EmptyMedia as a,EmptyHeader as i,EmptyContent as n,EmptyTitle as o,EmptyDescription as r,Empty as t};
|
|
2
|
+
//# sourceMappingURL=empty-BhKsDYZ5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"empty-BhKsDYZ5.js","names":[],"sources":["../src/components/empty.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '../lib/utils'\n\nexport type EmptyProps = React.ComponentProps<'div'>\n\nexport type EmptyHeaderProps = React.ComponentProps<'div'>\n\nexport type EmptyMediaProps = React.ComponentProps<'div'> & VariantProps<typeof emptyMediaVariants>\n\nexport type EmptyTitleProps = React.ComponentProps<'div'>\n\nexport type EmptyDescriptionProps = React.ComponentProps<'p'>\n\nexport type EmptyContentProps = React.ComponentProps<'div'>\n\nfunction Empty({ className, ...props }: EmptyProps) {\n return (\n <div\n data-slot=\"empty\"\n className={cn(\n 'gap-4 rounded-xl border-dashed p-6 flex w-full min-w-0 flex-1 flex-col items-center justify-center text-center text-balance',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction EmptyHeader({ className, ...props }: EmptyHeaderProps) {\n return (\n <div data-slot=\"empty-header\" className={cn('gap-2 flex max-w-sm flex-col items-center', className)} {...props} />\n )\n}\n\nconst emptyMediaVariants = cva(\n 'mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0',\n {\n variants: {\n variant: {\n default: 'bg-transparent',\n icon: \"bg-muted text-foreground flex size-8 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-4\"\n }\n },\n defaultVariants: {\n variant: 'default'\n }\n }\n)\n\nfunction EmptyMedia({ className, variant = 'default', ...props }: EmptyMediaProps) {\n return (\n <div\n data-slot=\"empty-icon\"\n data-variant={variant}\n className={cn(emptyMediaVariants({ variant, className }))}\n {...props}\n />\n )\n}\n\nfunction EmptyTitle({ className, ...props }: EmptyTitleProps) {\n return <div data-slot=\"empty-title\" className={cn('text-sm font-medium tracking-tight', className)} {...props} />\n}\n\nfunction EmptyDescription({ className, ...props }: EmptyDescriptionProps) {\n return (\n <div\n data-slot=\"empty-description\"\n className={cn(\n 'text-sm/relaxed text-muted-foreground [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction EmptyContent({ className, ...props }: EmptyContentProps) {\n return (\n <div\n data-slot=\"empty-content\"\n className={cn('gap-2.5 text-sm flex w-full max-w-sm min-w-0 flex-col items-center text-balance', className)}\n {...props}\n />\n )\n}\n\nexport { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle }\n"],"mappings":"sKAgBA,SAAS,MAAM,CAAE,YAAW,GAAG,GAAqB,CAClD,OACE,EAAC,MAAD,CACE,YAAU,QACV,UAAW,EACT,8HACA,CACF,EACA,GAAI,CACL,CAAA,CAEL,CAEA,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OACE,EAAC,MAAD,CAAK,YAAU,eAAe,UAAW,EAAG,4CAA6C,CAAS,EAAG,GAAI,CAAQ,CAAA,CAErH,CAEA,MAAM,EAAqB,EACzB,8FACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,iBACT,KAAM,2HACR,CACF,EACA,gBAAiB,CACf,QAAS,SACX,CACF,CACF,EAEA,SAAS,WAAW,CAAE,YAAW,UAAU,UAAW,GAAG,GAA0B,CACjF,OACE,EAAC,MAAD,CACE,YAAU,aACV,eAAc,EACd,UAAW,EAAG,EAAmB,CAAE,UAAS,WAAU,CAAC,CAAC,EACxD,GAAI,CACL,CAAA,CAEL,CAEA,SAAS,WAAW,CAAE,YAAW,GAAG,GAA0B,CAC5D,OAAO,EAAC,MAAD,CAAK,YAAU,cAAc,UAAW,EAAG,qCAAsC,CAAS,EAAG,GAAI,CAAQ,CAAA,CAClH,CAEA,SAAS,iBAAiB,CAAE,YAAW,GAAG,GAAgC,CACxE,OACE,EAAC,MAAD,CACE,YAAU,oBACV,UAAW,EACT,0GACA,CACF,EACA,GAAI,CACL,CAAA,CAEL,CAEA,SAAS,aAAa,CAAE,YAAW,GAAG,GAA4B,CAChE,OACE,EAAC,MAAD,CACE,YAAU,gBACV,UAAW,EAAG,kFAAmF,CAAS,EAC1G,GAAI,CACL,CAAA,CAEL"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { n as __name } from "./rolldown-runtime-Bdj-bS2b.js";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
//#region src/components/empty.d.ts
|
|
4
|
+
type EmptyProps = React.ComponentProps<'div'>;
|
|
5
|
+
type EmptyHeaderProps = React.ComponentProps<'div'>;
|
|
6
|
+
type EmptyMediaProps = React.ComponentProps<'div'> & VariantProps<typeof emptyMediaVariants>;
|
|
7
|
+
type EmptyTitleProps = React.ComponentProps<'div'>;
|
|
8
|
+
type EmptyDescriptionProps = React.ComponentProps<'p'>;
|
|
9
|
+
type EmptyContentProps = React.ComponentProps<'div'>;
|
|
10
|
+
declare function Empty({ className, ...props }: EmptyProps): import("react").JSX.Element;
|
|
11
|
+
declare function EmptyHeader({ className, ...props }: EmptyHeaderProps): import("react").JSX.Element;
|
|
12
|
+
declare const emptyMediaVariants: (props?: ({
|
|
13
|
+
variant?: "default" | "icon" | null | undefined;
|
|
14
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
15
|
+
declare function EmptyMedia({ className, variant, ...props }: EmptyMediaProps): import("react").JSX.Element;
|
|
16
|
+
declare function EmptyTitle({ className, ...props }: EmptyTitleProps): import("react").JSX.Element;
|
|
17
|
+
declare function EmptyDescription({ className, ...props }: EmptyDescriptionProps): import("react").JSX.Element;
|
|
18
|
+
declare function EmptyContent({ className, ...props }: EmptyContentProps): import("react").JSX.Element;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { EmptyDescriptionProps as a, EmptyMedia as c, EmptyTitle as d, EmptyTitleProps as f, EmptyDescription as i, EmptyMediaProps as l, EmptyContent as n, EmptyHeader as o, EmptyContentProps as r, EmptyHeaderProps as s, Empty as t, EmptyProps as u };
|
|
21
|
+
//# sourceMappingURL=empty-D8ZiTCVK.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { n as __name } from "./rolldown-runtime-Bdj-bS2b.js";
|
|
2
|
+
import { t as Label } from "./label-KZl6I5Ey.js";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
//#region src/components/field.d.ts
|
|
5
|
+
type FieldSetProps = React.ComponentProps<'fieldset'>;
|
|
6
|
+
type FieldLegendProps = React.ComponentProps<'legend'> & {
|
|
7
|
+
variant?: 'legend' | 'label';
|
|
8
|
+
};
|
|
9
|
+
type FieldGroupProps = React.ComponentProps<'div'>;
|
|
10
|
+
type FieldContentProps = React.ComponentProps<'div'>;
|
|
11
|
+
type FieldLabelProps = React.ComponentProps<typeof Label>;
|
|
12
|
+
type FieldTitleProps = React.ComponentProps<'div'>;
|
|
13
|
+
type FieldDescriptionProps = React.ComponentProps<'p'>;
|
|
14
|
+
type FieldSeparatorProps = React.ComponentProps<'div'> & {
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
};
|
|
17
|
+
type FieldErrorProps = React.ComponentProps<'div'> & {
|
|
18
|
+
errors?: Array<{
|
|
19
|
+
message?: string;
|
|
20
|
+
} | undefined>;
|
|
21
|
+
};
|
|
22
|
+
declare function useFieldControlId(id?: string): string | undefined;
|
|
23
|
+
declare function FieldSet({ className, ...props }: FieldSetProps): import("react").JSX.Element;
|
|
24
|
+
declare function FieldLegend({ className, variant, ...props }: FieldLegendProps): import("react").JSX.Element;
|
|
25
|
+
declare function FieldGroup({ className, ...props }: FieldGroupProps): import("react").JSX.Element;
|
|
26
|
+
declare const fieldVariants: (props?: ({
|
|
27
|
+
orientation?: "horizontal" | "responsive" | "vertical" | null | undefined;
|
|
28
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
29
|
+
type FieldProps = React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>;
|
|
30
|
+
declare function Field({ className, orientation, ...props }: FieldProps): import("react").JSX.Element;
|
|
31
|
+
declare function FieldContent({ className, ...props }: FieldContentProps): import("react").JSX.Element;
|
|
32
|
+
declare function FieldLabel({ className, htmlFor, ...props }: FieldLabelProps): import("react").JSX.Element;
|
|
33
|
+
declare function FieldTitle({ className, ...props }: FieldTitleProps): import("react").JSX.Element;
|
|
34
|
+
declare function FieldDescription({ className, ...props }: FieldDescriptionProps): import("react").JSX.Element;
|
|
35
|
+
declare function FieldSeparator({ children, className, ...props }: FieldSeparatorProps): import("react").JSX.Element;
|
|
36
|
+
declare function FieldError({ className, children, errors, ...props }: FieldErrorProps): import("react").JSX.Element | null;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { FieldSet as _, FieldDescriptionProps as a, FieldTitleProps as b, FieldGroup as c, FieldLabelProps as d, FieldLegend as f, FieldSeparatorProps as g, FieldSeparator as h, FieldDescription as i, FieldGroupProps as l, FieldProps as m, FieldContent as n, FieldError as o, FieldLegendProps as p, FieldContentProps as r, FieldErrorProps as s, Field as t, FieldLabel as u, FieldSetProps as v, useFieldControlId as x, FieldTitle as y };
|
|
39
|
+
//# sourceMappingURL=field-C209yHO9.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./rolldown-runtime-Bdj-bS2b.js";import{t as e}from"./utils-DP9KtG7I.js";import{t}from"./separator-CCMmbXL0.js";import{t as n}from"./label-BQDEej_c.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{cva as a}from"class-variance-authority";import{createContext as o,useContext as s,useId as c,useMemo as l}from"react";const u=o(null);function useFieldControlId(e){let t=s(u);return e??t?.controlId}function FieldSet({className:t,...n}){return r(`fieldset`,{"data-slot":`field-set`,className:e(`flex flex-col gap-4`,`has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,t),...n})}function FieldLegend({className:t,variant:n=`legend`,...i}){return r(`legend`,{"data-slot":`field-legend`,"data-variant":n,className:e(`mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,t),...i})}function FieldGroup({className:t,...n}){return r(`div`,{"data-slot":`field-group`,className:e(`group/field-group @container/field-group flex w-full flex-col gap-5`,`data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,t),...n})}const d=a(`data-[invalid=true]:text-destructive gap-1 group/field flex w-full`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:*:data-[slot=field-label]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function Field({className:t,orientation:n=`vertical`,...i}){let a=c(),o=l(()=>({controlId:a}),[a]);return r(u.Provider,{value:o,children:r(`div`,{"data-slot":`field`,"data-orientation":n,className:e(d({orientation:n}),t),...i})})}function FieldContent({className:t,...n}){return r(`div`,{"data-slot":`field-content`,className:e(`gap-0.5 group/field-content flex flex-1 flex-col leading-snug`,t),...n})}function FieldLabel({className:t,htmlFor:i,...a}){return r(n,{"data-slot":`field-label`,htmlFor:useFieldControlId(i),className:e(`group/field-label peer/field-label flex w-fit gap-2 leading-snug`,`has-data-checked:bg-primary/5 has-data-checked:border-primary/30 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5`,`group-data-[disabled=true]/field:opacity-50`,t),...a})}function FieldTitle({className:t,...n}){return r(`div`,{"data-slot":`field-label`,className:e(`gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug`,t),...n})}function FieldDescription({className:t,...n}){return r(`p`,{"data-slot":`field-description`,className:e(`text-muted-foreground text-left text-xs leading-normal font-normal`,`[[data-variant=legend]+&]:-mt-1.5 group-has-data-horizontal/field:text-balance last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,t),...n})}function FieldSeparator({children:n,className:a,...o}){return i(`div`,{"data-slot":`field-separator`,"data-content":!!n,className:e(`-my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2 relative`,a),...o,children:[r(t,{className:`absolute inset-0 top-1/2`}),n&&r(`span`,{className:`text-muted-foreground px-2 bg-background relative mx-auto block w-fit`,"data-slot":`field-separator-content`,children:n})]})}function FieldError({className:t,children:n,errors:i,...a}){let o=l(()=>{if(n)return n;if(!i?.length)return null;let e=[...new Map(i.map(e=>[e?.message,e])).values()];return e?.length===1?e[0]?.message:r(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:e.map(e=>e?.message&&r(`li`,{children:e.message},e.message))})},[n,i]);return o?r(`div`,{role:`alert`,"data-slot":`field-error`,className:e(`text-destructive text-sm font-normal`,t),...a,children:o}):null}export{FieldGroup as a,FieldSeparator as c,useFieldControlId as d,FieldError as i,FieldSet as l,FieldContent as n,FieldLabel as o,FieldDescription as r,FieldLegend as s,Field as t,FieldTitle as u};
|
|
2
|
+
//# sourceMappingURL=field-DzR-XrO7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-DzR-XrO7.js","names":[],"sources":["../src/components/field.tsx"],"sourcesContent":["import { createContext, useContext, useId, useMemo } from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '../lib/utils'\nimport { Label } from './label'\nimport { Separator } from './separator'\n\nexport type FieldSetProps = React.ComponentProps<'fieldset'>\n\nexport type FieldLegendProps = React.ComponentProps<'legend'> & { variant?: 'legend' | 'label' }\n\nexport type FieldGroupProps = React.ComponentProps<'div'>\n\nexport type FieldContentProps = React.ComponentProps<'div'>\n\nexport type FieldLabelProps = React.ComponentProps<typeof Label>\n\nexport type FieldTitleProps = React.ComponentProps<'div'>\n\nexport type FieldDescriptionProps = React.ComponentProps<'p'>\n\nexport type FieldSeparatorProps = React.ComponentProps<'div'> & {\n children?: React.ReactNode\n}\n\nexport type FieldErrorProps = React.ComponentProps<'div'> & {\n errors?: Array<{ message?: string } | undefined>\n}\n\ntype FieldContextValue = {\n controlId: string\n}\n\nconst FieldContext = createContext<FieldContextValue | null>(null)\n\nfunction useFieldControlId(id?: string) {\n const context = useContext(FieldContext)\n\n return id ?? context?.controlId\n}\n\nfunction FieldSet({ className, ...props }: FieldSetProps) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn(\n 'flex flex-col gap-4',\n 'has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldLegend({ className, variant = 'legend', ...props }: FieldLegendProps) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn('mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base', className)}\n {...props}\n />\n )\n}\n\nfunction FieldGroup({ className, ...props }: FieldGroupProps) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n 'group/field-group @container/field-group flex w-full flex-col gap-5',\n 'data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4',\n className\n )}\n {...props}\n />\n )\n}\n\nconst fieldVariants = cva('data-[invalid=true]:text-destructive gap-1 group/field flex w-full', {\n variants: {\n orientation: {\n vertical: 'flex-col *:w-full [&>.sr-only]:w-auto',\n horizontal:\n 'flex-row items-center *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n responsive:\n 'flex-col *:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:*:data-[slot=field-label]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px'\n }\n },\n defaultVariants: {\n orientation: 'vertical'\n }\n})\n\nexport type FieldProps = React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>\n\nfunction Field({ className, orientation = 'vertical', ...props }: FieldProps) {\n const controlId = useId()\n const contextValue = useMemo(() => ({ controlId }), [controlId])\n\n return (\n <FieldContext.Provider value={contextValue}>\n <div\n data-slot=\"field\"\n data-orientation={orientation}\n className={cn(fieldVariants({ orientation }), className)}\n {...props}\n />\n </FieldContext.Provider>\n )\n}\n\nfunction FieldContent({ className, ...props }: FieldContentProps) {\n return (\n <div\n data-slot=\"field-content\"\n className={cn('gap-0.5 group/field-content flex flex-1 flex-col leading-snug', className)}\n {...props}\n />\n )\n}\n\nfunction FieldLabel({ className, htmlFor, ...props }: FieldLabelProps) {\n const fieldControlId = useFieldControlId(htmlFor)\n\n return (\n <Label\n data-slot=\"field-label\"\n htmlFor={fieldControlId}\n className={cn(\n 'group/field-label peer/field-label flex w-fit gap-2 leading-snug',\n 'has-data-checked:bg-primary/5 has-data-checked:border-primary/30 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10',\n 'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5',\n 'group-data-[disabled=true]/field:opacity-50',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldTitle({ className, ...props }: FieldTitleProps) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn(\n 'gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldDescription({ className, ...props }: FieldDescriptionProps) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n 'text-muted-foreground text-left text-xs leading-normal font-normal',\n '[[data-variant=legend]+&]:-mt-1.5 group-has-data-horizontal/field:text-balance last:mt-0 nth-last-2:-mt-1',\n '[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldSeparator({ children, className, ...props }: FieldSeparatorProps) {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn('-my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2 relative', className)}\n {...props}\n >\n <Separator className=\"absolute inset-0 top-1/2\" />\n {children && (\n <span\n className=\"text-muted-foreground px-2 bg-background relative mx-auto block w-fit\"\n data-slot=\"field-separator-content\"\n >\n {children}\n </span>\n )}\n </div>\n )\n}\n\nfunction FieldError({ className, children, errors, ...props }: FieldErrorProps) {\n const content = useMemo(() => {\n if (children) {\n return children\n }\n\n if (!errors?.length) {\n return null\n }\n\n const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()]\n\n if (uniqueErrors?.length === 1) {\n return uniqueErrors[0]?.message\n }\n\n return (\n <ul className=\"ml-4 flex list-disc flex-col gap-1\">\n {uniqueErrors.map((error) => error?.message && <li key={error.message}>{error.message}</li>)}\n </ul>\n )\n }, [children, errors])\n\n if (!content) {\n return null\n }\n\n return (\n <div\n role=\"alert\"\n data-slot=\"field-error\"\n className={cn('text-destructive text-sm font-normal', className)}\n {...props}\n >\n {content}\n </div>\n )\n}\n\nexport {\n Field,\n FieldContent,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLabel,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldTitle,\n useFieldControlId\n}\n"],"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,UAAW,EAAG,uCAAwC,CAAS,EAC/D,GAAI,EAEH,SAAA,CACE,CAAA,EAXE,IAaX"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./rolldown-runtime-Bdj-bS2b.js";import{t as e}from"./utils-DP9KtG7I.js";import{jsx as t}from"react/jsx-runtime";import{cva as n}from"class-variance-authority";const r=n(`flex min-w-0`,{variants:{direction:{row:`flex-row`,"row-reverse":`flex-row-reverse`,column:`flex-col`,"column-reverse":`flex-col-reverse`},align:{start:`items-start`,end:`items-end`,center:`items-center`,baseline:`items-baseline`,stretch:`items-stretch`},justify:{start:`justify-start`,end:`justify-end`,center:`justify-center`,between:`justify-between`,around:`justify-around`,evenly:`justify-evenly`},wrap:{true:`flex-wrap`,false:`flex-nowrap`},gap:{xs:`gap-1`,sm:`gap-2`,md:`gap-4`,lg:`gap-6`,xl:`gap-8`}},defaultVariants:{direction:`row`,wrap:!1}});function Flex({className:n,direction:i=`row`,align:a,justify:o,wrap:s=!1,gap:c,...l}){return t(`div`,{"data-slot":`flex`,"data-direction":i,"data-align":a,"data-justify":o,"data-wrap":s?`true`:`false`,"data-gap":c,className:e(r({direction:i,align:a,justify:o,wrap:s,gap:c}),n),...l})}export{r as n,Flex as t};
|
|
2
|
+
//# sourceMappingURL=flex-BC4Diiy4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flex-BC4Diiy4.js","names":[],"sources":["../src/components/flex.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '../lib/utils'\n\nconst flexVariants = cva('flex min-w-0', {\n variants: {\n direction: {\n row: 'flex-row',\n 'row-reverse': 'flex-row-reverse',\n column: 'flex-col',\n 'column-reverse': 'flex-col-reverse'\n },\n align: {\n start: 'items-start',\n end: 'items-end',\n center: 'items-center',\n baseline: 'items-baseline',\n stretch: 'items-stretch'\n },\n justify: {\n start: 'justify-start',\n end: 'justify-end',\n center: 'justify-center',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly'\n },\n wrap: {\n true: 'flex-wrap',\n false: 'flex-nowrap'\n },\n gap: {\n xs: 'gap-1',\n sm: 'gap-2',\n md: 'gap-4',\n lg: 'gap-6',\n xl: 'gap-8'\n }\n },\n defaultVariants: {\n direction: 'row',\n wrap: false\n }\n})\n\nexport type FlexProps = React.ComponentProps<'div'> & VariantProps<typeof flexVariants>\n\nfunction Flex({ className, direction = 'row', align, justify, wrap = false, gap, ...props }: FlexProps) {\n return (\n <div\n data-slot=\"flex\"\n data-direction={direction}\n data-align={align}\n data-justify={justify}\n data-wrap={wrap ? 'true' : 'false'}\n data-gap={gap}\n className={cn(flexVariants({ direction, align, justify, wrap, gap }), className)}\n {...props}\n />\n )\n}\n\nexport { Flex, flexVariants }\n"],"mappings":"sKAMA,MAAM,EAAe,EAAI,eAAgB,CACvC,SAAU,CACR,UAAW,CACT,IAAK,WACL,cAAe,mBACf,OAAQ,WACR,iBAAkB,kBACpB,EACA,MAAO,CACL,MAAO,cACP,IAAK,YACL,OAAQ,eACR,SAAU,iBACV,QAAS,eACX,EACA,QAAS,CACP,MAAO,gBACP,IAAK,cACL,OAAQ,iBACR,QAAS,kBACT,OAAQ,iBACR,OAAQ,gBACV,EACA,KAAM,CACJ,KAAM,YACN,MAAO,aACT,EACA,IAAK,CACH,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,OACN,CACF,EACA,gBAAiB,CACf,UAAW,MACX,KAAM,EACR,CACF,CAAC,EAID,SAAS,KAAK,CAAE,YAAW,YAAY,MAAO,QAAO,UAAS,OAAO,GAAO,MAAK,GAAG,GAAoB,CACtG,OACE,EAAC,MAAD,CACE,YAAU,OACV,iBAAgB,EAChB,aAAY,EACZ,eAAc,EACd,YAAW,EAAO,OAAS,QAC3B,WAAU,EACV,UAAW,EAAG,EAAa,CAAE,YAAW,QAAO,UAAS,OAAM,KAAI,CAAC,EAAG,CAAS,EAC/E,GAAI,CACL,CAAA,CAEL"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { n as __name } from "./rolldown-runtime-Bdj-bS2b.js";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
//#region src/components/flex.d.ts
|
|
5
|
+
declare const flexVariants: (props?: ({
|
|
6
|
+
direction?: "column" | "column-reverse" | "row" | "row-reverse" | null | undefined;
|
|
7
|
+
align?: "baseline" | "center" | "end" | "start" | "stretch" | null | undefined;
|
|
8
|
+
justify?: "around" | "between" | "center" | "end" | "evenly" | "start" | null | undefined;
|
|
9
|
+
wrap?: boolean | null | undefined;
|
|
10
|
+
gap?: "lg" | "md" | "sm" | "xl" | "xs" | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
|
+
type FlexProps = React.ComponentProps<'div'> & VariantProps<typeof flexVariants>;
|
|
13
|
+
declare function Flex({ className, direction, align, justify, wrap, gap, ...props }: FlexProps): React.JSX.Element;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { FlexProps as n, flexVariants as r, Flex as t };
|
|
16
|
+
//# sourceMappingURL=flex-aJXipTAz.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./rolldown-runtime-Bdj-bS2b.js";import{t as e}from"./utils-DP9KtG7I.js";import{jsx as t}from"react/jsx-runtime";const n={xs:1,sm:2,md:4,lg:6,xl:8};function toSpacingValue(e){return`calc(var(--spacing) * ${n[e]})`}function Grid({className:n,gap:r,rowGap:i,columnGap:a,templateRows:o,templateColumns:s=`repeat(12, minmax(0, 1fr))`,style:c,...l}){return t(`div`,{"data-slot":`grid`,className:e(`grid min-w-0`,`grid-cols-(--grid-template-columns) grid-rows-(--grid-template-rows)`,`gap-(--grid-gap) gap-y-(--grid-row-gap) gap-x-(--grid-column-gap)`,n),style:{"--grid-template-columns":s,"--grid-template-rows":o,"--grid-gap":r?toSpacingValue(r):`0px`,"--grid-row-gap":i?toSpacingValue(i):`var(--grid-gap)`,"--grid-column-gap":a?toSpacingValue(a):`var(--grid-gap)`,...c},...l})}function GridItem({className:n,rowSpan:r,colSpan:i=12,style:a,...o}){return t(`div`,{"data-slot":`grid-item`,className:e(`min-w-0`,`col-[span_var(--grid-item-col-span)/span_var(--grid-item-col-span)]`,`row-[span_var(--grid-item-row-span)/span_var(--grid-item-row-span)]`,n),style:{"--grid-item-col-span":i,"--grid-item-row-span":r,...a},...o})}export{GridItem as n,Grid as t};
|
|
2
|
+
//# sourceMappingURL=grid-B3He1bGe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-B3He1bGe.js","names":[],"sources":["../src/components/grid.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cn } from '../lib/utils'\n\ntype GridSpacing = 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n\nconst spacingScale: Record<GridSpacing, number> = {\n xs: 1,\n sm: 2,\n md: 4,\n lg: 6,\n xl: 8\n}\n\nfunction toSpacingValue(spacing: GridSpacing) {\n return `calc(var(--spacing) * ${spacingScale[spacing]})`\n}\n\nexport type GridProps = React.ComponentProps<'div'> & {\n gap?: GridSpacing\n rowGap?: GridSpacing\n columnGap?: GridSpacing\n templateRows?: string\n templateColumns?: string\n}\n\nfunction Grid({\n className,\n gap,\n rowGap,\n columnGap,\n templateRows,\n templateColumns = 'repeat(12, minmax(0, 1fr))',\n style,\n ...props\n}: GridProps) {\n return (\n <div\n data-slot=\"grid\"\n className={cn(\n 'grid min-w-0',\n 'grid-cols-(--grid-template-columns) grid-rows-(--grid-template-rows)',\n 'gap-(--grid-gap) gap-y-(--grid-row-gap) gap-x-(--grid-column-gap)',\n className\n )}\n style={\n {\n '--grid-template-columns': templateColumns,\n '--grid-template-rows': templateRows,\n '--grid-gap': gap ? toSpacingValue(gap) : '0px',\n '--grid-row-gap': rowGap ? toSpacingValue(rowGap) : 'var(--grid-gap)',\n '--grid-column-gap': columnGap ? toSpacingValue(columnGap) : 'var(--grid-gap)',\n ...style\n } as React.CSSProperties\n }\n {...props}\n />\n )\n}\n\nexport type GridItemProps = React.ComponentProps<'div'> & {\n rowSpan?: number\n colSpan?: number\n}\n\nfunction GridItem({ className, rowSpan, colSpan = 12, style, ...props }: GridItemProps) {\n return (\n <div\n data-slot=\"grid-item\"\n className={cn(\n 'min-w-0',\n 'col-[span_var(--grid-item-col-span)/span_var(--grid-item-col-span)]',\n 'row-[span_var(--grid-item-row-span)/span_var(--grid-item-row-span)]',\n className\n )}\n style={\n {\n '--grid-item-col-span': colSpan,\n '--grid-item-row-span': rowSpan,\n ...style\n } as React.CSSProperties\n }\n {...props}\n />\n )\n}\n\nexport { Grid, GridItem }\n"],"mappings":"uHAMA,MAAM,EAA4C,CAChD,GAAI,EACJ,GAAI,EACJ,GAAI,EACJ,GAAI,EACJ,GAAI,CACN,EAEA,SAAS,eAAe,EAAsB,CAC5C,MAAO,yBAAyB,EAAa,GAAS,EACxD,CAUA,SAAS,KAAK,CACZ,YACA,MACA,SACA,YACA,eACA,kBAAkB,6BAClB,QACA,GAAG,GACS,CACZ,OACE,EAAC,MAAD,CACE,YAAU,OACV,UAAW,EACT,eACA,uEACA,oEACA,CACF,EACA,MACE,CACE,0BAA2B,EAC3B,uBAAwB,EACxB,aAAc,EAAM,eAAe,CAAG,EAAI,MAC1C,iBAAkB,EAAS,eAAe,CAAM,EAAI,kBACpD,oBAAqB,EAAY,eAAe,CAAS,EAAI,kBAC7D,GAAG,CACL,EAEF,GAAI,CACL,CAAA,CAEL,CAOA,SAAS,SAAS,CAAE,YAAW,UAAS,UAAU,GAAI,QAAO,GAAG,GAAwB,CACtF,OACE,EAAC,MAAD,CACE,YAAU,YACV,UAAW,EACT,UACA,sEACA,sEACA,CACF,EACA,MACE,CACE,uBAAwB,EACxB,uBAAwB,EACxB,GAAG,CACL,EAEF,GAAI,CACL,CAAA,CAEL"}
|