@uselets/ui 1.18.4 → 1.18.6
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 +1 -1
- package/dist/{chart-CVe5-EWS.d.ts → chart-B_6nC_ih.d.ts} +2 -2
- package/dist/cli/uselets.mjs.map +1 -1
- package/dist/components/accordion.d.ts +15 -2
- package/dist/components/accordion.js +2 -1
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert-dialog.d.ts +34 -2
- package/dist/components/alert-dialog.js +2 -1
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert.d.ts +18 -2
- package/dist/components/alert.js +2 -1
- package/dist/components/alert.js.map +1 -0
- package/dist/components/anchor.d.ts +15 -2
- package/dist/components/anchor.js +2 -1
- package/dist/components/anchor.js.map +1 -0
- package/dist/components/area-chart.d.ts +40 -2
- package/dist/components/area-chart.js +2 -1
- package/dist/components/area-chart.js.map +1 -0
- package/dist/components/avatar.d.ts +21 -2
- package/dist/components/avatar.js +2 -1
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +16 -2
- package/dist/components/badge.js +2 -1
- package/dist/components/badge.js.map +1 -0
- package/dist/components/bar-chart.d.ts +42 -2
- package/dist/components/bar-chart.js +2 -1
- package/dist/components/bar-chart.js.map +1 -0
- package/dist/components/breadcrumb.d.ts +22 -2
- package/dist/components/breadcrumb.js +2 -1
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/button-group.d.ts +18 -2
- package/dist/components/button-group.js +2 -1
- package/dist/components/button-group.js.map +1 -0
- package/dist/components/button.d.ts +17 -2
- package/dist/components/button.js +2 -1
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.d.ts +17 -2
- package/dist/components/calendar.js +2 -1
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.d.ts +22 -2
- package/dist/components/card.js +2 -1
- package/dist/components/card.js.map +1 -0
- package/dist/components/carousel.d.ts +43 -2
- package/dist/components/carousel.js +2 -1
- package/dist/components/carousel.js.map +1 -0
- package/dist/components/center.d.ts +13 -2
- package/dist/components/center.js +2 -1
- package/dist/components/center.js.map +1 -0
- package/dist/components/chart.d.ts +1 -1
- package/dist/components/chart.js +8 -1
- package/dist/components/chart.js.map +1 -0
- package/dist/components/checkbox.d.ts +21 -2
- package/dist/components/checkbox.js +2 -1
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/code.d.ts +8 -2
- package/dist/components/code.js +2 -1
- package/dist/components/code.js.map +1 -0
- package/dist/components/collapsible.d.ts +12 -2
- package/dist/components/collapsible.js +2 -1
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/combobox.d.ts +51 -2
- package/dist/components/combobox.js +2 -1
- package/dist/components/combobox.js.map +1 -0
- package/dist/components/command.d.ts +31 -2
- package/dist/components/command.js +2 -1
- package/dist/components/command.js.map +1 -0
- package/dist/components/container.d.ts +12 -2
- package/dist/components/container.js +2 -1
- package/dist/components/container.js.map +1 -0
- package/dist/components/data-table.d.ts +1 -1
- package/dist/components/data-table.js +2 -1
- package/dist/components/data-table.js.map +1 -0
- package/dist/components/date-range-picker.d.ts +55 -3
- package/dist/components/date-range-picker.js +2 -1
- package/dist/components/date-range-picker.js.map +1 -0
- package/dist/components/dialog.d.ts +42 -2
- package/dist/components/dialog.js +2 -1
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/donut-chart.d.ts +13 -2
- package/dist/components/donut-chart.js +2 -1
- package/dist/components/donut-chart.js.map +1 -0
- package/dist/components/drawer.d.ts +43 -2
- package/dist/components/drawer.js +2 -1
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +48 -2
- package/dist/components/dropdown-menu.js +2 -1
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/dropzone.d.ts +102 -2
- package/dist/components/dropzone.js +2 -1
- package/dist/components/dropzone.js.map +1 -0
- package/dist/components/empty.d.ts +21 -2
- package/dist/components/empty.js +2 -1
- package/dist/components/empty.js.map +1 -0
- package/dist/components/field.d.ts +39 -2
- package/dist/components/field.js +2 -1
- package/dist/components/field.js.map +1 -0
- package/dist/components/flex.d.ts +16 -2
- package/dist/components/flex.js +2 -1
- package/dist/components/flex.js.map +1 -0
- package/dist/components/grid.d.ts +20 -2
- package/dist/components/grid.js +2 -1
- package/dist/components/grid.js.map +1 -0
- package/dist/components/group.d.ts +15 -2
- package/dist/components/group.js +2 -1
- package/dist/components/group.js.map +1 -0
- package/dist/components/heading.d.ts +14 -2
- package/dist/components/heading.js +2 -1
- package/dist/components/heading.js.map +1 -0
- package/dist/components/hover-card.d.ts +13 -2
- package/dist/components/hover-card.js +2 -1
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/input-group.d.ts +26 -2
- package/dist/components/input-group.js +2 -1
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input-otp.d.ts +19 -2
- package/dist/components/input-otp.js +2 -1
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/input.d.ts +8 -2
- package/dist/components/input.js +2 -1
- package/dist/components/input.js.map +1 -0
- package/dist/components/kbd.d.ts +10 -2
- package/dist/components/kbd.js +2 -1
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/label.d.ts +9 -2
- package/dist/components/label.js +2 -1
- package/dist/components/label.js.map +1 -0
- package/dist/components/list.d.ts +25 -2
- package/dist/components/list.js +2 -1
- package/dist/components/list.js.map +1 -0
- package/dist/components/logo.d.ts +69 -2
- package/dist/components/logo.js +1 -1
- package/dist/components/marker.d.ts +18 -2
- package/dist/components/marker.js +2 -1
- package/dist/components/marker.js.map +1 -0
- package/dist/components/mask-input.d.ts +16 -2
- package/dist/components/mask-input.js +2 -1
- package/dist/components/mask-input.js.map +1 -0
- package/dist/components/native-select.d.ts +14 -2
- package/dist/components/native-select.js +2 -1
- package/dist/components/native-select.js.map +1 -0
- package/dist/components/navigation-menu.d.ts +26 -2
- package/dist/components/navigation-menu.js +2 -1
- package/dist/components/navigation-menu.js.map +1 -0
- package/dist/components/number-field.d.ts +35 -2
- package/dist/components/number-field.js +2 -1
- package/dist/components/number-field.js.map +1 -0
- package/dist/components/pagination.d.ts +27 -2
- package/dist/components/pagination.js +2 -1
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/phone-input.d.ts +13 -2
- package/dist/components/phone-input.js +2 -1
- package/dist/components/phone-input.js.map +1 -0
- package/dist/components/pie-chart.d.ts +42 -2
- package/dist/components/pie-chart.js +2 -1
- package/dist/components/pie-chart.js.map +1 -0
- package/dist/components/popover.d.ts +21 -2
- package/dist/components/popover.js +2 -1
- package/dist/components/popover.js.map +1 -0
- package/dist/components/progress.d.ts +14 -2
- package/dist/components/progress.js +2 -1
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-group.d.ts +25 -2
- package/dist/components/radio-group.js +2 -1
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/resizable.d.ts +14 -2
- package/dist/components/resizable.js +2 -1
- package/dist/components/resizable.js.map +1 -0
- package/dist/components/ring-progress.d.ts +17 -2
- package/dist/components/ring-progress.js +2 -1
- package/dist/components/ring-progress.js.map +1 -0
- package/dist/components/scroll-area.d.ts +11 -2
- package/dist/components/scroll-area.js +2 -1
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/select.d.ts +29 -2
- package/dist/components/select.js +2 -1
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.d.ts +9 -2
- package/dist/components/separator.js +2 -1
- package/dist/components/separator.js.map +1 -0
- package/dist/components/sidebar.d.ts +96 -2
- package/dist/components/sidebar.js +2 -1
- package/dist/components/sidebar.js.map +1 -0
- package/dist/components/simple-grid.d.ts +14 -2
- package/dist/components/simple-grid.js +2 -1
- package/dist/components/simple-grid.js.map +1 -0
- package/dist/components/skeleton.d.ts +10 -2
- package/dist/components/skeleton.js +2 -1
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/slider.d.ts +9 -2
- package/dist/components/slider.js +2 -1
- package/dist/components/slider.js.map +1 -0
- package/dist/components/sonner.d.ts +8 -2
- package/dist/components/sonner.js +2 -1
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/spinner.d.ts +12 -2
- package/dist/components/spinner.js +2 -1
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/stack.d.ts +14 -2
- package/dist/components/stack.js +2 -1
- package/dist/components/stack.js.map +1 -0
- package/dist/components/stepper.d.ts +71 -2
- package/dist/components/stepper.js +2 -1
- package/dist/components/stepper.js.map +1 -0
- package/dist/components/switch.d.ts +17 -2
- package/dist/components/switch.js +2 -1
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.d.ts +33 -2
- package/dist/components/table.js +2 -1
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +21 -2
- package/dist/components/tabs.js +2 -1
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/text.d.ts +14 -2
- package/dist/components/text.js +2 -1
- package/dist/components/text.js.map +1 -0
- package/dist/components/textarea.d.ts +8 -2
- package/dist/components/textarea.js +2 -1
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/theme.d.ts +22 -2
- package/dist/components/theme.js +2 -1
- package/dist/components/theme.js.map +1 -0
- package/dist/components/timeline.d.ts +61 -2
- package/dist/components/timeline.js +2 -1
- package/dist/components/timeline.js.map +1 -0
- package/dist/components/toggle-group.d.ts +16 -2
- package/dist/components/toggle-group.js +2 -1
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.d.ts +15 -2
- package/dist/components/toggle.js +2 -1
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/tooltip.d.ts +21 -2
- package/dist/components/tooltip.js +2 -1
- package/dist/components/tooltip.js.map +1 -0
- package/dist/components/unstyled-button.d.ts +10 -2
- package/dist/components/unstyled-button.js +2 -1
- package/dist/components/unstyled-button.js.map +1 -0
- package/dist/components/visibility.d.ts +17 -2
- package/dist/components/visibility.js +2 -1
- package/dist/components/visibility.js.map +1 -0
- package/dist/{data-table-DXNWHN9R.d.ts → data-table-DWWVGWbU.d.ts} +4 -4
- package/dist/hooks/use-breakpoint-value.d.ts +8 -2
- package/dist/hooks/use-breakpoint-value.js +2 -1
- package/dist/hooks/use-breakpoint-value.js.map +1 -0
- package/dist/hooks/use-breakpoint.d.ts +8 -2
- package/dist/hooks/use-breakpoint.js +2 -1
- package/dist/hooks/use-breakpoint.js.map +1 -0
- package/dist/hooks/use-disclosure.d.ts +22 -2
- package/dist/hooks/use-disclosure.js +2 -1
- package/dist/hooks/use-disclosure.js.map +1 -0
- package/dist/hooks/use-document-visibility.d.ts +6 -2
- package/dist/hooks/use-document-visibility.js +2 -1
- package/dist/hooks/use-document-visibility.js.map +1 -0
- package/dist/hooks/use-hotkeys.d.ts +1 -1
- package/dist/hooks/use-hotkeys.js +1 -1
- package/dist/hooks/use-idle.d.ts +13 -2
- package/dist/hooks/use-idle.js +2 -1
- package/dist/hooks/use-idle.js.map +1 -0
- package/dist/hooks/use-interval.d.ts +24 -2
- package/dist/hooks/use-interval.js +2 -1
- package/dist/hooks/use-interval.js.map +1 -0
- package/dist/hooks/use-local-storage.d.ts +16 -2
- package/dist/hooks/use-local-storage.js +2 -1
- package/dist/hooks/use-local-storage.js.map +1 -0
- package/dist/hooks/use-mask.d.ts +8 -2
- package/dist/hooks/use-mask.js +2 -1
- package/dist/hooks/use-mask.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +6 -2
- package/dist/hooks/use-mobile.js +2 -1
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/index.d.ts +95 -95
- package/dist/index.js +1 -1
- package/dist/lib/badge.d.ts +19 -2
- package/dist/lib/badge.js +2 -1
- package/dist/lib/badge.js.map +1 -0
- package/dist/lib/button.d.ts +19 -2
- package/dist/lib/button.js +2 -1
- package/dist/lib/button.js.map +1 -0
- package/dist/lib/color.d.ts +19 -2
- package/dist/lib/color.js +2 -1
- package/dist/lib/color.js.map +1 -0
- package/dist/lib/compose-refs.d.ts +8 -2
- package/dist/lib/compose-refs.js +2 -1
- package/dist/lib/compose-refs.js.map +1 -0
- package/dist/lib/progress.d.ts +19 -2
- package/dist/lib/progress.js +2 -1
- package/dist/lib/progress.js.map +1 -0
- package/dist/lib/utils.d.ts +7 -2
- package/dist/lib/utils.js +2 -1
- package/dist/lib/utils.js.map +1 -0
- package/dist/logo-B0thHtTS.js +2 -0
- package/dist/{logo-BkwNxZNw.js.map → logo-B0thHtTS.js.map} +1 -1
- package/dist/rolldown-runtime-BhWHdk3m.js +1 -0
- package/dist/skills/uselets-ui/references/package-guide.md +1 -1
- package/dist/styles/base.css +1 -19
- package/dist/styles/globals.css +1 -2
- package/dist/themes/gomax.css +1 -2
- package/dist/themes/max.css +1 -2
- package/dist/{use-hotkeys-DloZH-B4.d.ts → use-hotkeys-DOjcX9Tt.d.ts} +2 -2
- package/dist/{use-hotkeys-C0d5t4yo.js → use-hotkeys-YDJmGWX6.js} +2 -2
- package/dist/{use-hotkeys-C0d5t4yo.js.map → use-hotkeys-YDJmGWX6.js.map} +1 -1
- package/package.json +17 -18
- package/skills/uselets-ui/references/package-guide.md +1 -1
- package/dist/accordion-BCo2odjy.js +0 -2
- package/dist/accordion-BCo2odjy.js.map +0 -1
- package/dist/accordion-DtSr3uiA.d.ts +0 -15
- package/dist/alert-CJRgRQVF.js +0 -2
- package/dist/alert-CJRgRQVF.js.map +0 -1
- package/dist/alert-dialog-B_nAiD4Y.js +0 -2
- package/dist/alert-dialog-B_nAiD4Y.js.map +0 -1
- package/dist/alert-dialog-Bf41-OnT.d.ts +0 -34
- package/dist/alert-eivgSC_S.d.ts +0 -18
- package/dist/anchor-DCOyn0Xa.d.ts +0 -15
- package/dist/anchor-srhmShjN.js +0 -2
- package/dist/anchor-srhmShjN.js.map +0 -1
- package/dist/area-chart-DdDy8Vm3.js +0 -2
- package/dist/area-chart-DdDy8Vm3.js.map +0 -1
- package/dist/area-chart-F_4ZL20j.d.ts +0 -40
- package/dist/avatar-2ZS3Tx76.d.ts +0 -21
- package/dist/avatar-CFUwrOwG.js +0 -2
- package/dist/avatar-CFUwrOwG.js.map +0 -1
- package/dist/badge-BqpQcDFd.d.ts +0 -16
- package/dist/badge-Cuq_DqRS.js +0 -2
- package/dist/badge-Cuq_DqRS.js.map +0 -1
- package/dist/badge-DEgLmZYC.js +0 -2
- package/dist/badge-DEgLmZYC.js.map +0 -1
- package/dist/badge-gkezuSZY.d.ts +0 -19
- package/dist/bar-chart-DIgSnh_j.js +0 -2
- package/dist/bar-chart-DIgSnh_j.js.map +0 -1
- package/dist/bar-chart-DRrrfMQR.d.ts +0 -42
- package/dist/breadcrumb-CqNDAI8V.js +0 -2
- package/dist/breadcrumb-CqNDAI8V.js.map +0 -1
- package/dist/breadcrumb-DZFS9htN.d.ts +0 -22
- package/dist/button-BNGy28pv.d.ts +0 -17
- package/dist/button-CQbH5Glc.d.ts +0 -19
- package/dist/button-DGewx2nE.js +0 -2
- package/dist/button-DGewx2nE.js.map +0 -1
- package/dist/button-group-DRgqsyjS.d.ts +0 -18
- package/dist/button-group-WJ5LeouK.js +0 -2
- package/dist/button-group-WJ5LeouK.js.map +0 -1
- package/dist/button-oI3hbOgp.js +0 -2
- package/dist/button-oI3hbOgp.js.map +0 -1
- package/dist/calendar-C1GgjzIA.d.ts +0 -17
- package/dist/calendar-CW1kGXom.js +0 -2
- package/dist/calendar-CW1kGXom.js.map +0 -1
- package/dist/card-Bx6iiocl.js +0 -2
- package/dist/card-Bx6iiocl.js.map +0 -1
- package/dist/card-pWjtkTKw.d.ts +0 -22
- package/dist/carousel-C6e4eRJD.d.ts +0 -43
- package/dist/carousel-D0OTImO7.js +0 -2
- package/dist/carousel-D0OTImO7.js.map +0 -1
- package/dist/center-CFQDr205.d.ts +0 -13
- package/dist/center-Dl1rnq7S.js +0 -2
- package/dist/center-Dl1rnq7S.js.map +0 -1
- package/dist/chart-Ci4V8B8v.js +0 -8
- package/dist/chart-Ci4V8B8v.js.map +0 -1
- package/dist/checkbox-DPvW_m7k.js +0 -2
- package/dist/checkbox-DPvW_m7k.js.map +0 -1
- package/dist/checkbox-y0XBdH4a.d.ts +0 -21
- package/dist/code-A6JERAsm.js +0 -2
- package/dist/code-A6JERAsm.js.map +0 -1
- package/dist/code-Cqoacc61.d.ts +0 -8
- package/dist/collapsible-BH8BqfTd.js +0 -2
- package/dist/collapsible-BH8BqfTd.js.map +0 -1
- package/dist/collapsible-CLSCZ630.d.ts +0 -12
- package/dist/color-DJvQFSl5.d.ts +0 -19
- package/dist/color-Don4qaht.js +0 -2
- package/dist/color-Don4qaht.js.map +0 -1
- package/dist/combobox-D-WRdpkq.js +0 -2
- package/dist/combobox-D-WRdpkq.js.map +0 -1
- package/dist/combobox-DkCRXUxd.d.ts +0 -51
- package/dist/command-BjWXeORj.js +0 -2
- package/dist/command-BjWXeORj.js.map +0 -1
- package/dist/command-D4pNOx0J.d.ts +0 -31
- package/dist/components/accordion.spec.d.ts +0 -1
- package/dist/components/accordion.spec.js +0 -2
- package/dist/components/accordion.spec.js.map +0 -1
- package/dist/components/alert-dialog.spec.d.ts +0 -1
- package/dist/components/alert-dialog.spec.js +0 -2
- package/dist/components/alert-dialog.spec.js.map +0 -1
- package/dist/components/alert.spec.d.ts +0 -1
- package/dist/components/alert.spec.js +0 -2
- package/dist/components/alert.spec.js.map +0 -1
- package/dist/components/anchor.spec.d.ts +0 -1
- package/dist/components/anchor.spec.js +0 -2
- package/dist/components/anchor.spec.js.map +0 -1
- package/dist/components/area-chart.spec.d.ts +0 -1
- package/dist/components/area-chart.spec.js +0 -2
- package/dist/components/area-chart.spec.js.map +0 -1
- package/dist/components/avatar.spec.d.ts +0 -1
- package/dist/components/avatar.spec.js +0 -2
- package/dist/components/avatar.spec.js.map +0 -1
- package/dist/components/badge.spec.d.ts +0 -1
- package/dist/components/badge.spec.js +0 -2
- package/dist/components/badge.spec.js.map +0 -1
- package/dist/components/bar-chart.spec.d.ts +0 -1
- package/dist/components/bar-chart.spec.js +0 -2
- package/dist/components/bar-chart.spec.js.map +0 -1
- package/dist/components/breadcrumb.spec.d.ts +0 -1
- package/dist/components/breadcrumb.spec.js +0 -2
- package/dist/components/breadcrumb.spec.js.map +0 -1
- package/dist/components/button-group.spec.d.ts +0 -1
- package/dist/components/button-group.spec.js +0 -2
- package/dist/components/button-group.spec.js.map +0 -1
- package/dist/components/button.spec.d.ts +0 -1
- package/dist/components/button.spec.js +0 -2
- package/dist/components/button.spec.js.map +0 -1
- package/dist/components/calendar.spec.d.ts +0 -1
- package/dist/components/calendar.spec.js +0 -2
- package/dist/components/calendar.spec.js.map +0 -1
- package/dist/components/card.spec.d.ts +0 -1
- package/dist/components/card.spec.js +0 -2
- package/dist/components/card.spec.js.map +0 -1
- package/dist/components/carousel.spec.d.ts +0 -1
- package/dist/components/carousel.spec.js +0 -2
- package/dist/components/carousel.spec.js.map +0 -1
- package/dist/components/center.spec.d.ts +0 -1
- package/dist/components/center.spec.js +0 -2
- package/dist/components/center.spec.js.map +0 -1
- package/dist/components/chart.spec.d.ts +0 -1
- package/dist/components/chart.spec.js +0 -2
- package/dist/components/chart.spec.js.map +0 -1
- package/dist/components/checkbox.spec.d.ts +0 -1
- package/dist/components/checkbox.spec.js +0 -2
- package/dist/components/checkbox.spec.js.map +0 -1
- package/dist/components/code.spec.d.ts +0 -1
- package/dist/components/code.spec.js +0 -2
- package/dist/components/code.spec.js.map +0 -1
- package/dist/components/collapsible.spec.d.ts +0 -1
- package/dist/components/collapsible.spec.js +0 -2
- package/dist/components/collapsible.spec.js.map +0 -1
- package/dist/components/combobox.spec.d.ts +0 -1
- package/dist/components/combobox.spec.js +0 -2
- package/dist/components/combobox.spec.js.map +0 -1
- package/dist/components/command.spec.d.ts +0 -1
- package/dist/components/command.spec.js +0 -2
- package/dist/components/command.spec.js.map +0 -1
- package/dist/components/container.spec.d.ts +0 -1
- package/dist/components/container.spec.js +0 -2
- package/dist/components/container.spec.js.map +0 -1
- package/dist/components/data-table.spec.d.ts +0 -1
- package/dist/components/data-table.spec.js +0 -2
- package/dist/components/data-table.spec.js.map +0 -1
- package/dist/components/date-range-picker.spec.d.ts +0 -1
- package/dist/components/date-range-picker.spec.js +0 -2
- package/dist/components/date-range-picker.spec.js.map +0 -1
- package/dist/components/dialog.spec.d.ts +0 -1
- package/dist/components/dialog.spec.js +0 -2
- package/dist/components/dialog.spec.js.map +0 -1
- package/dist/components/donut-chart.spec.d.ts +0 -1
- package/dist/components/donut-chart.spec.js +0 -2
- package/dist/components/donut-chart.spec.js.map +0 -1
- package/dist/components/drawer.spec.d.ts +0 -1
- package/dist/components/drawer.spec.js +0 -2
- package/dist/components/drawer.spec.js.map +0 -1
- package/dist/components/dropdown-menu.spec.d.ts +0 -1
- package/dist/components/dropdown-menu.spec.js +0 -2
- package/dist/components/dropdown-menu.spec.js.map +0 -1
- package/dist/components/dropzone.spec.d.ts +0 -1
- package/dist/components/dropzone.spec.js +0 -2
- package/dist/components/dropzone.spec.js.map +0 -1
- package/dist/components/empty.spec.d.ts +0 -1
- package/dist/components/empty.spec.js +0 -2
- package/dist/components/empty.spec.js.map +0 -1
- package/dist/components/field.spec.d.ts +0 -1
- package/dist/components/field.spec.js +0 -2
- package/dist/components/field.spec.js.map +0 -1
- package/dist/components/flex.spec.d.ts +0 -1
- package/dist/components/flex.spec.js +0 -2
- package/dist/components/flex.spec.js.map +0 -1
- package/dist/components/grid.spec.d.ts +0 -1
- package/dist/components/grid.spec.js +0 -2
- package/dist/components/grid.spec.js.map +0 -1
- package/dist/components/group.spec.d.ts +0 -1
- package/dist/components/group.spec.js +0 -2
- package/dist/components/group.spec.js.map +0 -1
- package/dist/components/heading.spec.d.ts +0 -1
- package/dist/components/heading.spec.js +0 -2
- package/dist/components/heading.spec.js.map +0 -1
- package/dist/components/hover-card.spec.d.ts +0 -1
- package/dist/components/hover-card.spec.js +0 -2
- package/dist/components/hover-card.spec.js.map +0 -1
- package/dist/components/input-group.spec.d.ts +0 -1
- package/dist/components/input-group.spec.js +0 -2
- package/dist/components/input-group.spec.js.map +0 -1
- package/dist/components/input-otp.spec.d.ts +0 -1
- package/dist/components/input-otp.spec.js +0 -2
- package/dist/components/input-otp.spec.js.map +0 -1
- package/dist/components/input.spec.d.ts +0 -1
- package/dist/components/input.spec.js +0 -2
- package/dist/components/input.spec.js.map +0 -1
- package/dist/components/kbd.spec.d.ts +0 -1
- package/dist/components/kbd.spec.js +0 -2
- package/dist/components/kbd.spec.js.map +0 -1
- package/dist/components/label.spec.d.ts +0 -1
- package/dist/components/label.spec.js +0 -2
- package/dist/components/label.spec.js.map +0 -1
- package/dist/components/list.spec.d.ts +0 -1
- package/dist/components/list.spec.js +0 -2
- package/dist/components/list.spec.js.map +0 -1
- package/dist/components/logo.spec.d.ts +0 -1
- package/dist/components/logo.spec.js +0 -2
- package/dist/components/logo.spec.js.map +0 -1
- package/dist/components/marker.spec.d.ts +0 -1
- package/dist/components/marker.spec.js +0 -2
- package/dist/components/marker.spec.js.map +0 -1
- package/dist/components/mask-input.spec.d.ts +0 -1
- package/dist/components/mask-input.spec.js +0 -2
- package/dist/components/mask-input.spec.js.map +0 -1
- package/dist/components/native-select.spec.d.ts +0 -1
- package/dist/components/native-select.spec.js +0 -2
- package/dist/components/native-select.spec.js.map +0 -1
- package/dist/components/navigation-menu.spec.d.ts +0 -1
- package/dist/components/navigation-menu.spec.js +0 -2
- package/dist/components/navigation-menu.spec.js.map +0 -1
- package/dist/components/number-field.spec.d.ts +0 -1
- package/dist/components/number-field.spec.js +0 -2
- package/dist/components/number-field.spec.js.map +0 -1
- package/dist/components/pagination.spec.d.ts +0 -1
- package/dist/components/pagination.spec.js +0 -2
- package/dist/components/pagination.spec.js.map +0 -1
- package/dist/components/phone-input.spec.d.ts +0 -1
- package/dist/components/phone-input.spec.js +0 -2
- package/dist/components/phone-input.spec.js.map +0 -1
- package/dist/components/pie-chart.spec.d.ts +0 -1
- package/dist/components/pie-chart.spec.js +0 -2
- package/dist/components/pie-chart.spec.js.map +0 -1
- package/dist/components/popover.spec.d.ts +0 -1
- package/dist/components/popover.spec.js +0 -2
- package/dist/components/popover.spec.js.map +0 -1
- package/dist/components/progress.spec.d.ts +0 -1
- package/dist/components/progress.spec.js +0 -2
- package/dist/components/progress.spec.js.map +0 -1
- package/dist/components/radio-group.spec.d.ts +0 -1
- package/dist/components/radio-group.spec.js +0 -2
- package/dist/components/radio-group.spec.js.map +0 -1
- package/dist/components/resizable.spec.d.ts +0 -1
- package/dist/components/resizable.spec.js +0 -2
- package/dist/components/resizable.spec.js.map +0 -1
- package/dist/components/ring-progress.spec.d.ts +0 -1
- package/dist/components/ring-progress.spec.js +0 -2
- package/dist/components/ring-progress.spec.js.map +0 -1
- package/dist/components/scroll-area.spec.d.ts +0 -1
- package/dist/components/scroll-area.spec.js +0 -2
- package/dist/components/scroll-area.spec.js.map +0 -1
- package/dist/components/select.spec.d.ts +0 -1
- package/dist/components/select.spec.js +0 -2
- package/dist/components/select.spec.js.map +0 -1
- package/dist/components/separator.spec.d.ts +0 -1
- package/dist/components/separator.spec.js +0 -2
- package/dist/components/separator.spec.js.map +0 -1
- package/dist/components/sidebar.spec.d.ts +0 -1
- package/dist/components/sidebar.spec.js +0 -2
- package/dist/components/sidebar.spec.js.map +0 -1
- package/dist/components/simple-grid.spec.d.ts +0 -1
- package/dist/components/simple-grid.spec.js +0 -2
- package/dist/components/simple-grid.spec.js.map +0 -1
- package/dist/components/skeleton.spec.d.ts +0 -1
- package/dist/components/skeleton.spec.js +0 -2
- package/dist/components/skeleton.spec.js.map +0 -1
- package/dist/components/slider.spec.d.ts +0 -1
- package/dist/components/slider.spec.js +0 -2
- package/dist/components/slider.spec.js.map +0 -1
- package/dist/components/sonner.spec.d.ts +0 -1
- package/dist/components/sonner.spec.js +0 -2
- package/dist/components/sonner.spec.js.map +0 -1
- package/dist/components/spinner.spec.d.ts +0 -1
- package/dist/components/spinner.spec.js +0 -2
- package/dist/components/spinner.spec.js.map +0 -1
- package/dist/components/stack.spec.d.ts +0 -1
- package/dist/components/stack.spec.js +0 -2
- package/dist/components/stack.spec.js.map +0 -1
- package/dist/components/stepper.spec.d.ts +0 -1
- package/dist/components/stepper.spec.js +0 -2
- package/dist/components/stepper.spec.js.map +0 -1
- package/dist/components/switch.spec.d.ts +0 -1
- package/dist/components/switch.spec.js +0 -2
- package/dist/components/switch.spec.js.map +0 -1
- package/dist/components/table.spec.d.ts +0 -1
- package/dist/components/table.spec.js +0 -2
- package/dist/components/table.spec.js.map +0 -1
- package/dist/components/tabs.spec.d.ts +0 -1
- package/dist/components/tabs.spec.js +0 -2
- package/dist/components/tabs.spec.js.map +0 -1
- package/dist/components/text.spec.d.ts +0 -1
- package/dist/components/text.spec.js +0 -2
- package/dist/components/text.spec.js.map +0 -1
- package/dist/components/textarea.spec.d.ts +0 -1
- package/dist/components/textarea.spec.js +0 -2
- package/dist/components/textarea.spec.js.map +0 -1
- package/dist/components/theme.spec.d.ts +0 -1
- package/dist/components/theme.spec.js +0 -2
- package/dist/components/theme.spec.js.map +0 -1
- package/dist/components/timeline.spec.d.ts +0 -1
- package/dist/components/timeline.spec.js +0 -2
- package/dist/components/timeline.spec.js.map +0 -1
- package/dist/components/toggle-group.spec.d.ts +0 -1
- package/dist/components/toggle-group.spec.js +0 -2
- package/dist/components/toggle-group.spec.js.map +0 -1
- package/dist/components/toggle.spec.d.ts +0 -1
- package/dist/components/toggle.spec.js +0 -2
- package/dist/components/toggle.spec.js.map +0 -1
- package/dist/components/tooltip.spec.d.ts +0 -1
- package/dist/components/tooltip.spec.js +0 -2
- package/dist/components/tooltip.spec.js.map +0 -1
- package/dist/components/unstyled-button.spec.d.ts +0 -1
- package/dist/components/unstyled-button.spec.js +0 -2
- package/dist/components/unstyled-button.spec.js.map +0 -1
- package/dist/components/visibility.spec.d.ts +0 -1
- package/dist/components/visibility.spec.js +0 -2
- package/dist/components/visibility.spec.js.map +0 -1
- package/dist/compose-refs-DUtp7lGn.js +0 -2
- package/dist/compose-refs-DUtp7lGn.js.map +0 -1
- package/dist/compose-refs-GP3zdokU.d.ts +0 -8
- package/dist/container-B8-lt-oX.d.ts +0 -12
- package/dist/container-CikeKdez.js +0 -2
- package/dist/container-CikeKdez.js.map +0 -1
- package/dist/data-table-D-ce4ZKz.js +0 -2
- package/dist/data-table-D-ce4ZKz.js.map +0 -1
- package/dist/date-range-picker-BnRt_P9y.js +0 -2
- package/dist/date-range-picker-BnRt_P9y.js.map +0 -1
- package/dist/date-range-picker-BngvCWcR.d.ts +0 -55
- package/dist/dialog-B7I4Ky1i.js +0 -2
- package/dist/dialog-B7I4Ky1i.js.map +0 -1
- package/dist/dialog-Ej7pnact.d.ts +0 -42
- package/dist/donut-chart-BDJR8TXh.d.ts +0 -13
- package/dist/donut-chart-BHU4kDE6.js +0 -2
- package/dist/donut-chart-BHU4kDE6.js.map +0 -1
- package/dist/drawer-BO4mP6y1.js +0 -2
- package/dist/drawer-BO4mP6y1.js.map +0 -1
- package/dist/drawer-DUfJzrKE.d.ts +0 -43
- package/dist/dropdown-menu-CVDIf0Rd.d.ts +0 -48
- package/dist/dropdown-menu-zRuQQS5S.js +0 -2
- package/dist/dropdown-menu-zRuQQS5S.js.map +0 -1
- package/dist/dropzone-43h3L9Ko.d.ts +0 -102
- package/dist/dropzone-BLZkZThJ.js +0 -2
- package/dist/dropzone-BLZkZThJ.js.map +0 -1
- package/dist/empty-BhKsDYZ5.js +0 -2
- package/dist/empty-BhKsDYZ5.js.map +0 -1
- package/dist/empty-D8ZiTCVK.d.ts +0 -21
- package/dist/field-C209yHO9.d.ts +0 -39
- package/dist/field-DzR-XrO7.js +0 -2
- package/dist/field-DzR-XrO7.js.map +0 -1
- package/dist/flex-BC4Diiy4.js +0 -2
- package/dist/flex-BC4Diiy4.js.map +0 -1
- package/dist/flex-aJXipTAz.d.ts +0 -16
- package/dist/grid-B3He1bGe.js +0 -2
- package/dist/grid-B3He1bGe.js.map +0 -1
- package/dist/grid-D_aEANA7.d.ts +0 -20
- package/dist/group-B6n_lMc4.js +0 -2
- package/dist/group-B6n_lMc4.js.map +0 -1
- package/dist/group-DBtx8eSe.d.ts +0 -15
- package/dist/heading-BTXl4JfI.d.ts +0 -14
- package/dist/heading-DaxKLVRm.js +0 -2
- package/dist/heading-DaxKLVRm.js.map +0 -1
- package/dist/hooks/use-breakpoint-value.spec.d.ts +0 -1
- package/dist/hooks/use-breakpoint-value.spec.js +0 -35
- package/dist/hooks/use-breakpoint-value.spec.js.map +0 -1
- package/dist/hooks/use-breakpoint.spec.d.ts +0 -1
- package/dist/hooks/use-breakpoint.spec.js +0 -2
- package/dist/hooks/use-breakpoint.spec.js.map +0 -1
- package/dist/hooks/use-disclosure.spec.d.ts +0 -1
- package/dist/hooks/use-disclosure.spec.js +0 -2
- package/dist/hooks/use-disclosure.spec.js.map +0 -1
- package/dist/hooks/use-document-visibility.spec.d.ts +0 -1
- package/dist/hooks/use-document-visibility.spec.js +0 -2
- package/dist/hooks/use-document-visibility.spec.js.map +0 -1
- package/dist/hooks/use-hotkeys.spec.d.ts +0 -1
- package/dist/hooks/use-hotkeys.spec.js +0 -2
- package/dist/hooks/use-hotkeys.spec.js.map +0 -1
- package/dist/hooks/use-idle.spec.d.ts +0 -1
- package/dist/hooks/use-idle.spec.js +0 -2
- package/dist/hooks/use-idle.spec.js.map +0 -1
- package/dist/hooks/use-interval.spec.d.ts +0 -1
- package/dist/hooks/use-interval.spec.js +0 -2
- package/dist/hooks/use-interval.spec.js.map +0 -1
- package/dist/hooks/use-local-storage.spec.d.ts +0 -1
- package/dist/hooks/use-local-storage.spec.js +0 -2
- package/dist/hooks/use-local-storage.spec.js.map +0 -1
- package/dist/hooks/use-mask.spec.d.ts +0 -1
- package/dist/hooks/use-mask.spec.js +0 -2
- package/dist/hooks/use-mask.spec.js.map +0 -1
- package/dist/hooks/use-mobile.spec.d.ts +0 -1
- package/dist/hooks/use-mobile.spec.js +0 -2
- package/dist/hooks/use-mobile.spec.js.map +0 -1
- package/dist/hover-card-C3yz2zQi.d.ts +0 -13
- package/dist/hover-card-Dc8yLsm-.js +0 -2
- package/dist/hover-card-Dc8yLsm-.js.map +0 -1
- package/dist/input-BgjvSP_s.js +0 -2
- package/dist/input-BgjvSP_s.js.map +0 -1
- package/dist/input-CI3RPXz0.d.ts +0 -8
- package/dist/input-group-CBn36aMg.d.ts +0 -26
- package/dist/input-group-Dx06pcPt.js +0 -2
- package/dist/input-group-Dx06pcPt.js.map +0 -1
- package/dist/input-otp-CzfRHf2V.js +0 -2
- package/dist/input-otp-CzfRHf2V.js.map +0 -1
- package/dist/input-otp-gIEkdiIC.d.ts +0 -19
- package/dist/kbd-BTl3AgkY.js +0 -2
- package/dist/kbd-BTl3AgkY.js.map +0 -1
- package/dist/kbd-DELCQBD0.d.ts +0 -10
- package/dist/label-BQDEej_c.js +0 -2
- package/dist/label-BQDEej_c.js.map +0 -1
- package/dist/label-KZl6I5Ey.d.ts +0 -9
- package/dist/lib/badge.spec.d.ts +0 -1
- package/dist/lib/badge.spec.js +0 -2
- package/dist/lib/badge.spec.js.map +0 -1
- package/dist/lib/button.spec.d.ts +0 -1
- package/dist/lib/button.spec.js +0 -2
- package/dist/lib/button.spec.js.map +0 -1
- package/dist/lib/color.spec.d.ts +0 -1
- package/dist/lib/color.spec.js +0 -2
- package/dist/lib/color.spec.js.map +0 -1
- package/dist/lib/compose-refs.spec.d.ts +0 -1
- package/dist/lib/compose-refs.spec.js +0 -2
- package/dist/lib/compose-refs.spec.js.map +0 -1
- package/dist/lib/progress.spec.d.ts +0 -1
- package/dist/lib/progress.spec.js +0 -2
- package/dist/lib/progress.spec.js.map +0 -1
- package/dist/lib/utils.spec.d.ts +0 -1
- package/dist/lib/utils.spec.js +0 -2
- package/dist/lib/utils.spec.js.map +0 -1
- package/dist/list-BbCg-ndB.js +0 -2
- package/dist/list-BbCg-ndB.js.map +0 -1
- package/dist/list-DMa2j1rk.d.ts +0 -25
- package/dist/logo-BkwNxZNw.js +0 -2
- package/dist/logo-Buo7sqqn.d.ts +0 -69
- package/dist/marker-4_EnMIHk.js +0 -2
- package/dist/marker-4_EnMIHk.js.map +0 -1
- package/dist/marker-C4wLa1c0.d.ts +0 -18
- package/dist/mask-input-B4R5K1h6.d.ts +0 -16
- package/dist/mask-input-D66mRep_.js +0 -2
- package/dist/mask-input-D66mRep_.js.map +0 -1
- package/dist/native-select-BVmdMkHY.d.ts +0 -14
- package/dist/native-select-DZW3Y7nq.js +0 -2
- package/dist/native-select-DZW3Y7nq.js.map +0 -1
- package/dist/navigation-menu-B6drNL1-.js +0 -2
- package/dist/navigation-menu-B6drNL1-.js.map +0 -1
- package/dist/navigation-menu-siQVRMUF.d.ts +0 -26
- package/dist/number-field-IdgO_BUa.d.ts +0 -35
- package/dist/number-field-rEMfZa6A.js +0 -2
- package/dist/number-field-rEMfZa6A.js.map +0 -1
- package/dist/pagination-BZ3xMXsy.d.ts +0 -27
- package/dist/pagination-gnUKddCN.js +0 -2
- package/dist/pagination-gnUKddCN.js.map +0 -1
- package/dist/phone-input-By5lNF03.d.ts +0 -13
- package/dist/phone-input-DUubOpNH.js +0 -2
- package/dist/phone-input-DUubOpNH.js.map +0 -1
- package/dist/pie-chart-CvG27kFN.d.ts +0 -42
- package/dist/pie-chart-S4nMKbsW.js +0 -2
- package/dist/pie-chart-S4nMKbsW.js.map +0 -1
- package/dist/popover-BtX3tX8M.js +0 -2
- package/dist/popover-BtX3tX8M.js.map +0 -1
- package/dist/popover-DchAqyKn.d.ts +0 -21
- package/dist/progress-DeXRCHUw.d.ts +0 -19
- package/dist/progress-QvpY7tiy.js +0 -2
- package/dist/progress-QvpY7tiy.js.map +0 -1
- package/dist/progress-icFwrvnE.js +0 -2
- package/dist/progress-icFwrvnE.js.map +0 -1
- package/dist/progress-mEAw9ZhK.d.ts +0 -14
- package/dist/radio-group-BNbepK_U.d.ts +0 -25
- package/dist/radio-group-DM8n0XPS.js +0 -2
- package/dist/radio-group-DM8n0XPS.js.map +0 -1
- package/dist/react.esm-BkhVXJ8s.js +0 -68
- package/dist/react.esm-BkhVXJ8s.js.map +0 -1
- package/dist/resizable-DMQG3xF_.d.ts +0 -14
- package/dist/resizable-Dbg7r7nF.js +0 -2
- package/dist/resizable-Dbg7r7nF.js.map +0 -1
- package/dist/ring-progress-65ccdTQQ.d.ts +0 -17
- package/dist/ring-progress-Bfqq_HHA.js +0 -2
- package/dist/ring-progress-Bfqq_HHA.js.map +0 -1
- package/dist/rolldown-runtime-Bdj-bS2b.js +0 -1
- package/dist/scroll-area-DFcj5q66.d.ts +0 -11
- package/dist/scroll-area-DKS4QPHg.js +0 -2
- package/dist/scroll-area-DKS4QPHg.js.map +0 -1
- package/dist/select-BoYp-Xyc.d.ts +0 -29
- package/dist/select-C3QYNv4t.js +0 -2
- package/dist/select-C3QYNv4t.js.map +0 -1
- package/dist/separator-BsRLiqWE.d.ts +0 -9
- package/dist/separator-CCMmbXL0.js +0 -2
- package/dist/separator-CCMmbXL0.js.map +0 -1
- package/dist/sidebar-D7HQlj5O.d.ts +0 -96
- package/dist/sidebar-DemayEyw.js +0 -2
- package/dist/sidebar-DemayEyw.js.map +0 -1
- package/dist/simple-grid-9EryoUWI.js +0 -2
- package/dist/simple-grid-9EryoUWI.js.map +0 -1
- package/dist/simple-grid-B2zjpwZ3.d.ts +0 -14
- package/dist/skeleton-Cn3zBJRe.js +0 -2
- package/dist/skeleton-Cn3zBJRe.js.map +0 -1
- package/dist/skeleton-Co8pevj-.d.ts +0 -10
- package/dist/slider-CC-gQawq.js +0 -2
- package/dist/slider-CC-gQawq.js.map +0 -1
- package/dist/slider-DmZ1YfLg.d.ts +0 -9
- package/dist/sonner-Binx8JJ2.d.ts +0 -8
- package/dist/sonner-DrKqhTDI.js +0 -2
- package/dist/sonner-DrKqhTDI.js.map +0 -1
- package/dist/spinner-Dz63Ltq-.d.ts +0 -12
- package/dist/spinner-ntLrcDLN.js +0 -2
- package/dist/spinner-ntLrcDLN.js.map +0 -1
- package/dist/stack-BbLllsqk.js +0 -2
- package/dist/stack-BbLllsqk.js.map +0 -1
- package/dist/stack-WiND8Dxq.d.ts +0 -14
- package/dist/stepper-BQ-59_UO.js +0 -2
- package/dist/stepper-BQ-59_UO.js.map +0 -1
- package/dist/stepper-DK5_o7RG.d.ts +0 -71
- package/dist/styles/gomax.css +0 -222
- package/dist/styles/max.css +0 -223
- package/dist/styles/theme.css +0 -213
- package/dist/switch-DjdOGECT.js +0 -2
- package/dist/switch-DjdOGECT.js.map +0 -1
- package/dist/switch-OtBakZHc.d.ts +0 -17
- package/dist/table-CuE0Aenj.js +0 -2
- package/dist/table-CuE0Aenj.js.map +0 -1
- package/dist/table-qIAtG7Y5.d.ts +0 -33
- package/dist/tabs-BgWxTTah.d.ts +0 -21
- package/dist/tabs-DK9-RHkP.js +0 -2
- package/dist/tabs-DK9-RHkP.js.map +0 -1
- package/dist/text-CKFZ9Xsj.d.ts +0 -14
- package/dist/text-Kg1xuinT.js +0 -2
- package/dist/text-Kg1xuinT.js.map +0 -1
- package/dist/textarea-C8zrf9Rz.js +0 -2
- package/dist/textarea-C8zrf9Rz.js.map +0 -1
- package/dist/textarea-Cr9_P-bV.d.ts +0 -8
- package/dist/theme-BwEhfTyl.d.ts +0 -22
- package/dist/theme-DZJ_cJYp.js +0 -2
- package/dist/theme-DZJ_cJYp.js.map +0 -1
- package/dist/timeline-BDY3YzeJ.d.ts +0 -61
- package/dist/timeline-pBm0t1tb.js +0 -2
- package/dist/timeline-pBm0t1tb.js.map +0 -1
- package/dist/toggle-DJJkcqDy.js +0 -2
- package/dist/toggle-DJJkcqDy.js.map +0 -1
- package/dist/toggle-group-C3iNDYqI.d.ts +0 -16
- package/dist/toggle-group-D0OIpZN-.js +0 -2
- package/dist/toggle-group-D0OIpZN-.js.map +0 -1
- package/dist/toggle-jc8s_Z3T.d.ts +0 -15
- package/dist/tooltip-BZjnEqw5.d.ts +0 -21
- package/dist/tooltip-CNUNWZvs.js +0 -2
- package/dist/tooltip-CNUNWZvs.js.map +0 -1
- package/dist/unstyled-button-C-Zs4Qv2.d.ts +0 -10
- package/dist/unstyled-button-lGbDJA55.js +0 -2
- package/dist/unstyled-button-lGbDJA55.js.map +0 -1
- package/dist/use-breakpoint-D6YACz8C.js +0 -2
- package/dist/use-breakpoint-D6YACz8C.js.map +0 -1
- package/dist/use-breakpoint-DDuQFekj.d.ts +0 -8
- package/dist/use-breakpoint-value-BDjKflDX.js +0 -2
- package/dist/use-breakpoint-value-BDjKflDX.js.map +0 -1
- package/dist/use-breakpoint-value-CRbHqGAu.d.ts +0 -8
- package/dist/use-disclosure-CNaFpYFQ.d.ts +0 -22
- package/dist/use-disclosure-Cr405eRD.js +0 -2
- package/dist/use-disclosure-Cr405eRD.js.map +0 -1
- package/dist/use-document-visibility-CoWjCswu.js +0 -2
- package/dist/use-document-visibility-CoWjCswu.js.map +0 -1
- package/dist/use-document-visibility-DIzUN4tB.d.ts +0 -6
- package/dist/use-idle-Bsi10VE9.d.ts +0 -13
- package/dist/use-idle-DgheJlxd.js +0 -2
- package/dist/use-idle-DgheJlxd.js.map +0 -1
- package/dist/use-interval-B1aNo3tA.js +0 -2
- package/dist/use-interval-B1aNo3tA.js.map +0 -1
- package/dist/use-interval-CJVmE_lC.d.ts +0 -24
- package/dist/use-local-storage-CJBqB1GC.js +0 -2
- package/dist/use-local-storage-CJBqB1GC.js.map +0 -1
- package/dist/use-local-storage-Cmq4PWJc.d.ts +0 -16
- package/dist/use-mask-DBvFShXA.js +0 -2
- package/dist/use-mask-DBvFShXA.js.map +0 -1
- package/dist/use-mask-DRJVVcdh.d.ts +0 -8
- package/dist/use-mobile-BYwiljVq.d.ts +0 -6
- package/dist/use-mobile-OMmp56u2.js +0 -2
- package/dist/use-mobile-OMmp56u2.js.map +0 -1
- package/dist/utils-DGsdoA5l.d.ts +0 -8
- package/dist/utils-DP9KtG7I.js +0 -2
- package/dist/utils-DP9KtG7I.js.map +0 -1
- package/dist/visibility-_3zV3l-A.d.ts +0 -17
- package/dist/visibility-twHwe9Xp.js +0 -2
- package/dist/visibility-twHwe9Xp.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.js","names":["DialogPrimitive"],"sources":["../../src/components/dialog.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 DialogPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\nimport { Button } from './button'\n\nconst dialogContentVariants = cva(\n [\n 'bg-background ring-foreground/10 fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none',\n 'flex flex-col gap-4 rounded-xl p-4 text-sm ring-1 duration-100',\n 'max-w-[calc(100%-2rem)] max-h-[calc(100dvh-2rem)] 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 ],\n {\n variants: {\n size: {\n sm: 'sm:max-w-sm',\n md: 'sm:max-w-md',\n lg: 'sm:max-w-lg',\n xl: 'sm:max-w-xl',\n '2xl': 'sm:max-w-2xl',\n '3xl': 'sm:max-w-3xl',\n full: 'w-screen h-screen max-w-none max-h-screen rounded-none sm:max-w-none'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n }\n)\n\ntype DialogSize = NonNullable<VariantProps<typeof dialogContentVariants>['size']>\ntype DialogContextValue = { size: DialogSize; dismissible: boolean }\nconst DialogContext = React.createContext<DialogContextValue>({ size: 'sm', dismissible: true })\n\nexport type DialogProps = React.ComponentProps<typeof DialogPrimitive.Root> & {\n size?: DialogSize\n dismissible?: boolean\n}\nexport type DialogTriggerProps = React.ComponentProps<typeof DialogPrimitive.Trigger>\nexport type DialogPortalProps = React.ComponentProps<typeof DialogPrimitive.Portal>\nexport type DialogCloseProps = React.ComponentProps<typeof DialogPrimitive.Close>\nexport type DialogOverlayProps = React.ComponentProps<typeof DialogPrimitive.Overlay>\nexport type DialogContentProps = React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean\n overlayRef?: React.Ref<HTMLDivElement>\n}\nexport type DialogHeaderProps = React.ComponentProps<'div'>\nexport type DialogBodyProps = React.ComponentProps<'div'>\nexport type DialogFooterProps = React.ComponentProps<'div'> & { showCloseButton?: boolean }\nexport type DialogTitleProps = React.ComponentProps<typeof DialogPrimitive.Title>\nexport type DialogDescriptionProps = React.ComponentProps<typeof DialogPrimitive.Description>\n\nfunction Dialog({ size = 'sm', dismissible = true, ...props }: DialogProps) {\n const contextValue = React.useMemo<DialogContextValue>(() => ({ size, dismissible }), [size, dismissible])\n\n return (\n <DialogContext.Provider value={contextValue}>\n <DialogPrimitive.Root data-slot=\"dialog\" {...props} />\n </DialogContext.Provider>\n )\n}\n\nfunction DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />\n}\n\nfunction DialogPortal({ ...props }: DialogPortalProps) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\nfunction DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />\n}\n\nfunction DialogOverlay({ className, ...props }: DialogOverlayProps) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n 'bg-black/10 fixed inset-0 isolate z-50',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0',\n 'duration-100 supports-backdrop-filter:backdrop-blur-xs',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogContent({ className, children, showCloseButton = true, overlayRef, ...props }: DialogContentProps) {\n const { size, dismissible } = React.useContext(DialogContext)\n\n return (\n <DialogPortal>\n <DialogOverlay ref={overlayRef} />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(dialogContentVariants({ size }), 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 <DialogPrimitive.Close data-slot=\"dialog-close\" asChild>\n <Button variant=\"ghost\" className=\"absolute top-2 right-2\" size=\"icon-sm\">\n <IconX />\n <span className=\"sr-only\">Close</span>\n </Button>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n )\n}\n\nfunction DialogHeader({ className, ...props }: DialogHeaderProps) {\n return <div data-slot=\"dialog-header\" className={cn('gap-2 flex flex-col shrink-0', className)} {...props} />\n}\n\nfunction DialogBody({ className, ...props }: DialogBodyProps) {\n return <div data-slot=\"dialog-body\" className={cn('-mx-4 px-4 flex-1 overflow-y-auto', className)} {...props} />\n}\n\nfunction DialogFooter({ className, showCloseButton = false, children, ...props }: DialogFooterProps) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n 'bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 shrink-0',\n 'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close asChild>\n <Button variant=\"outline\">Close</Button>\n </DialogPrimitive.Close>\n )}\n </div>\n )\n}\n\nfunction DialogTitle({ className, ...props }: DialogTitleProps) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn('text-base leading-none font-medium', className)}\n {...props}\n />\n )\n}\n\nfunction DialogDescription({ className, ...props }: DialogDescriptionProps) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\n 'text-muted-foreground text-sm',\n '*:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n Dialog,\n DialogBody,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger\n}\n"],"mappings":"yTASA,MAAM,EAAwB,EAC5B,CACE,qHACA,iEACA,oEACA,sIACF,EACA,CACE,SAAU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,CAEA,SAAS,kBAAkB,CAAE,YAAW,GAAG,GAAiC,CAC1E,OACE,EAACA,EAAgB,YAAjB,CACE,YAAU,qBACV,UAAW,EACT,gCACA,uEACA,CACF,EACA,GAAI,CACL,CAAA,CAEL"}
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
|
|
2
|
+
import { PieChartProps } from "./pie-chart.js";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
//#region src/components/donut-chart.d.ts
|
|
5
|
+
type DonutChartProps = PieChartProps & {
|
|
6
|
+
thickness?: number;
|
|
7
|
+
withTotal?: boolean;
|
|
8
|
+
totalLabel?: React.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
declare function DonutChart({ className, thickness, outerRadius, withTotal, totalLabel, data, ...props }: DonutChartProps): React.JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { DonutChart, DonutChartProps };
|
|
13
|
+
//# sourceMappingURL=donut-chart.d.ts.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import"../rolldown-runtime-BhWHdk3m.js";import{cn as e}from"../lib/utils.js";import{PieChartBase as t}from"./pie-chart.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";import*as i from"react";import{Label as a}from"recharts";function DonutChart({className:o,thickness:s=.35,outerRadius:c=`80%`,withTotal:l=!1,totalLabel:u=`Total`,data:d,...f}){let p=i.useMemo(()=>{let e=Math.min(Math.max(1-s,0),1);if(typeof c==`number`)return c*e;let t=/^(\d+(?:\.\d+)?)%$/.exec(c);return t?`${Number(t[1])*e}%`:c},[c,s]),m=i.useMemo(()=>d.reduce((e,t)=>e+t.value,0),[d]);return n(t,{dataSlot:`donut-chart`,className:e(o),data:d,outerRadius:c,innerRadius:p,centerSlot:l?n(a,{position:`center`,content:({viewBox:e})=>!e||!(`cx`in e)||!(`cy`in e)?null:r(`text`,{x:e.cx,y:e.cy,textAnchor:`middle`,dominantBaseline:`middle`,children:[n(`tspan`,{x:e.cx,y:e.cy,className:`fill-foreground font-medium text-2xl tabular-nums`,children:m.toLocaleString()}),n(`tspan`,{x:e.cx,y:(e.cy??0)+20,className:`fill-muted-foreground text-xs`,children:u})]})}):null,...f})}export{DonutChart};
|
|
2
|
+
//# sourceMappingURL=donut-chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"donut-chart.js","names":[],"sources":["../../src/components/donut-chart.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Label } from 'recharts'\n\nimport { cn } from '../lib/utils'\nimport { PieChartBase, type PieChartProps } from './pie-chart'\n\nexport type DonutChartProps = PieChartProps & {\n thickness?: number\n withTotal?: boolean\n totalLabel?: React.ReactNode\n}\n\nfunction DonutChart({\n className,\n thickness = 0.35,\n outerRadius = '80%',\n withTotal = false,\n totalLabel = 'Total',\n data,\n ...props\n}: DonutChartProps) {\n const innerRadius = React.useMemo(() => {\n const ratio = Math.min(Math.max(1 - thickness, 0), 1)\n if (typeof outerRadius === 'number') {\n return outerRadius * ratio\n }\n const match = /^(\\d+(?:\\.\\d+)?)%$/.exec(outerRadius)\n if (match) {\n return `${Number(match[1]) * ratio}%`\n }\n return outerRadius\n }, [outerRadius, thickness])\n\n const total = React.useMemo(() => data.reduce((sum, item) => sum + item.value, 0), [data])\n\n return (\n <PieChartBase\n dataSlot=\"donut-chart\"\n className={cn(className)}\n data={data}\n outerRadius={outerRadius}\n innerRadius={innerRadius}\n centerSlot={\n withTotal ? (\n <Label\n position=\"center\"\n content={({ viewBox }) => {\n if (!viewBox || !('cx' in viewBox) || !('cy' in viewBox)) {\n return null\n }\n return (\n <text x={viewBox.cx} y={viewBox.cy} textAnchor=\"middle\" dominantBaseline=\"middle\">\n <tspan x={viewBox.cx} y={viewBox.cy} className=\"fill-foreground font-medium text-2xl tabular-nums\">\n {total.toLocaleString()}\n </tspan>\n <tspan x={viewBox.cx} y={(viewBox.cy ?? 0) + 20} className=\"fill-muted-foreground text-xs\">\n {totalLabel}\n </tspan>\n </text>\n )\n }}\n />\n ) : null\n }\n {...props}\n />\n )\n}\n\nexport { DonutChart }\n"],"mappings":"sOAaA,SAAS,WAAW,CAClB,YACA,YAAY,IACZ,cAAc,MACd,YAAY,GACZ,aAAa,QACb,OACA,GAAG,GACe,CAClB,IAAM,EAAc,EAAM,YAAc,CACtC,IAAM,EAAQ,KAAK,IAAI,KAAK,IAAI,EAAI,EAAW,CAAC,EAAG,CAAC,EACpD,GAAI,OAAO,GAAgB,SACzB,OAAO,EAAc,EAEvB,IAAM,EAAQ,qBAAqB,KAAK,CAAW,EAInD,OAHI,EACK,GAAG,OAAO,EAAM,EAAE,EAAI,EAAM,GAE9B,CACT,EAAG,CAAC,EAAa,CAAS,CAAC,EAErB,EAAQ,EAAM,YAAc,EAAK,QAAQ,EAAK,IAAS,EAAM,EAAK,MAAO,CAAC,EAAG,CAAC,CAAI,CAAC,EAEzF,OACE,EAAC,EAAD,CACE,SAAS,cACT,UAAW,EAAG,CAAS,EACjB,OACO,cACA,cACb,WACE,EACE,EAAC,EAAD,CACE,SAAS,SACT,SAAU,CAAE,aACN,CAAC,GAAW,EAAE,OAAQ,IAAY,EAAE,OAAQ,GACvC,KAGP,EAAC,OAAD,CAAM,EAAG,EAAQ,GAAI,EAAG,EAAQ,GAAI,WAAW,SAAS,iBAAiB,SAAzE,SAAA,CACE,EAAC,QAAD,CAAO,EAAG,EAAQ,GAAI,EAAG,EAAQ,GAAI,UAAU,oDAC5C,SAAA,EAAM,eAAe,CACjB,CAAA,EACP,EAAC,QAAD,CAAO,EAAG,EAAQ,GAAI,GAAI,EAAQ,IAAM,GAAK,GAAI,UAAU,gCACxD,SAAA,CACI,CAAA,CACH,GAGX,CAAA,EACC,KAEN,GAAI,CACL,CAAA,CAEL"}
|
|
@@ -1,2 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { t as __name } from "../rolldown-runtime-BhWHdk3m.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 { Drawer, DrawerBody, DrawerBodyProps, DrawerClose, DrawerCloseProps, DrawerContent, DrawerContentProps, DrawerDescription, DrawerDescriptionProps, DrawerFooter, DrawerFooterProps, DrawerHeader, DrawerHeaderProps, DrawerOverlay, DrawerOverlayProps, DrawerPortal, DrawerPortalProps, DrawerProps, DrawerTitle, DrawerTitleProps, DrawerTrigger, DrawerTriggerProps };
|
|
43
|
+
//# sourceMappingURL=drawer.d.ts.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import"../rolldown-runtime-BhWHdk3m.js";import{cn as e}from"../lib/utils.js";import{Button as t}from"./button.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{Drawer,DrawerBody,DrawerClose,DrawerContent,DrawerDescription,DrawerFooter,DrawerHeader,DrawerOverlay,DrawerPortal,DrawerTitle,DrawerTrigger};
|
|
2
|
+
//# sourceMappingURL=drawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer.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,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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"}
|
|
@@ -1,2 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
|
|
2
|
+
import { DropdownMenu as DropdownMenu$1 } from "radix-ui";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
//#region src/components/dropdown-menu.d.ts
|
|
5
|
+
type DropdownMenuProps = React.ComponentProps<typeof DropdownMenu$1.Root>;
|
|
6
|
+
type DropdownMenuPortalProps = React.ComponentProps<typeof DropdownMenu$1.Portal>;
|
|
7
|
+
type DropdownMenuTriggerProps = React.ComponentProps<typeof DropdownMenu$1.Trigger>;
|
|
8
|
+
type DropdownMenuContentProps = React.ComponentProps<typeof DropdownMenu$1.Content>;
|
|
9
|
+
type DropdownMenuGroupProps = React.ComponentProps<typeof DropdownMenu$1.Group>;
|
|
10
|
+
type DropdownMenuItemProps = React.ComponentProps<typeof DropdownMenu$1.Item> & {
|
|
11
|
+
inset?: boolean;
|
|
12
|
+
variant?: 'default' | 'destructive';
|
|
13
|
+
};
|
|
14
|
+
type DropdownMenuCheckboxItemProps = React.ComponentProps<typeof DropdownMenu$1.CheckboxItem> & {
|
|
15
|
+
inset?: boolean;
|
|
16
|
+
};
|
|
17
|
+
type DropdownMenuRadioGroupProps = React.ComponentProps<typeof DropdownMenu$1.RadioGroup>;
|
|
18
|
+
type DropdownMenuRadioItemProps = React.ComponentProps<typeof DropdownMenu$1.RadioItem> & {
|
|
19
|
+
inset?: boolean;
|
|
20
|
+
};
|
|
21
|
+
type DropdownMenuLabelProps = React.ComponentProps<typeof DropdownMenu$1.Label> & {
|
|
22
|
+
inset?: boolean;
|
|
23
|
+
};
|
|
24
|
+
type DropdownMenuSeparatorProps = React.ComponentProps<typeof DropdownMenu$1.Separator>;
|
|
25
|
+
type DropdownMenuShortcutProps = React.ComponentProps<'span'>;
|
|
26
|
+
type DropdownMenuSubProps = React.ComponentProps<typeof DropdownMenu$1.Sub>;
|
|
27
|
+
type DropdownMenuSubTriggerProps = React.ComponentProps<typeof DropdownMenu$1.SubTrigger> & {
|
|
28
|
+
inset?: boolean;
|
|
29
|
+
};
|
|
30
|
+
type DropdownMenuSubContentProps = React.ComponentProps<typeof DropdownMenu$1.SubContent>;
|
|
31
|
+
declare function DropdownMenu({ ...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 { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuCheckboxItemProps, DropdownMenuContent, DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuGroupProps, DropdownMenuItem, DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuLabelProps, DropdownMenuPortal, DropdownMenuPortalProps, DropdownMenuProps, DropdownMenuRadioGroup, DropdownMenuRadioGroupProps, DropdownMenuRadioItem, DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuSeparatorProps, DropdownMenuShortcut, DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubContentProps, DropdownMenuSubProps, DropdownMenuSubTrigger, DropdownMenuSubTriggerProps, DropdownMenuTrigger, DropdownMenuTriggerProps };
|
|
48
|
+
//# sourceMappingURL=dropdown-menu.d.ts.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import"../rolldown-runtime-BhWHdk3m.js";import{cn as e}from"../lib/utils.js";import{IconCheck as t,IconChevronRight as n}from"@tabler/icons-react";import{DropdownMenu as r}from"radix-ui";import{jsx as i,jsxs as a}from"react/jsx-runtime";function DropdownMenu({...e}){return i(r.Root,{"data-slot":`dropdown-menu`,...e})}function DropdownMenuPortal({...e}){return i(r.Portal,{"data-slot":`dropdown-menu-portal`,...e})}function DropdownMenuTrigger({...e}){return i(r.Trigger,{"data-slot":`dropdown-menu-trigger`,...e})}function DropdownMenuContent({className:t,align:n=`start`,sideOffset:a=4,...o}){return i(DropdownMenuPortal,{children:i(r.Content,{"data-slot":`dropdown-menu-content`,align:n,sideOffset:a,className:e(`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!`,t),...o})})}function DropdownMenuGroup({...e}){return i(r.Group,{"data-slot":`dropdown-menu-group`,...e})}function DropdownMenuItem({className:t,inset:n,variant:a=`default`,...o}){return i(r.Item,{"data-slot":`dropdown-menu-item`,"data-inset":n,"data-variant":a,className:e(`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`,t),...o})}function DropdownMenuCheckboxItem({className:n,children:o,inset:s,...c}){return a(r.CheckboxItem,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":s,className:e(`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`,n),...c,children:[i(`span`,{"data-slot":`dropdown-menu-checkbox-item-indicator`,className:`pointer-events-none absolute right-2 flex items-center justify-center`,children:i(r.ItemIndicator,{children:i(t,{})})}),o]})}function DropdownMenuRadioGroup({...e}){return i(r.RadioGroup,{"data-slot":`dropdown-menu-radio-group`,...e})}function DropdownMenuRadioItem({className:n,children:o,inset:s,...c}){return a(r.RadioItem,{"data-slot":`dropdown-menu-radio-item`,"data-inset":s,className:e(`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`,n),...c,children:[i(`span`,{"data-slot":`dropdown-menu-radio-item-indicator`,className:`pointer-events-none absolute right-2 flex items-center justify-center`,children:i(r.ItemIndicator,{children:i(t,{})})}),o]})}function DropdownMenuLabel({className:t,inset:n,...a}){return i(r.Label,{"data-slot":`dropdown-menu-label`,"data-inset":n,className:e(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,t),...a})}function DropdownMenuSeparator({className:t,...n}){return i(r.Separator,{"data-slot":`dropdown-menu-separator`,className:e(`bg-border -mx-1 my-1 h-px`,t),...n})}function DropdownMenuShortcut({className:t,...n}){return i(`span`,{"data-slot":`dropdown-menu-shortcut`,className:e(`ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground`,t),...n})}function DropdownMenuSub({...e}){return i(r.Sub,{"data-slot":`dropdown-menu-sub`,...e})}function DropdownMenuSubTrigger({className:t,inset:o,children:s,...c}){return a(r.SubTrigger,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":o,className:e(`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`,t),...c,children:[s,i(n,{className:`ml-auto`})]})}function DropdownMenuSubContent({className:t,...n}){return i(r.SubContent,{"data-slot":`dropdown-menu-sub-content`,className:e(`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!`,t),...n})}export{DropdownMenu,DropdownMenuCheckboxItem,DropdownMenuContent,DropdownMenuGroup,DropdownMenuItem,DropdownMenuLabel,DropdownMenuPortal,DropdownMenuRadioGroup,DropdownMenuRadioItem,DropdownMenuSeparator,DropdownMenuShortcut,DropdownMenuSub,DropdownMenuSubContent,DropdownMenuSubTrigger,DropdownMenuTrigger};
|
|
2
|
+
//# sourceMappingURL=dropdown-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-menu.js","names":["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":"6OAgDA,SAAS,aAAa,CAAE,GAAG,GAA4B,CACrD,OAAO,EAACA,EAAsB,KAAvB,CAA4B,YAAU,gBAAgB,GAAI,CAAQ,CAAA,CAC3E,CAEA,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,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ACF,EACA,GAAI,CACL,CAAA,CAEL"}
|
|
@@ -1,2 +1,102 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
|
|
2
|
+
import { ButtonProps } from "./button.js";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Accept, ErrorCode, FileError, useDropzone as useDropzone$1 } 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$1>['getRootProps'];
|
|
56
|
+
getInputProps: ReturnType<typeof useDropzone$1>['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<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 { Dropzone, DropzoneArea, DropzoneAreaProps, DropzoneDescription, DropzoneDescriptionProps, DropzoneFileList, DropzoneFileListItem, DropzoneFileListItemProps, DropzoneFileListProps, DropzoneFileMessage, DropzoneFileMessageProps, DropzoneFileStatus, DropzoneMessage, DropzoneMessageProps, DropzoneProps, DropzoneRemoveFile, DropzoneRemoveFileProps, DropzoneRetryFile, DropzoneRetryFileProps, DropzoneTrigger, DropzoneTriggerProps, DropzoneUploadResult, DropzoneValidation, ErrorCode, type FileError, FileStatus, InfiniteProgress, InfiniteProgressProps, UseDropzoneProps, UseDropzoneReturn, useDropzone };
|
|
102
|
+
//# sourceMappingURL=dropzone.d.ts.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import"../rolldown-runtime-BhWHdk3m.js";import{cn as e}from"../lib/utils.js";import{Button as t}from"./button.js";import{composeRefs as n}from"../lib/compose-refs.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";import*as a from"react";import{ErrorCode as o,useDropzone as s}from"react-dropzone";const c=[o.FileInvalidType,o.FileTooLarge,o.FileTooSmall,o.TooManyFiles],l=new Set(c),u={pending:`indeterminate`,success:`100%`,error:`error`},d=a.createContext(null),f=a.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=>l.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/1048576).toFixed(2)} MB`]:[`this file is too large`];case`file-too-small`:return t.minSize?[`min size is ${(t.minSize/1048576).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=a.useContext(d);if(!e)throw Error(`Dropzone components must be used within a Dropzone.`);return e}function useDropzoneFileListContext(){let e=a.useContext(f);if(!e)throw Error(`Dropzone file actions must be used within a DropzoneFileListItem.`);return e}function useDropzone(e){let{onDropFile:t,onRemoveFile:n,shapeUploadError:r,onFileUploaded:i,onFileUploadError:c,onAllUploaded:l,onRootError:u,maxRetryCount:d,autoRetry:f=!1,validation:p,shiftOnMaxFiles:m=!1}=e,h=a.useId(),g=`${h}-message`,_=`${h}-description`,[v,y]=a.useState(void 0),b=a.useCallback(e=>{y(e),u?.(e)},[u]),[x,S]=a.useReducer(fileStatusReducer,[]),C=a.useCallback(e=>`${h}-${e}-message`,[h]),w=a.useMemo(()=>v!==void 0||x.some(e=>e.status===`error`),[x,v]),T=a.useCallback(async(e,n,a=0)=>{try{let o=await t(e);if(o.status===`error`){if(f&&a<(d??1/0))return S({type:`update-status`,id:n,status:`pending`}),T(e,n,a+1);S({type:`update-status`,id:n,status:`error`,error:o.error,message:getUploadErrorMessage(o.error,r)}),c?.(o.error);return}S({type:`update-status`,id:n,status:`success`,result:o.result}),i?.(o.result)}catch(e){let t=e;S({type:`update-status`,id:n,status:`error`,error:t,message:getUploadErrorMessage(t,r)}),c?.(t)}},[f,t,d,c,i,r]),E=a.useCallback(async e=>{await n?.(e),S({type:`remove`,id:e})},[n]),D=a.useCallback(e=>{let t=x.find(t=>t.id===e);return t?.status===`error`&&t.tries<=(d??1/0)},[x,d]),O=a.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=s({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([o.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}}function Dropzone({children:e,...t}){return r(d.Provider,{value:t,children:e})}const p=a.forwardRef(({className:t,children:a,...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:e(`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`,t)}),f=c.getInputProps({id:c.inputId,className:`sr-only`,"aria-describedby":l,"aria-invalid":c.isInvalid,tabIndex:-1});return i(`div`,{...d,ref:n(s,u),children:[r(`input`,{...f}),a]})}),m=a.forwardRef(({className:t,...n},i)=>{let a=useDropzoneContext();return r(`p`,{ref:i,id:a.rootDescriptionId,"data-slot":`dropzone-description`,className:e(`text-sm text-muted-foreground`,t),...n})}),h=a.forwardRef(({className:t,...n},i)=>(useDropzoneContext(),r(`ol`,{ref:i,"data-slot":`dropzone-file-list`,className:e(`space-y-3`,t),...n}))),g=a.forwardRef(({className:t,file:n,children:i,...o},s)=>{let c=useDropzoneContext(),l=c.getFileMessageId(n.id),u=n.status===`error`,d=c.canRetry(n.id),p=a.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 r(f.Provider,{value:p,children:r(`li`,{ref:s,"data-slot":`dropzone-file-item`,"data-status":n.status,"aria-describedby":u?l:void 0,className:e(`rounded-xl border bg-card px-4 py-3 shadow-xs`,n.status===`error`&&`border-destructive/50`,t),...o,children:i})})}),_=a.forwardRef(({className:t,children:n,...i},a)=>{let o=useDropzoneFileListContext(),s=o.fileStatus.status===`error`?o.fileStatus.message??String(o.fileStatus.error):n;return r(`p`,{ref:a,id:o.messageId,"data-slot":`dropzone-file-message`,className:e(`min-h-5 text-[0.8rem] font-medium`,o.fileStatus.status===`error`&&`text-destructive`,t),...i,children:s})}),v=a.forwardRef(({className:t,children:n,...i},a)=>{let o=useDropzoneContext(),s=o.rootError??n;return r(`p`,{ref:a,id:o.rootMessageId,"data-slot":`dropzone-message`,className:e(`min-h-5 text-[0.8rem] font-medium text-destructive`,t),...i,children:s})}),y=a.forwardRef(({className:n,onClick:i,size:o=`icon-sm`,type:s=`button`,variant:c=`ghost`,...l},u)=>{let d=useDropzoneFileListContext(),f=a.useCallback(e=>{i?.(e),!e.defaultPrevented&&d.onRemoveFile()},[d,i]);return r(t,{ref:u,"data-slot":`dropzone-remove-file`,className:e(n),onClick:f,size:o,type:s,variant:c,...l})}),b=a.forwardRef(({className:n,disabled:i,onClick:o,size:s=`icon-sm`,type:c=`button`,variant:l=`ghost`,...u},d)=>{let f=useDropzoneFileListContext(),p=i||!f.canRetry,m=a.useCallback(e=>{o?.(e),!(e.defaultPrevented||p)&&f.onRetry()},[f,p,o]);return r(t,{ref:d,"data-slot":`dropzone-retry-file`,className:e(n),disabled:p,onClick:m,size:s,type:c,variant:l,...u})}),x=a.forwardRef(({className:n,onClick:i,size:o=`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=a.useCallback(e=>{i?.(e),!e.defaultPrevented&&d.open()},[d,i]);return r(t,{ref:u,"aria-controls":d.inputId,"aria-describedby":f,"aria-invalid":d.isInvalid||void 0,"data-slot":`dropzone-trigger`,className:e(n),onClick:p,size:o,type:s,variant:c,...l})}),S=a.forwardRef(({className:t,status:n,...i},a)=>{let o=n===`success`||n===`error`,s=n===`error`;return r(`div`,{ref:a,"aria-valuemax":100,"aria-valuemin":0,"aria-valuetext":u[n],"data-slot":`dropzone-progress`,"data-status":n,role:`progressbar`,className:e(`relative h-2 w-full overflow-hidden rounded-full bg-muted`,t),...i,children:r(`div`,{className:e(`h-full w-full rounded-full bg-primary transition-transform`,o?`translate-x-0`:`animate-infinite-progress`,s&&`bg-destructive`)})})});Dropzone.displayName=`Dropzone`,p.displayName=`DropzoneArea`,m.displayName=`DropzoneDescription`,h.displayName=`DropzoneFileList`,g.displayName=`DropzoneFileListItem`,_.displayName=`DropzoneFileMessage`,v.displayName=`DropzoneMessage`,y.displayName=`DropzoneRemoveFile`,b.displayName=`DropzoneRetryFile`,x.displayName=`DropzoneTrigger`,S.displayName=`InfiniteProgress`;export{Dropzone,p as DropzoneArea,m as DropzoneDescription,h as DropzoneFileList,g as DropzoneFileListItem,_ as DropzoneFileMessage,v as DropzoneMessage,y as DropzoneRemoveFile,b as DropzoneRetryFile,x as DropzoneTrigger,o as ErrorCode,S as InfiniteProgress,useDropzone};
|
|
2
|
+
//# sourceMappingURL=dropzone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropzone.js","names":["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":"6SAaA,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,M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 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { t as __name } from "../rolldown-runtime-BhWHdk3m.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 { Empty, EmptyContent, EmptyContentProps, EmptyDescription, EmptyDescriptionProps, EmptyHeader, EmptyHeaderProps, EmptyMedia, EmptyMediaProps, EmptyProps, EmptyTitle, EmptyTitleProps };
|
|
21
|
+
//# sourceMappingURL=empty.d.ts.map
|
package/dist/components/empty.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import"../rolldown-runtime-BhWHdk3m.js";import{cn as e}from"../lib/utils.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{Empty,EmptyContent,EmptyDescription,EmptyHeader,EmptyMedia,EmptyTitle};
|
|
2
|
+
//# sourceMappingURL=empty.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"empty.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":"oKAgBA,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"}
|
|
@@ -1,2 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
|
|
2
|
+
import { Label } from "./label.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 { Field, FieldContent, FieldContentProps, FieldDescription, FieldDescriptionProps, FieldError, FieldErrorProps, FieldGroup, FieldGroupProps, FieldLabel, FieldLabelProps, FieldLegend, FieldLegendProps, FieldProps, FieldSeparator, FieldSeparatorProps, FieldSet, FieldSetProps, FieldTitle, FieldTitleProps, useFieldControlId };
|
|
39
|
+
//# sourceMappingURL=field.d.ts.map
|