@customafk/lunas-ui 0.0.57 → 0.0.60
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 +248 -99
- package/dist/{add-new-B9KK77jE.js → add-new-BrbEoynl.js} +1 -1
- package/dist/{add-new-B9KK77jE.js.map → add-new-BrbEoynl.js.map} +1 -1
- package/dist/{add-new-B9vW0r69.cjs → add-new-C9Gjd7QJ.cjs} +1 -1
- package/dist/{add-new-B9vW0r69.cjs.map → add-new-C9Gjd7QJ.cjs.map} +1 -1
- package/dist/alert-dialog-CnUUZRzI.js +2 -0
- package/dist/alert-dialog-CnUUZRzI.js.map +1 -0
- package/dist/{alert-dialog-Bc-61QzL.cjs → alert-dialog-csUZX4AP.cjs} +2 -2
- package/dist/alert-dialog-csUZX4AP.cjs.map +1 -0
- package/dist/{badge-1pcWNSLo.js → badge-gByXCsor.js} +2 -2
- package/dist/{badge-1pcWNSLo.js.map → badge-gByXCsor.js.map} +1 -1
- package/dist/{badge-xqIWOEbF.cjs → badge-i7tq2_AR.cjs} +2 -2
- package/dist/{badge-xqIWOEbF.cjs.map → badge-i7tq2_AR.cjs.map} +1 -1
- package/dist/{button-ChLnQHG9.d.ts → button-BHhyePyp.d.ts} +3 -3
- package/dist/button-ChpGfVjG.cjs.map +1 -1
- package/dist/button-DL_i4AVi.js.map +1 -1
- package/dist/{calendar-rpgciCA-.cjs → calendar-DtHmsN1p.cjs} +2 -2
- package/dist/calendar-DtHmsN1p.cjs.map +1 -0
- package/dist/{calendar-CB_hTeGT.js → calendar-aC4BQig6.js} +2 -2
- package/dist/calendar-aC4BQig6.js.map +1 -0
- package/dist/cards/simple-card.cjs +1 -1
- package/dist/cards/simple-card.cjs.map +1 -1
- package/dist/cards/simple-card.d.cts +0 -1
- package/dist/cards/simple-card.d.ts +0 -1
- package/dist/cards/simple-card.js +1 -1
- package/dist/cards/simple-card.js.map +1 -1
- package/dist/command-B3A4F1pB.js.map +1 -1
- package/dist/{command-CQ0BKof5.d.ts → command-C6YVs0fB.d.ts} +12 -12
- package/dist/command-D5rQByNQ.cjs.map +1 -1
- package/dist/{command-BkU08119.d.cts → command-Duxn64SV.d.cts} +12 -12
- package/dist/data-display/country.cjs +1 -1
- package/dist/data-display/country.cjs.map +1 -1
- package/dist/data-display/country.d.cts +0 -1
- package/dist/data-display/country.d.ts +1 -2
- package/dist/data-display/country.js +1 -1
- package/dist/data-display/country.js.map +1 -1
- package/dist/data-display/data-list.cjs +1 -1
- package/dist/data-display/data-list.js +1 -1
- package/dist/data-display/date-tooltip.cjs +1 -1
- package/dist/data-display/date-tooltip.js +1 -1
- package/dist/data-display/date.cjs +1 -1
- package/dist/data-display/date.d.cts +0 -2
- package/dist/data-display/date.d.ts +0 -2
- package/dist/data-display/date.js +1 -1
- package/dist/data-display/empty.cjs +1 -1
- package/dist/data-display/empty.d.ts +2 -2
- package/dist/data-display/empty.js +1 -1
- package/dist/data-display/name.cjs +1 -1
- package/dist/data-display/name.cjs.map +1 -1
- package/dist/data-display/name.d.cts +0 -2
- package/dist/data-display/name.d.ts +0 -2
- package/dist/data-display/name.js +1 -1
- package/dist/data-display/name.js.map +1 -1
- package/dist/data-display/phone-number.cjs +1 -1
- package/dist/data-display/phone-number.js +1 -1
- package/dist/data-display/role-badge.cjs +1 -1
- package/dist/data-display/role-badge.cjs.map +1 -1
- package/dist/data-display/role-badge.d.cts +0 -1
- package/dist/data-display/role-badge.d.ts +1 -2
- package/dist/data-display/role-badge.js +1 -1
- package/dist/data-display/role-badge.js.map +1 -1
- package/dist/data-display/statistic.cjs +1 -1
- package/dist/data-display/statistic.cjs.map +1 -1
- package/dist/data-display/statistic.d.cts +4 -4
- package/dist/data-display/statistic.d.ts +4 -4
- package/dist/data-display/statistic.js +1 -1
- package/dist/data-display/statistic.js.map +1 -1
- package/dist/date-Cbx2drzh.js +2 -0
- package/dist/date-Cbx2drzh.js.map +1 -0
- package/dist/date-qVDm6BT3.cjs +2 -0
- package/dist/date-qVDm6BT3.cjs.map +1 -0
- package/dist/dialog-BEJ3krbY.js.map +1 -1
- package/dist/{dialog-Dt7Z19tQ.d.ts → dialog-Dra_FGdL.d.ts} +12 -12
- package/dist/dialog-E5OYibMU.cjs.map +1 -1
- package/dist/{dialog-DBHKJa6T.d.cts → dialog-uj9sAbgt.d.cts} +12 -12
- package/dist/dialogs/confirm-dialog.cjs +1 -1
- package/dist/dialogs/confirm-dialog.js +1 -1
- package/dist/dialogs/detail-dialog/component/sidebar.cjs +1 -1
- package/dist/dialogs/detail-dialog/component/sidebar.d.cts +27 -28
- package/dist/dialogs/detail-dialog/component/sidebar.d.ts +4 -5
- package/dist/dialogs/detail-dialog/component/sidebar.js +1 -1
- package/dist/dialogs/detail-dialog/index.cjs +1 -1
- package/dist/dialogs/detail-dialog/index.cjs.map +1 -1
- package/dist/dialogs/detail-dialog/index.js +1 -1
- package/dist/dialogs/detail-dialog/index.js.map +1 -1
- package/dist/dialogs/error-dialog.cjs +1 -1
- package/dist/dialogs/error-dialog.d.cts +0 -2
- package/dist/dialogs/error-dialog.d.ts +0 -2
- package/dist/dialogs/error-dialog.js +1 -1
- package/dist/dialogs/form-dialog.cjs +1 -1
- package/dist/dialogs/form-dialog.cjs.map +1 -1
- package/dist/dialogs/form-dialog.d.cts +2 -2
- package/dist/dialogs/form-dialog.d.ts +2 -2
- package/dist/dialogs/form-dialog.js +1 -1
- package/dist/dialogs/form-dialog.js.map +1 -1
- package/dist/dialogs/loading-dialog.cjs +1 -1
- package/dist/dialogs/loading-dialog.cjs.map +1 -1
- package/dist/dialogs/loading-dialog.d.cts +0 -2
- package/dist/dialogs/loading-dialog.d.ts +0 -2
- package/dist/dialogs/loading-dialog.js +1 -1
- package/dist/dialogs/loading-dialog.js.map +1 -1
- package/dist/dropdown-menu-BF9QbIfo.js.map +1 -1
- package/dist/dropdown-menu-CIldv8D7.cjs.map +1 -1
- package/dist/error-dialog-Be_eV-D7.js +2 -0
- package/dist/error-dialog-Be_eV-D7.js.map +1 -0
- package/dist/error-dialog-CsZ9SHEm.cjs +2 -0
- package/dist/error-dialog-CsZ9SHEm.cjs.map +1 -0
- package/dist/{flex-uJ4bFSYt.js → flex-D_GSLR10.js} +2 -2
- package/dist/{flex-uJ4bFSYt.js.map → flex-D_GSLR10.js.map} +1 -1
- package/dist/{flex-DHnsdjKn.cjs → flex-DaTrJCBr.cjs} +2 -2
- package/dist/{flex-DHnsdjKn.cjs.map → flex-DaTrJCBr.cjs.map} +1 -1
- package/dist/form-Dcd2HzUB.cjs +2 -0
- package/dist/form-Dcd2HzUB.cjs.map +1 -0
- package/dist/form-RRTCXIG6.js +2 -0
- package/dist/form-RRTCXIG6.js.map +1 -0
- package/dist/form-wrapper-CjFQKRzY.cjs +2 -0
- package/dist/form-wrapper-CjFQKRzY.cjs.map +1 -0
- package/dist/form-wrapper-D-KkrCiZ.js +2 -0
- package/dist/form-wrapper-D-KkrCiZ.js.map +1 -0
- package/dist/forms/combobox-field.cjs +1 -1
- package/dist/forms/combobox-field.cjs.map +1 -1
- package/dist/forms/combobox-field.d.cts +2 -2
- package/dist/forms/combobox-field.d.ts +2 -2
- package/dist/forms/combobox-field.js +1 -1
- package/dist/forms/combobox-field.js.map +1 -1
- package/dist/forms/date-field.cjs +1 -1
- package/dist/forms/date-field.cjs.map +1 -1
- package/dist/forms/date-field.d.cts +2 -2
- package/dist/forms/date-field.d.ts +2 -2
- package/dist/forms/date-field.js +1 -1
- package/dist/forms/date-field.js.map +1 -1
- package/dist/forms/form-wrapper.cjs +1 -1
- package/dist/forms/form-wrapper.d.cts +2 -3
- package/dist/forms/form-wrapper.d.ts +2 -3
- package/dist/forms/form-wrapper.js +1 -1
- package/dist/forms/multi-select-field.cjs +1 -1
- package/dist/forms/multi-select-field.cjs.map +1 -1
- package/dist/forms/multi-select-field.d.cts +2 -2
- package/dist/forms/multi-select-field.js +1 -1
- package/dist/forms/multi-select-field.js.map +1 -1
- package/dist/forms/number-field.cjs +1 -1
- package/dist/forms/number-field.cjs.map +1 -1
- package/dist/forms/number-field.d.cts +2 -2
- package/dist/forms/number-field.d.ts +2 -2
- package/dist/forms/number-field.js +1 -1
- package/dist/forms/number-field.js.map +1 -1
- package/dist/forms/password-field.cjs +1 -1
- package/dist/forms/password-field.cjs.map +1 -1
- package/dist/forms/password-field.d.cts +2 -2
- package/dist/forms/password-field.d.ts +2 -2
- package/dist/forms/password-field.js +1 -1
- package/dist/forms/password-field.js.map +1 -1
- package/dist/forms/select-field.cjs +1 -1
- package/dist/forms/select-field.cjs.map +1 -1
- package/dist/forms/select-field.d.cts +2 -2
- package/dist/forms/select-field.d.ts +2 -2
- package/dist/forms/select-field.js +1 -1
- package/dist/forms/select-field.js.map +1 -1
- package/dist/forms/switch-field.cjs +1 -1
- package/dist/forms/switch-field.cjs.map +1 -1
- package/dist/forms/switch-field.d.cts +2 -2
- package/dist/forms/switch-field.d.ts +2 -2
- package/dist/forms/switch-field.js +1 -1
- package/dist/forms/switch-field.js.map +1 -1
- package/dist/forms/text-field.cjs +1 -1
- package/dist/forms/text-field.cjs.map +1 -1
- package/dist/forms/text-field.d.cts +2 -2
- package/dist/forms/text-field.d.ts +2 -2
- package/dist/forms/text-field.js +1 -1
- package/dist/forms/text-field.js.map +1 -1
- package/dist/forms/textarea-field.cjs +1 -1
- package/dist/forms/textarea-field.d.cts +2 -2
- package/dist/forms/textarea-field.d.ts +2 -2
- package/dist/forms/textarea-field.js +1 -1
- package/dist/{input-BQYGZywO.d.cts → input-6yLVoluZ.d.cts} +3 -3
- package/dist/{input-OWyLq45f.js → input-B2PP82lE.js} +2 -2
- package/dist/input-B2PP82lE.js.map +1 -0
- package/dist/{input-B8bT3wuo.cjs → input-DQF8Uxmk.cjs} +2 -2
- package/dist/input-DQF8Uxmk.cjs.map +1 -0
- package/dist/{input-B8FXpdwz.d.ts → input-MftSrRAM.d.ts} +3 -3
- package/dist/label-BpefWj7m.js +2 -0
- package/dist/{label-BQ52Pjw-.js.map → label-BpefWj7m.js.map} +1 -1
- package/dist/label-BvHMsK0O.cjs +2 -0
- package/dist/{label-3eYQRRYp.cjs.map → label-BvHMsK0O.cjs.map} +1 -1
- package/dist/layouts/app-layout/index.cjs +1 -1
- package/dist/layouts/app-layout/index.cjs.map +1 -1
- package/dist/layouts/app-layout/index.d.cts +25 -25
- package/dist/layouts/app-layout/index.d.ts +26 -26
- package/dist/layouts/app-layout/index.js +1 -1
- package/dist/layouts/app-layout/index.js.map +1 -1
- package/dist/layouts/flex.cjs +1 -1
- package/dist/layouts/flex.d.cts +2 -2
- package/dist/layouts/flex.d.ts +2 -2
- package/dist/layouts/flex.js +1 -1
- package/dist/{multi-select-DoV9aD32.cjs → multi-select-Ch4hJ1ZJ.cjs} +2 -2
- package/dist/multi-select-Ch4hJ1ZJ.cjs.map +1 -0
- package/dist/multi-select-l55hOOtW.js +2 -0
- package/dist/multi-select-l55hOOtW.js.map +1 -0
- package/dist/paragraph-BsEYXIR3.cjs.map +1 -1
- package/dist/paragraph-D4klQX4h.js.map +1 -1
- package/dist/popover-BAGWkHPy.js.map +1 -1
- package/dist/popover-sgf8XI5P.cjs.map +1 -1
- package/dist/progress-CMMXIQct.js +2 -0
- package/dist/{progress-DPisovgi.js.map → progress-CMMXIQct.js.map} +1 -1
- package/dist/progress-IkXemE6u.cjs +2 -0
- package/dist/{progress-MyGITZ3w.cjs.map → progress-IkXemE6u.cjs.map} +1 -1
- package/dist/{refresh-By25Z7zj.cjs → refresh-CAScDb8R.cjs} +1 -1
- package/dist/{refresh-By25Z7zj.cjs.map → refresh-CAScDb8R.cjs.map} +1 -1
- package/dist/{refresh-CMzmHeMf.js → refresh-D4LYYQln.js} +1 -1
- package/dist/{refresh-CMzmHeMf.js.map → refresh-D4LYYQln.js.map} +1 -1
- package/dist/scroll-area-CPQoJKt1.js.map +1 -1
- package/dist/scroll-area-D7O1NyZn.cjs.map +1 -1
- package/dist/{search-input-BmAoqcee.cjs → search-input-B1eWzWZj.cjs} +2 -2
- package/dist/{search-input-BmAoqcee.cjs.map → search-input-B1eWzWZj.cjs.map} +1 -1
- package/dist/{search-input-Ba8aUECr.js → search-input-BZtDbdjl.js} +2 -2
- package/dist/{search-input-Ba8aUECr.js.map → search-input-BZtDbdjl.js.map} +1 -1
- package/dist/select-C7na5CE5.cjs +2 -0
- package/dist/select-C7na5CE5.cjs.map +1 -0
- package/dist/select-VpccO3h2.js +2 -0
- package/dist/select-VpccO3h2.js.map +1 -0
- package/dist/{separator-DJ-8s4B1.d.cts → separator-C0YKWxkk.d.cts} +3 -3
- package/dist/{separator-CJHYnmH1.d.ts → separator-D6-cZUiB.d.ts} +3 -3
- package/dist/{separator-Bp3QE0oo.js → separator-DW2rRXaF.js} +1 -1
- package/dist/{separator-Bp3QE0oo.js.map → separator-DW2rRXaF.js.map} +1 -1
- package/dist/{separator-CECnaAdc.cjs → separator-DbcVW13X.cjs} +1 -1
- package/dist/{separator-CECnaAdc.cjs.map → separator-DbcVW13X.cjs.map} +1 -1
- package/dist/{sheet-CvstHEA7.cjs → sheet-BoPRwRzk.cjs} +1 -1
- package/dist/sheet-BoPRwRzk.cjs.map +1 -0
- package/dist/{sheet-B2CNJMzu.js → sheet-CJscm87z.js} +1 -1
- package/dist/sheet-CJscm87z.js.map +1 -0
- package/dist/sidebar-BCsgl6i1.cjs +2 -0
- package/dist/sidebar-BCsgl6i1.cjs.map +1 -0
- package/dist/sidebar-BEgx0ScE.js +2 -0
- package/dist/sidebar-BEgx0ScE.js.map +1 -0
- package/dist/{skeleton-DcRggqJa.cjs → skeleton-1syVaGRv.cjs} +1 -1
- package/dist/{skeleton-DcRggqJa.cjs.map → skeleton-1syVaGRv.cjs.map} +1 -1
- package/dist/{skeleton-BSWmwJUf.js → skeleton-D_7tekGk.js} +1 -1
- package/dist/{skeleton-BSWmwJUf.js.map → skeleton-D_7tekGk.js.map} +1 -1
- package/dist/{switch-FHFPaOds.js → switch-DxMWudiz.js} +2 -2
- package/dist/{switch-FHFPaOds.js.map → switch-DxMWudiz.js.map} +1 -1
- package/dist/{switch-ozERHRm5.cjs → switch-fR9s61cJ.cjs} +2 -2
- package/dist/{switch-ozERHRm5.cjs.map → switch-fR9s61cJ.cjs.map} +1 -1
- package/dist/table/index.cjs +1 -1
- package/dist/table/index.cjs.map +1 -1
- package/dist/table/index.d.cts +2 -2
- package/dist/table/index.d.ts +2 -2
- package/dist/table/index.js +1 -1
- package/dist/table/index.js.map +1 -1
- package/dist/{table-Dgk7z91H.cjs → table-DxHSASjm.cjs} +2 -2
- package/dist/{table-Dgk7z91H.cjs.map → table-DxHSASjm.cjs.map} +1 -1
- package/dist/{table-goPaI3yw.js → table-DxiQX7c8.js} +2 -2
- package/dist/{table-goPaI3yw.js.map → table-DxiQX7c8.js.map} +1 -1
- package/dist/{textarea-DSJO-BLA.js → textarea-BZu5g3z6.js} +2 -2
- package/dist/textarea-BZu5g3z6.js.map +1 -0
- package/dist/{textarea-CtdlfMIV.cjs → textarea-qcxhp2mg.cjs} +2 -2
- package/dist/textarea-qcxhp2mg.cjs.map +1 -0
- package/dist/title-DONX1fR6.cjs.map +1 -1
- package/dist/title-itXqz0us.js.map +1 -1
- package/dist/{toggle-06cycHir.js → toggle-Biu3ZQOw.js} +2 -2
- package/dist/{toggle-06cycHir.js.map → toggle-Biu3ZQOw.js.map} +1 -1
- package/dist/{toggle-D5tumZ8L.d.cts → toggle-BxWWejw5.d.ts} +4 -4
- package/dist/{toggle-BIHM3COb.cjs → toggle-C50tM61w.cjs} +2 -2
- package/dist/{toggle-BIHM3COb.cjs.map → toggle-C50tM61w.cjs.map} +1 -1
- package/dist/{toggle-Dd0rFKhT.d.ts → toggle-DvJddJPj.d.cts} +4 -4
- package/dist/tooltip-B7S7TrMj.js +2 -0
- package/dist/{tooltip-Ba2AdN_7.js.map → tooltip-B7S7TrMj.js.map} +1 -1
- package/dist/{tooltip-DRqQqSFW.cjs → tooltip-BX3D74kN.cjs} +2 -2
- package/dist/{tooltip-DRqQqSFW.cjs.map → tooltip-BX3D74kN.cjs.map} +1 -1
- package/dist/{tooltip-BnRE0jV2.d.ts → tooltip-CcNSIS_A.d.ts} +6 -6
- package/dist/{tooltip-Dkh_dieJ.d.cts → tooltip-Ccg2G_fB.d.cts} +6 -6
- package/dist/types-BN8HhYHR.cjs.map +1 -1
- package/dist/types-DDfAVYxf.js.map +1 -1
- package/dist/{types-CmcNT14g.d.ts → types-engjL0nN.d.ts} +1 -1
- package/dist/typography/paragraph.d.cts +2 -2
- package/dist/typography/paragraph.d.ts +2 -2
- package/dist/typography/title.d.cts +2 -2
- package/dist/typography/title.d.ts +2 -2
- package/dist/ui/alert-dialog.cjs +1 -1
- package/dist/ui/alert-dialog.d.cts +12 -12
- package/dist/ui/alert-dialog.d.ts +12 -12
- package/dist/ui/alert-dialog.js +1 -1
- package/dist/ui/alert.cjs +1 -1
- package/dist/ui/alert.cjs.map +1 -1
- package/dist/ui/alert.d.ts +6 -6
- package/dist/ui/alert.js +1 -1
- package/dist/ui/alert.js.map +1 -1
- package/dist/ui/aspect-ratio.cjs +1 -1
- package/dist/ui/aspect-ratio.cjs.map +1 -1
- package/dist/ui/aspect-ratio.d.cts +2 -2
- package/dist/ui/aspect-ratio.d.ts +2 -2
- package/dist/ui/aspect-ratio.js +1 -1
- package/dist/ui/aspect-ratio.js.map +1 -1
- package/dist/ui/avatar.cjs +1 -1
- package/dist/ui/avatar.cjs.map +1 -1
- package/dist/ui/avatar.d.cts +4 -4
- package/dist/ui/avatar.d.ts +4 -4
- package/dist/ui/avatar.js +1 -1
- package/dist/ui/avatar.js.map +1 -1
- package/dist/ui/badge.cjs +1 -1
- package/dist/ui/badge.d.cts +2 -2
- package/dist/ui/badge.d.ts +4 -4
- package/dist/ui/badge.js +1 -1
- package/dist/ui/breadcrumb.cjs +1 -1
- package/dist/ui/breadcrumb.cjs.map +1 -1
- package/dist/ui/breadcrumb.d.cts +8 -8
- package/dist/ui/breadcrumb.d.ts +8 -8
- package/dist/ui/breadcrumb.js +1 -1
- package/dist/ui/breadcrumb.js.map +1 -1
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/buttons/add-new.cjs +1 -1
- package/dist/ui/buttons/add-new.js +1 -1
- package/dist/ui/buttons/refresh.cjs +1 -1
- package/dist/ui/buttons/refresh.js +1 -1
- package/dist/ui/buttons/upload-image.cjs +1 -1
- package/dist/ui/buttons/upload-image.cjs.map +1 -1
- package/dist/ui/buttons/upload-image.js +1 -1
- package/dist/ui/buttons/upload-image.js.map +1 -1
- package/dist/ui/calendar.cjs +1 -1
- package/dist/ui/calendar.d.cts +3 -3
- package/dist/ui/calendar.d.ts +4 -4
- package/dist/ui/calendar.js +1 -1
- package/dist/ui/card.d.cts +8 -8
- package/dist/ui/card.d.ts +8 -8
- package/dist/ui/carousel.cjs +1 -1
- package/dist/ui/carousel.cjs.map +1 -1
- package/dist/ui/carousel.d.cts +6 -6
- package/dist/ui/carousel.d.ts +7 -7
- package/dist/ui/carousel.js +1 -1
- package/dist/ui/carousel.js.map +1 -1
- package/dist/ui/collapsible.cjs +1 -1
- package/dist/ui/collapsible.cjs.map +1 -1
- package/dist/ui/collapsible.d.cts +4 -4
- package/dist/ui/collapsible.d.ts +4 -4
- package/dist/ui/collapsible.js +1 -1
- package/dist/ui/collapsible.js.map +1 -1
- package/dist/ui/command.d.cts +2 -2
- package/dist/ui/command.d.ts +2 -2
- package/dist/ui/context-menu.cjs +1 -1
- package/dist/ui/context-menu.cjs.map +1 -1
- package/dist/ui/context-menu.d.cts +16 -16
- package/dist/ui/context-menu.d.ts +16 -16
- package/dist/ui/context-menu.js +1 -1
- package/dist/ui/context-menu.js.map +1 -1
- package/dist/ui/dialog.d.cts +1 -1
- package/dist/ui/dialog.d.ts +1 -1
- package/dist/ui/dropdown-menu.d.cts +16 -16
- package/dist/ui/dropdown-menu.d.ts +16 -16
- package/dist/ui/file-uploader.cjs +2 -2
- package/dist/ui/file-uploader.cjs.map +1 -1
- package/dist/ui/file-uploader.d.cts +2 -2
- package/dist/ui/file-uploader.d.ts +2 -2
- package/dist/ui/file-uploader.js +2 -2
- package/dist/ui/file-uploader.js.map +1 -1
- package/dist/ui/form.cjs +1 -1
- package/dist/ui/form.d.cts +7 -7
- package/dist/ui/form.d.ts +7 -7
- package/dist/ui/form.js +1 -1
- package/dist/ui/hover-card.cjs +1 -1
- package/dist/ui/hover-card.cjs.map +1 -1
- package/dist/ui/hover-card.d.cts +4 -4
- package/dist/ui/hover-card.d.ts +4 -4
- package/dist/ui/hover-card.js +1 -1
- package/dist/ui/hover-card.js.map +1 -1
- package/dist/ui/image.cjs +2 -0
- package/dist/ui/image.cjs.map +1 -0
- package/dist/ui/image.d.cts +14 -0
- package/dist/ui/image.d.ts +14 -0
- package/dist/ui/image.js +2 -0
- package/dist/ui/image.js.map +1 -0
- package/dist/ui/input-otp.cjs +1 -1
- package/dist/ui/input-otp.cjs.map +1 -1
- package/dist/ui/input-otp.d.cts +5 -5
- package/dist/ui/input-otp.d.ts +5 -5
- package/dist/ui/input-otp.js +1 -1
- package/dist/ui/input-otp.js.map +1 -1
- package/dist/ui/input.cjs +1 -1
- package/dist/ui/input.d.cts +1 -1
- package/dist/ui/input.d.ts +1 -1
- package/dist/ui/input.js +1 -1
- package/dist/ui/inputs/search-input.cjs +1 -1
- package/dist/ui/inputs/search-input.d.cts +3 -3
- package/dist/ui/inputs/search-input.d.ts +3 -3
- package/dist/ui/inputs/search-input.js +1 -1
- package/dist/ui/label.cjs +1 -1
- package/dist/ui/label.d.cts +2 -2
- package/dist/ui/label.d.ts +2 -2
- package/dist/ui/label.js +1 -1
- package/dist/ui/menubar.cjs +1 -1
- package/dist/ui/menubar.cjs.map +1 -1
- package/dist/ui/menubar.d.cts +17 -17
- package/dist/ui/menubar.d.ts +17 -17
- package/dist/ui/menubar.js +1 -1
- package/dist/ui/menubar.js.map +1 -1
- package/dist/ui/multi-select.cjs +1 -1
- package/dist/ui/multi-select.d.cts +2 -2
- package/dist/ui/multi-select.d.ts +2 -2
- package/dist/ui/multi-select.js +1 -1
- package/dist/ui/navigation-menu.cjs.map +1 -1
- package/dist/ui/navigation-menu.d.cts +9 -9
- package/dist/ui/navigation-menu.d.ts +9 -9
- package/dist/ui/navigation-menu.js.map +1 -1
- package/dist/ui/pagination.cjs +1 -1
- package/dist/ui/pagination.cjs.map +1 -1
- package/dist/ui/pagination.d.cts +8 -8
- package/dist/ui/pagination.d.ts +9 -9
- package/dist/ui/pagination.js +1 -1
- package/dist/ui/pagination.js.map +1 -1
- package/dist/ui/popover.d.cts +5 -5
- package/dist/ui/popover.d.ts +5 -5
- package/dist/ui/progress.cjs +1 -1
- package/dist/ui/progress.d.cts +2 -2
- package/dist/ui/progress.d.ts +2 -2
- package/dist/ui/progress.js +1 -1
- package/dist/ui/radio-group.cjs +1 -1
- package/dist/ui/radio-group.cjs.map +1 -1
- package/dist/ui/radio-group.d.cts +3 -3
- package/dist/ui/radio-group.d.ts +3 -3
- package/dist/ui/radio-group.js +1 -1
- package/dist/ui/radio-group.js.map +1 -1
- package/dist/ui/resizable.cjs +1 -1
- package/dist/ui/resizable.cjs.map +1 -1
- package/dist/ui/resizable.d.cts +4 -4
- package/dist/ui/resizable.d.ts +4 -4
- package/dist/ui/resizable.js +1 -1
- package/dist/ui/resizable.js.map +1 -1
- package/dist/ui/scroll-area.d.cts +3 -3
- package/dist/ui/scroll-area.d.ts +3 -3
- package/dist/ui/select.cjs +1 -1
- package/dist/ui/select.d.cts +11 -11
- package/dist/ui/select.d.ts +11 -11
- package/dist/ui/select.js +1 -1
- package/dist/ui/separator.cjs +1 -1
- package/dist/ui/separator.d.cts +1 -1
- package/dist/ui/separator.d.ts +1 -1
- package/dist/ui/separator.js +1 -1
- package/dist/ui/sheet.cjs +1 -1
- package/dist/ui/sheet.d.cts +9 -9
- package/dist/ui/sheet.d.ts +9 -9
- package/dist/ui/sheet.js +1 -1
- package/dist/ui/sidebar.cjs +2 -1
- package/dist/ui/sidebar.cjs.map +1 -0
- package/dist/ui/sidebar.d.cts +29 -29
- package/dist/ui/sidebar.d.ts +30 -30
- package/dist/ui/sidebar.js +2 -1
- package/dist/ui/sidebar.js.map +1 -0
- package/dist/ui/skeleton.cjs +1 -1
- package/dist/ui/skeleton.d.cts +2 -2
- package/dist/ui/skeleton.d.ts +2 -2
- package/dist/ui/skeleton.js +1 -1
- package/dist/ui/slider.cjs +1 -1
- package/dist/ui/slider.cjs.map +1 -1
- package/dist/ui/slider.d.cts +2 -2
- package/dist/ui/slider.d.ts +2 -2
- package/dist/ui/slider.js +1 -1
- package/dist/ui/slider.js.map +1 -1
- package/dist/ui/sonner.d.cts +2 -2
- package/dist/ui/sonner.d.ts +2 -2
- package/dist/ui/switch.cjs +1 -1
- package/dist/ui/switch.d.cts +2 -2
- package/dist/ui/switch.d.ts +2 -2
- package/dist/ui/switch.js +1 -1
- package/dist/ui/table.cjs +1 -1
- package/dist/ui/table.d.cts +9 -9
- package/dist/ui/table.d.ts +9 -9
- package/dist/ui/table.js +1 -1
- package/dist/ui/tabs.cjs.map +1 -1
- package/dist/ui/tabs.d.cts +5 -5
- package/dist/ui/tabs.d.ts +5 -5
- package/dist/ui/tabs.js.map +1 -1
- package/dist/ui/textarea.cjs +1 -1
- package/dist/ui/textarea.d.cts +2 -2
- package/dist/ui/textarea.d.ts +2 -2
- package/dist/ui/textarea.js +1 -1
- package/dist/ui/toggle-group.cjs +1 -1
- package/dist/ui/toggle-group.cjs.map +1 -1
- package/dist/ui/toggle-group.d.cts +4 -4
- package/dist/ui/toggle-group.d.ts +4 -4
- package/dist/ui/toggle-group.js +1 -1
- package/dist/ui/toggle-group.js.map +1 -1
- package/dist/ui/toggle.cjs +1 -1
- package/dist/ui/toggle.d.cts +1 -1
- package/dist/ui/toggle.d.ts +1 -1
- package/dist/ui/toggle.js +1 -1
- package/dist/ui/tooltip.cjs +1 -1
- package/dist/ui/tooltip.d.cts +1 -1
- package/dist/ui/tooltip.d.ts +1 -1
- package/dist/ui/tooltip.js +1 -1
- package/package.json +15 -5
- package/dist/alert-dialog-Bc-61QzL.cjs.map +0 -1
- package/dist/alert-dialog-kpuqvmVo.js +0 -2
- package/dist/alert-dialog-kpuqvmVo.js.map +0 -1
- package/dist/calendar-CB_hTeGT.js.map +0 -1
- package/dist/calendar-rpgciCA-.cjs.map +0 -1
- package/dist/date-D7i-nFOS.js +0 -2
- package/dist/date-D7i-nFOS.js.map +0 -1
- package/dist/date-DevNulgp.cjs +0 -2
- package/dist/date-DevNulgp.cjs.map +0 -1
- package/dist/error-dialog-DvTlwpSn.cjs +0 -2
- package/dist/error-dialog-DvTlwpSn.cjs.map +0 -1
- package/dist/error-dialog-e9mFaOuG.js +0 -2
- package/dist/error-dialog-e9mFaOuG.js.map +0 -1
- package/dist/form-BzvxUv0a.js +0 -2
- package/dist/form-BzvxUv0a.js.map +0 -1
- package/dist/form-CXu8t0VS.cjs +0 -2
- package/dist/form-CXu8t0VS.cjs.map +0 -1
- package/dist/form-wrapper-CZKtb1j5.cjs +0 -2
- package/dist/form-wrapper-CZKtb1j5.cjs.map +0 -1
- package/dist/form-wrapper-Cks4xmCV.js +0 -2
- package/dist/form-wrapper-Cks4xmCV.js.map +0 -1
- package/dist/input-B8bT3wuo.cjs.map +0 -1
- package/dist/input-OWyLq45f.js.map +0 -1
- package/dist/label-3eYQRRYp.cjs +0 -2
- package/dist/label-BQ52Pjw-.js +0 -2
- package/dist/layouts/main/index.cjs +0 -2
- package/dist/layouts/main/index.cjs.map +0 -1
- package/dist/layouts/main/index.d.cts +0 -17
- package/dist/layouts/main/index.d.ts +0 -17
- package/dist/layouts/main/index.js +0 -2
- package/dist/layouts/main/index.js.map +0 -1
- package/dist/multi-select-DkEzuDXi.js +0 -2
- package/dist/multi-select-DkEzuDXi.js.map +0 -1
- package/dist/multi-select-DoV9aD32.cjs.map +0 -1
- package/dist/progress-DPisovgi.js +0 -2
- package/dist/progress-MyGITZ3w.cjs +0 -2
- package/dist/select-BjTQmEN7.js +0 -2
- package/dist/select-BjTQmEN7.js.map +0 -1
- package/dist/select-BlPiYiG_.cjs +0 -2
- package/dist/select-BlPiYiG_.cjs.map +0 -1
- package/dist/sheet-B2CNJMzu.js.map +0 -1
- package/dist/sheet-CvstHEA7.cjs.map +0 -1
- package/dist/sidebar-BDefeoUz.js +0 -2
- package/dist/sidebar-BDefeoUz.js.map +0 -1
- package/dist/sidebar-C6MoqLW4.cjs +0 -2
- package/dist/sidebar-C6MoqLW4.cjs.map +0 -1
- package/dist/sidebar-CoAMlkou.js +0 -2
- package/dist/sidebar-CoAMlkou.js.map +0 -1
- package/dist/sidebar-Dzl9-lVV.cjs +0 -2
- package/dist/sidebar-Dzl9-lVV.cjs.map +0 -1
- package/dist/textarea-CtdlfMIV.cjs.map +0 -1
- package/dist/textarea-DSJO-BLA.js.map +0 -1
- package/dist/tooltip-Ba2AdN_7.js +0 -2
package/dist/ui/dialog.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "../dialog-
|
|
1
|
+
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "../dialog-uj9sAbgt.cjs";
|
|
2
2
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
|
package/dist/ui/dialog.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "../dialog-
|
|
1
|
+
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "../dialog-Dra_FGdL.js";
|
|
2
2
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime100 from "react/jsx-runtime";
|
|
2
2
|
import { DropdownMenu as DropdownMenu$1 } from "radix-ui";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/ui/dropdown-menu.d.ts
|
|
5
5
|
declare function DropdownMenu({
|
|
6
6
|
...props
|
|
7
|
-
}: React.ComponentProps<typeof DropdownMenu$1.Root>):
|
|
7
|
+
}: React.ComponentProps<typeof DropdownMenu$1.Root>): react_jsx_runtime100.JSX.Element;
|
|
8
8
|
declare function DropdownMenuPortal({
|
|
9
9
|
...props
|
|
10
|
-
}: React.ComponentProps<typeof DropdownMenu$1.Portal>):
|
|
10
|
+
}: React.ComponentProps<typeof DropdownMenu$1.Portal>): react_jsx_runtime100.JSX.Element;
|
|
11
11
|
declare function DropdownMenuTrigger({
|
|
12
12
|
...props
|
|
13
|
-
}: React.ComponentProps<typeof DropdownMenu$1.Trigger>):
|
|
13
|
+
}: React.ComponentProps<typeof DropdownMenu$1.Trigger>): react_jsx_runtime100.JSX.Element;
|
|
14
14
|
declare function DropdownMenuContent({
|
|
15
15
|
className,
|
|
16
16
|
sideOffset,
|
|
17
17
|
align,
|
|
18
18
|
...props
|
|
19
|
-
}: React.ComponentProps<typeof DropdownMenu$1.Content>):
|
|
19
|
+
}: React.ComponentProps<typeof DropdownMenu$1.Content>): react_jsx_runtime100.JSX.Element;
|
|
20
20
|
declare function DropdownMenuGroup({
|
|
21
21
|
...props
|
|
22
|
-
}: React.ComponentProps<typeof DropdownMenu$1.Group>):
|
|
22
|
+
}: React.ComponentProps<typeof DropdownMenu$1.Group>): react_jsx_runtime100.JSX.Element;
|
|
23
23
|
declare function DropdownMenuItem({
|
|
24
24
|
className,
|
|
25
25
|
inset,
|
|
@@ -28,39 +28,39 @@ declare function DropdownMenuItem({
|
|
|
28
28
|
}: React.ComponentProps<typeof DropdownMenu$1.Item> & {
|
|
29
29
|
inset?: boolean;
|
|
30
30
|
variant?: 'default' | 'destructive';
|
|
31
|
-
}):
|
|
31
|
+
}): react_jsx_runtime100.JSX.Element;
|
|
32
32
|
declare function DropdownMenuCheckboxItem({
|
|
33
33
|
className,
|
|
34
34
|
children,
|
|
35
35
|
checked,
|
|
36
36
|
...props
|
|
37
|
-
}: React.ComponentProps<typeof DropdownMenu$1.CheckboxItem>):
|
|
37
|
+
}: React.ComponentProps<typeof DropdownMenu$1.CheckboxItem>): react_jsx_runtime100.JSX.Element;
|
|
38
38
|
declare function DropdownMenuRadioGroup({
|
|
39
39
|
...props
|
|
40
|
-
}: React.ComponentProps<typeof DropdownMenu$1.RadioGroup>):
|
|
40
|
+
}: React.ComponentProps<typeof DropdownMenu$1.RadioGroup>): react_jsx_runtime100.JSX.Element;
|
|
41
41
|
declare function DropdownMenuRadioItem({
|
|
42
42
|
className,
|
|
43
43
|
children,
|
|
44
44
|
...props
|
|
45
|
-
}: React.ComponentProps<typeof DropdownMenu$1.RadioItem>):
|
|
45
|
+
}: React.ComponentProps<typeof DropdownMenu$1.RadioItem>): react_jsx_runtime100.JSX.Element;
|
|
46
46
|
declare function DropdownMenuLabel({
|
|
47
47
|
className,
|
|
48
48
|
inset,
|
|
49
49
|
...props
|
|
50
50
|
}: React.ComponentProps<typeof DropdownMenu$1.Label> & {
|
|
51
51
|
inset?: boolean;
|
|
52
|
-
}):
|
|
52
|
+
}): react_jsx_runtime100.JSX.Element;
|
|
53
53
|
declare function DropdownMenuSeparator({
|
|
54
54
|
className,
|
|
55
55
|
...props
|
|
56
|
-
}: React.ComponentProps<typeof DropdownMenu$1.Separator>):
|
|
56
|
+
}: React.ComponentProps<typeof DropdownMenu$1.Separator>): react_jsx_runtime100.JSX.Element;
|
|
57
57
|
declare function DropdownMenuShortcut({
|
|
58
58
|
className,
|
|
59
59
|
...props
|
|
60
|
-
}: React.ComponentProps<'span'>):
|
|
60
|
+
}: React.ComponentProps<'span'>): react_jsx_runtime100.JSX.Element;
|
|
61
61
|
declare function DropdownMenuSub({
|
|
62
62
|
...props
|
|
63
|
-
}: React.ComponentProps<typeof DropdownMenu$1.Sub>):
|
|
63
|
+
}: React.ComponentProps<typeof DropdownMenu$1.Sub>): react_jsx_runtime100.JSX.Element;
|
|
64
64
|
declare function DropdownMenuSubTrigger({
|
|
65
65
|
className,
|
|
66
66
|
inset,
|
|
@@ -68,11 +68,11 @@ declare function DropdownMenuSubTrigger({
|
|
|
68
68
|
...props
|
|
69
69
|
}: React.ComponentProps<typeof DropdownMenu$1.SubTrigger> & {
|
|
70
70
|
inset?: boolean;
|
|
71
|
-
}):
|
|
71
|
+
}): react_jsx_runtime100.JSX.Element;
|
|
72
72
|
declare function DropdownMenuSubContent({
|
|
73
73
|
className,
|
|
74
74
|
...props
|
|
75
|
-
}: React.ComponentProps<typeof DropdownMenu$1.SubContent>):
|
|
75
|
+
}: React.ComponentProps<typeof DropdownMenu$1.SubContent>): react_jsx_runtime100.JSX.Element;
|
|
76
76
|
//#endregion
|
|
77
77
|
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
|
|
78
78
|
//# sourceMappingURL=dropdown-menu.d.cts.map
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime85 from "react/jsx-runtime";
|
|
2
2
|
import { DropdownMenu as DropdownMenu$1 } from "radix-ui";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/ui/dropdown-menu.d.ts
|
|
5
5
|
declare function DropdownMenu({
|
|
6
6
|
...props
|
|
7
|
-
}: React.ComponentProps<typeof DropdownMenu$1.Root>):
|
|
7
|
+
}: React.ComponentProps<typeof DropdownMenu$1.Root>): react_jsx_runtime85.JSX.Element;
|
|
8
8
|
declare function DropdownMenuPortal({
|
|
9
9
|
...props
|
|
10
|
-
}: React.ComponentProps<typeof DropdownMenu$1.Portal>):
|
|
10
|
+
}: React.ComponentProps<typeof DropdownMenu$1.Portal>): react_jsx_runtime85.JSX.Element;
|
|
11
11
|
declare function DropdownMenuTrigger({
|
|
12
12
|
...props
|
|
13
|
-
}: React.ComponentProps<typeof DropdownMenu$1.Trigger>):
|
|
13
|
+
}: React.ComponentProps<typeof DropdownMenu$1.Trigger>): react_jsx_runtime85.JSX.Element;
|
|
14
14
|
declare function DropdownMenuContent({
|
|
15
15
|
className,
|
|
16
16
|
sideOffset,
|
|
17
17
|
align,
|
|
18
18
|
...props
|
|
19
|
-
}: React.ComponentProps<typeof DropdownMenu$1.Content>):
|
|
19
|
+
}: React.ComponentProps<typeof DropdownMenu$1.Content>): react_jsx_runtime85.JSX.Element;
|
|
20
20
|
declare function DropdownMenuGroup({
|
|
21
21
|
...props
|
|
22
|
-
}: React.ComponentProps<typeof DropdownMenu$1.Group>):
|
|
22
|
+
}: React.ComponentProps<typeof DropdownMenu$1.Group>): react_jsx_runtime85.JSX.Element;
|
|
23
23
|
declare function DropdownMenuItem({
|
|
24
24
|
className,
|
|
25
25
|
inset,
|
|
@@ -28,39 +28,39 @@ declare function DropdownMenuItem({
|
|
|
28
28
|
}: React.ComponentProps<typeof DropdownMenu$1.Item> & {
|
|
29
29
|
inset?: boolean;
|
|
30
30
|
variant?: 'default' | 'destructive';
|
|
31
|
-
}):
|
|
31
|
+
}): react_jsx_runtime85.JSX.Element;
|
|
32
32
|
declare function DropdownMenuCheckboxItem({
|
|
33
33
|
className,
|
|
34
34
|
children,
|
|
35
35
|
checked,
|
|
36
36
|
...props
|
|
37
|
-
}: React.ComponentProps<typeof DropdownMenu$1.CheckboxItem>):
|
|
37
|
+
}: React.ComponentProps<typeof DropdownMenu$1.CheckboxItem>): react_jsx_runtime85.JSX.Element;
|
|
38
38
|
declare function DropdownMenuRadioGroup({
|
|
39
39
|
...props
|
|
40
|
-
}: React.ComponentProps<typeof DropdownMenu$1.RadioGroup>):
|
|
40
|
+
}: React.ComponentProps<typeof DropdownMenu$1.RadioGroup>): react_jsx_runtime85.JSX.Element;
|
|
41
41
|
declare function DropdownMenuRadioItem({
|
|
42
42
|
className,
|
|
43
43
|
children,
|
|
44
44
|
...props
|
|
45
|
-
}: React.ComponentProps<typeof DropdownMenu$1.RadioItem>):
|
|
45
|
+
}: React.ComponentProps<typeof DropdownMenu$1.RadioItem>): react_jsx_runtime85.JSX.Element;
|
|
46
46
|
declare function DropdownMenuLabel({
|
|
47
47
|
className,
|
|
48
48
|
inset,
|
|
49
49
|
...props
|
|
50
50
|
}: React.ComponentProps<typeof DropdownMenu$1.Label> & {
|
|
51
51
|
inset?: boolean;
|
|
52
|
-
}):
|
|
52
|
+
}): react_jsx_runtime85.JSX.Element;
|
|
53
53
|
declare function DropdownMenuSeparator({
|
|
54
54
|
className,
|
|
55
55
|
...props
|
|
56
|
-
}: React.ComponentProps<typeof DropdownMenu$1.Separator>):
|
|
56
|
+
}: React.ComponentProps<typeof DropdownMenu$1.Separator>): react_jsx_runtime85.JSX.Element;
|
|
57
57
|
declare function DropdownMenuShortcut({
|
|
58
58
|
className,
|
|
59
59
|
...props
|
|
60
|
-
}: React.ComponentProps<'span'>):
|
|
60
|
+
}: React.ComponentProps<'span'>): react_jsx_runtime85.JSX.Element;
|
|
61
61
|
declare function DropdownMenuSub({
|
|
62
62
|
...props
|
|
63
|
-
}: React.ComponentProps<typeof DropdownMenu$1.Sub>):
|
|
63
|
+
}: React.ComponentProps<typeof DropdownMenu$1.Sub>): react_jsx_runtime85.JSX.Element;
|
|
64
64
|
declare function DropdownMenuSubTrigger({
|
|
65
65
|
className,
|
|
66
66
|
inset,
|
|
@@ -68,11 +68,11 @@ declare function DropdownMenuSubTrigger({
|
|
|
68
68
|
...props
|
|
69
69
|
}: React.ComponentProps<typeof DropdownMenu$1.SubTrigger> & {
|
|
70
70
|
inset?: boolean;
|
|
71
|
-
}):
|
|
71
|
+
}): react_jsx_runtime85.JSX.Element;
|
|
72
72
|
declare function DropdownMenuSubContent({
|
|
73
73
|
className,
|
|
74
74
|
...props
|
|
75
|
-
}: React.ComponentProps<typeof DropdownMenu$1.SubContent>):
|
|
75
|
+
}: React.ComponentProps<typeof DropdownMenu$1.SubContent>): react_jsx_runtime85.JSX.Element;
|
|
76
76
|
//#endregion
|
|
77
77
|
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
|
|
78
78
|
//# sourceMappingURL=dropdown-menu.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use client";const e=require(`../chunk-CUT6urMc.cjs`),t=require(`../button-ChpGfVjG.cjs`),n=require(`../progress-
|
|
2
|
-
files (up to ${(0,
|
|
1
|
+
"use client";const e=require(`../chunk-CUT6urMc.cjs`),t=require(`../button-ChpGfVjG.cjs`),n=require(`../progress-IkXemE6u.cjs`),r=e.__toESM(require(`@customafk/react-toolkit/utils`)),i=e.__toESM(require(`react/jsx-runtime`)),a=e.__toESM(require(`react`)),o=e.__toESM(require(`lucide-react`)),s=e.__toESM(require(`react-dropzone`)),c=e.__toESM(require(`@customafk/react-toolkit/hooks/useControllableState`)),l=e.__toESM(require(`sonner`));function u(e){let{value:t,onValueChange:n,onUpload:u,progresses:p,accept:m={"image/*":[]},maxSize:h=1024*1024*2,maxFileCount:g=1,multiple:_=!1,disabled:v=!1,showText:y=!0,iconSize:b,className:x,...S}=e,[C,w]=(0,c.useControllableState)({prop:t,onChange:n}),T=a.default.useCallback((e,t)=>{if(!_&&g===1&&e.length>1){l.toast.error(`Cannot upload more than 1 file at a time`);return}if((C?.length??0)+e.length>g){l.toast.error(`Cannot upload more than ${g} files`);return}let n=e.map(e=>Object.assign(e,{preview:URL.createObjectURL(e)})),r=C?[...C,...n]:n;if(w(r),t.length>0&&t.forEach(({file:e})=>{l.toast.error(`File ${e.name} was rejected`)}),u&&r.length>0&&r.length<=g){let e=r.length>0?`${r.length} files`:`file`;u(r).then(()=>{w([]),(0,l.toast)(`${e} uploaded`)})}},[C,g,_,u,w]);function E(e){if(!C)return;f(C[e])&&URL.revokeObjectURL(C[e].preview);let t=C.filter((t,n)=>n!==e);w(t),n?.(t)}a.default.useEffect(()=>()=>{C&&C.forEach(e=>{f(e)&&URL.revokeObjectURL(e.preview)})},[]);let D=v||(C?.length??0)>=g;return(0,i.jsxs)(`div`,{className:`relative flex w-full flex-col gap-6`,children:[(0,i.jsx)(s.default,{onDrop:T,accept:m,maxSize:h,maxFiles:g,multiple:g>1||_,disabled:D,children:({getRootProps:e,getInputProps:t,isDragActive:n})=>(0,i.jsxs)(`div`,{...e(),className:(0,r.cn)(`group`,`border-border-weak`,`hover:bg-border-weak/20`,`relative grid h-52 w-full cursor-pointer place-items-center rounded-lg border-2 border-dashed px-5 py-2.5 text-center transition`,`ring-offset-background`,`focus-visible:ring-primary-weak`,`focus-visible:ring-2`,`focus-visible:ring-offset-2`,`focus-visible:outline-hidden`,n&&`border-border-primary-strong bg-border-weak/40`,D&&`pointer-events-none opacity-60`,x),...S,children:[(0,i.jsx)(`input`,{...t()}),n?(0,i.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-4 sm:px-5`,children:[(0,i.jsx)(`div`,{className:`rounded-full border border-dashed p-3`,children:(0,i.jsx)(o.Upload,{className:`text-text-positive-muted size-7`,"aria-hidden":`true`})}),(0,i.jsx)(`p`,{className:`text-text-positive-muted font-medium`,children:`Drop the files here`})]}):(0,i.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-4 sm:px-5`,children:[(0,i.jsx)(`div`,{className:`rounded-full border border-dashed p-3`,children:(0,i.jsx)(o.Upload,{size:b||24,className:`text-muted-foreground`,"aria-hidden":`true`})}),y&&(0,i.jsxs)(`div`,{className:`flex flex-col gap-px`,children:[(0,i.jsxs)(`p`,{className:`text-text-positive-weak text-xs font-medium`,children:[`Drag `,`'n'`,` drop files here, or click to select files`]}),(0,i.jsxs)(`p`,{className:`text-text-positive-muted text-xs`,children:[`You can upload`,g>1?` ${g===1/0?`multiple`:g}
|
|
2
|
+
files (up to ${(0,r.formatBytes)(h)} each)`:` a file with ${(0,r.formatBytes)(h)}`]})]})]})]})}),C?.length?(0,i.jsxs)(`div`,{className:`h-fit w-full overflow-y-auto`,children:[(0,i.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2.5`,children:[(0,i.jsxs)(`div`,{className:`text-text-positive-weak flex items-center gap-1`,children:[(0,i.jsx)(o.Image,{size:16,"aria-hidden":`true`}),(0,i.jsxs)(`p`,{className:`text-sm`,children:[`Ảnh đã tải lên (`,C.length,`)`]})]}),(0,i.jsxs)(`button`,{className:`hover:text-text-positive text-text-positive-muted flex cursor-pointer items-center gap-1 transition-colors duration-200`,onClick:()=>{C&&(C.forEach(e=>{f(e)&&URL.revokeObjectURL(e.preview)}),w([]),n?.([]))},children:[(0,i.jsx)(o.Trash2,{size:16,"aria-hidden":`true`}),(0,i.jsx)(`p`,{className:`text-sm`,children:`Xóa tất cả`})]})]}),(0,i.jsx)(`div`,{className:`flex flex-col gap-2.5`,children:C?.map((e,t)=>(0,i.jsx)(d,{file:e,onRemove:()=>E(t),progress:p?.[e.name]},t))})]}):null]})}function d({file:e,progress:a,onRemove:s}){return(0,i.jsxs)(`div`,{className:`border-border-weak hover:border-border relative flex items-center gap-4 rounded-md border py-2 pr-3 pl-2 shadow-xs transition-colors`,children:[(0,i.jsxs)(`div`,{className:`flex flex-1 gap-2.5`,children:[f(e)?(0,i.jsx)(p,{file:e}):null,(0,i.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,children:[(0,i.jsxs)(`div`,{className:`flex flex-col gap-y-0.5`,children:[(0,i.jsx)(`p`,{className:`text-text-positive line-clamp-1 text-sm`,children:e.name}),(0,i.jsx)(`p`,{className:`text-text-positive-muted text-xs`,children:(0,r.formatBytes)(e.size)})]}),a?(0,i.jsx)(n.Progress,{value:a}):null]})]}),(0,i.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,i.jsxs)(t.Button,{type:`button`,variant:`ghost`,color:`secondary`,size:`icon`,className:`size-7`,onClick:s,children:[(0,i.jsx)(o.Trash2,{size:16,className:`text-text-positive-muted`,"aria-hidden":`true`}),(0,i.jsx)(`span`,{className:`sr-only`,children:`Remove file`})]})})]})}function f(e){return`preview`in e&&typeof e.preview==`string`}function p({file:e}){return e.type.startsWith(`image/`)?(0,i.jsx)(`img`,{src:e.preview,className:`border-border aspect-square size-10 shrink-0 rounded border object-cover object-top shadow-sm`}):(0,i.jsx)(o.FileText,{className:`text-text-positive-muted size-10 border`,"aria-hidden":`true`})}exports.FileUploader=u;
|
|
3
3
|
//# sourceMappingURL=file-uploader.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-uploader.cjs","names":["React","Dropzone","Upload","Image","Trash2","Progress","Button","FileText"],"sources":["../../packages/components/ui/file-uploader.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\nimport { FileText, Image, Trash2, Upload } from 'lucide-react'\nimport Dropzone, { type DropzoneProps, type FileRejection } from 'react-dropzone'\nimport { toast } from 'sonner'\n\nimport { Button } from '@/components/ui/button'\nimport { Progress } from '@/components/ui/progress'\nimport { useControllableState } from '@customafk/react-toolkit/hooks/useControllableState'\nimport { cn, formatBytes } from '@customafk/react-toolkit/utils'\n\ninterface FileUploaderProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Value of the uploader.\n * @type File[]\n * @default undefined\n * @example value={files}\n */\n value?: File[]\n\n /**\n * Function to be called when the value changes.\n * @type (files: File[]) => void\n * @default undefined\n * @example onValueChange={(files) => setFiles(files)}\n */\n onValueChange?: (files: File[]) => void\n\n /**\n * Function to be called when files are uploaded.\n * @type (files: File[]) => Promise<void>\n * @default undefined\n * @example onUpload={(files) => uploadFiles(files)}\n */\n onUpload?: (files: File[]) => Promise<void>\n\n /**\n * Progress of the uploaded files.\n * @type Record<string, number> | undefined\n * @default undefined\n * @example progresses={{ \"file1.png\": 50 }}\n */\n progresses?: Record<string, number>\n\n /**\n * Accepted file types for the uploader.\n * @type { [key: string]: string[]}\n * @default\n * ```ts\n * { \"image/*\": [] }\n * ```\n * @example accept={[\"image/png\", \"image/jpeg\"]}\n */\n accept?: DropzoneProps['accept']\n\n /**\n * Maximum file size for the uploader.\n * @type number | undefined\n * @default 1024 * 1024 * 2 // 2MB\n * @example maxSize={1024 * 1024 * 2} // 2MB\n */\n maxSize?: DropzoneProps['maxSize']\n\n /**\n * Maximum number of files for the uploader.\n * @type number | undefined\n * @default 1\n * @example maxFileCount={4}\n */\n maxFileCount?: DropzoneProps['maxFiles']\n\n /**\n * Whether the uploader should accept multiple files.\n * @type boolean\n * @default false\n * @example multiple\n */\n multiple?: boolean\n\n /**\n * Whether the uploader is disabled.\n * @type boolean\n * @default false\n * @example disabled\n */\n disabled?: boolean\n\n showText?: boolean\n iconSize?: number\n}\n\nexport function FileUploader(props: FileUploaderProps) {\n const {\n value: valueProp,\n onValueChange,\n onUpload,\n progresses,\n accept = {\n 'image/*': [],\n },\n maxSize = 1024 * 1024 * 2,\n maxFileCount = 1,\n multiple = false,\n disabled = false,\n showText = true,\n iconSize,\n className,\n ...dropzoneProps\n } = props\n\n const [files, setFiles] = useControllableState({\n prop: valueProp,\n onChange: onValueChange,\n })\n\n const onDrop = React.useCallback(\n (acceptedFiles: File[], rejectedFiles: FileRejection[]) => {\n if (!multiple && maxFileCount === 1 && acceptedFiles.length > 1) {\n toast.error('Cannot upload more than 1 file at a time')\n\n return\n }\n\n if ((files?.length ?? 0) + acceptedFiles.length > maxFileCount) {\n toast.error(`Cannot upload more than ${maxFileCount} files`)\n return\n }\n\n const newFiles = acceptedFiles.map((file) =>\n Object.assign(file, {\n preview: URL.createObjectURL(file),\n }),\n )\n\n const updatedFiles = files ? [...files, ...newFiles] : newFiles\n\n setFiles(updatedFiles)\n\n if (rejectedFiles.length > 0) {\n rejectedFiles.forEach(({ file }) => {\n toast.error(`File ${file.name} was rejected`)\n })\n }\n\n if (onUpload && updatedFiles.length > 0 && updatedFiles.length <= maxFileCount) {\n const target = updatedFiles.length > 0 ? `${updatedFiles.length} files` : `file`\n\n onUpload(updatedFiles).then(() => {\n setFiles([])\n toast(`${target} uploaded`)\n })\n }\n },\n\n [files, maxFileCount, multiple, onUpload, setFiles],\n )\n\n function onRemove(index: number) {\n if (!files) return\n\n if (isFileWithPreview(files[index])) {\n URL.revokeObjectURL(files[index].preview)\n }\n\n const newFiles = files.filter((_, i) => i !== index)\n setFiles(newFiles)\n onValueChange?.(newFiles)\n }\n\n // Revoke preview url when component unmounts\n React.useEffect(() => {\n return () => {\n if (!files) return\n files.forEach((file) => {\n if (isFileWithPreview(file)) {\n URL.revokeObjectURL(file.preview)\n }\n })\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n const isDisabled = disabled || (files?.length ?? 0) >= maxFileCount\n\n return (\n <div className=\"relative flex w-full flex-col gap-6\">\n <Dropzone onDrop={onDrop} accept={accept} maxSize={maxSize} maxFiles={maxFileCount} multiple={maxFileCount > 1 || multiple} disabled={isDisabled}>\n {({ getRootProps, getInputProps, isDragActive }) => (\n <div\n {...getRootProps()}\n className={cn(\n 'group',\n 'border-border-weak',\n 'hover:bg-border-weak/20',\n 'relative grid h-52 w-full cursor-pointer place-items-center rounded-lg border-2 border-dashed px-5 py-2.5 text-center transition',\n 'ring-offset-background',\n 'focus-visible:ring-primary-weak',\n 'focus-visible:ring-2',\n 'focus-visible:ring-offset-2',\n 'focus-visible:outline-hidden',\n isDragActive && 'border-border-primary-strong bg-border-weak/40',\n isDisabled && 'pointer-events-none opacity-60',\n className,\n )}\n {...dropzoneProps}\n >\n <input {...getInputProps()} />\n {isDragActive ? (\n <div className=\"flex flex-col items-center justify-center gap-4 sm:px-5\">\n <div className=\"rounded-full border border-dashed p-3\">\n <Upload className=\"text-text-positive-muted size-7\" aria-hidden=\"true\" />\n </div>\n <p className=\"text-text-positive-muted font-medium\">Drop the files here</p>\n </div>\n ) : (\n <div className=\"flex flex-col items-center justify-center gap-4 sm:px-5\">\n <div className=\"rounded-full border border-dashed p-3\">\n <Upload size={iconSize || 24} className=\"text-muted-foreground\" aria-hidden=\"true\" />\n </div>\n {showText && (\n <div className=\"flex flex-col gap-px\">\n <p className=\"text-text-positive-weak text-xs font-medium\">Drag {`'n'`} drop files here, or click to select files</p>\n <p className=\"text-text-positive-muted text-xs\">\n You can upload\n {maxFileCount > 1\n ? ` ${maxFileCount === Infinity ? 'multiple' : maxFileCount}\n files (up to ${formatBytes(maxSize)} each)`\n : ` a file with ${formatBytes(maxSize)}`}\n </p>\n </div>\n )}\n </div>\n )}\n </div>\n )}\n </Dropzone>\n {files?.length ? (\n <div className=\"h-fit w-full overflow-y-auto\">\n <div className=\"flex items-center justify-between px-3 py-2.5\">\n <div className=\"text-text-positive-weak flex items-center gap-1\">\n <Image size={16} aria-hidden=\"true\" />\n <p className=\"text-sm\">Ảnh đã tải lên ({files.length})</p>\n </div>\n <button\n className=\"hover:text-text-positive text-text-positive-muted flex cursor-pointer items-center gap-1 transition-colors duration-200\"\n onClick={() => {\n if (!files) return\n files.forEach((file) => {\n if (!isFileWithPreview(file)) return\n URL.revokeObjectURL(file.preview)\n })\n setFiles([])\n onValueChange?.([])\n }}\n >\n <Trash2 size={16} aria-hidden=\"true\" />\n <p className=\"text-sm\">Xóa tất cả</p>\n </button>\n </div>\n <div className=\"flex flex-col gap-2.5\">\n {files?.map((file, index) => (\n <FileCard key={index} file={file} onRemove={() => onRemove(index)} progress={progresses?.[file.name]} />\n ))}\n </div>\n </div>\n ) : null}\n </div>\n )\n}\n\ninterface FileCardProps {\n file: File\n onRemove: () => void\n progress?: number\n}\n\nfunction FileCard({ file, progress, onRemove }: FileCardProps) {\n return (\n <div className=\"border-border-weak hover:border-border relative flex items-center gap-4 rounded-md border py-2 pr-3 pl-2 shadow-xs transition-colors\">\n <div className=\"flex flex-1 gap-2.5\">\n {isFileWithPreview(file) ? <FilePreview file={file} /> : null}\n <div className=\"flex w-full flex-col gap-2\">\n <div className=\"flex flex-col gap-y-0.5\">\n <p className=\"text-text-positive line-clamp-1 text-sm\">{file.name}</p>\n <p className=\"text-text-positive-muted text-xs\">{formatBytes(file.size)}</p>\n </div>\n {progress ? <Progress value={progress} /> : null}\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n <Button type=\"button\" variant=\"ghost\" color=\"secondary\" size=\"icon\" className=\"size-7\" onClick={onRemove}>\n <Trash2 size={16} className=\"text-text-positive-muted\" aria-hidden=\"true\" />\n <span className=\"sr-only\">Remove file</span>\n </Button>\n </div>\n </div>\n )\n}\n\nfunction isFileWithPreview(file: File): file is File & { preview: string } {\n return 'preview' in file && typeof file.preview === 'string'\n}\n\ninterface FilePreviewProps {\n file: File & { preview: string }\n}\n\nfunction FilePreview({ file }: FilePreviewProps) {\n if (file.type.startsWith('image/')) {\n return <img src={file.preview} className=\"border-border aspect-square size-10 shrink-0 rounded border object-cover object-top shadow-sm\" />\n }\n\n return <FileText className=\"text-text-positive-muted size-10 border\" aria-hidden=\"true\" />\n}\n"],"mappings":"sbA2FA,SAAgB,EAAa,EAA0B,CACrD,GAAM,CACJ,MAAO,EACP,gBACA,WACA,aACA,SAAS,CACP,UAAW,IAEb,UAAU,KAAO,KAAO,EACxB,eAAe,EACf,WAAW,GACX,WAAW,GACX,WAAW,GACX,WACA,YACA,GAAG,GACD,EAEE,CAAC,EAAO,IAAA,EAAA,EAAA,sBAAiC,CAC7C,KAAM,EACN,SAAU,IAGN,EAASA,EAAAA,QAAM,aAClB,EAAuB,IAAmC,CACzD,GAAI,CAAC,GAAY,IAAiB,GAAK,EAAc,OAAS,EAAG,CAC/D,EAAA,MAAM,MAAM,4CAEZ,OAG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AAI,UAAU,iCACZ,GAAO,KAAK,EAAM,KACjB,EAAA,EAAA,KAAC,EAAA,CAA2B,OAAM,aAAgB,EAAS,GAAQ,SAAU,IAAa,EAAK,OAAhF,SAInB,QAWV,SAAS,EAAS,CAAE,OAAM,WAAU,YAA2B,CAC7D,OACE,EAAA,EAAA,MAAC,MAAA,CAAI,UAAU,kJACb,EAAA,EAAA,MAAC,MAAA,CAAI,UAAU,gCACZ,EAAkB,IAAQ,EAAA,EAAA,KAAC,EAAA,CAAkB,SAAW,MACzD,EAAA,EAAA,MAAC,MAAA,CAAI,UAAU,wCACb,EAAA,EAAA,MAAC,MAAA,CAAI,UAAU,qCACb,EAAA,EAAA,KAAC,IAAA,CAAE,UAAU,mDAA2C,EAAK,QAC7D,EAAA,EAAA,KAAC,IAAA,CAAE,UAAU,8DAAgD,EAAK,WAEnE,GAAW,EAAA,EAAA,KAACC,EAAAA,SAAAA,CAAS,MAAO,IAAe,YAGhD,EAAA,EAAA,KAAC,MAAA,CAAI,UAAU,oCACb,EAAA,EAAA,MAACC,EAAAA,OAAAA,CAAO,KAAK,SAAS,QAAQ,QAAQ,MAAM,YAAY,KAAK,OAAO,UAAU,SAAS,QAAS,aAC9F,EAAA,EAAA,KAACF,EAAAA,OAAAA,CAAO,KAAM,GAAI,UAAU,2BAA2B,cAAY,UACnE,EAAA,EAAA,KAAC,OAAA,CAAK,UAAU,mBAAU,wBAOpC,SAAS,EAAkB,EAAgD,CACzE,MAAO,YAAa,GAAQ,OAAO,EAAK,SAAY,SAOtD,SAAS,EAAY,CAAE,QAA0B,CAK/C,OAJI,EAAK,KAAK,WAAW,WAChB,EAAA,EAAA,KAAC,MAAA,CAAI,IAAK,EAAK,QAAS,UAAU,mGAGpC,EAAA,EAAA,KAACG,EAAAA,SAAAA,CAAS,UAAU,0CAA0C,cAAY"}
|
|
1
|
+
{"version":3,"file":"file-uploader.cjs","names":["React","Dropzone","Upload","Image","Trash2","Progress","Button","FileText"],"sources":["../../packages/components/ui/file-uploader.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\nimport Dropzone, { type DropzoneProps, type FileRejection } from 'react-dropzone'\nimport { useControllableState } from '@customafk/react-toolkit/hooks/useControllableState'\nimport { cn, formatBytes } from '@customafk/react-toolkit/utils'\n\nimport { FileText, Image, Trash2, Upload } from 'lucide-react'\nimport { toast } from 'sonner'\n\nimport { Button } from '@/components/ui/button'\nimport { Progress } from '@/components/ui/progress'\n\ninterface FileUploaderProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Value of the uploader.\n * @type File[]\n * @default undefined\n * @example value={files}\n */\n value?: File[]\n\n /**\n * Function to be called when the value changes.\n * @type (files: File[]) => void\n * @default undefined\n * @example onValueChange={(files) => setFiles(files)}\n */\n onValueChange?: (files: File[]) => void\n\n /**\n * Function to be called when files are uploaded.\n * @type (files: File[]) => Promise<void>\n * @default undefined\n * @example onUpload={(files) => uploadFiles(files)}\n */\n onUpload?: (files: File[]) => Promise<void>\n\n /**\n * Progress of the uploaded files.\n * @type Record<string, number> | undefined\n * @default undefined\n * @example progresses={{ \"file1.png\": 50 }}\n */\n progresses?: Record<string, number>\n\n /**\n * Accepted file types for the uploader.\n * @type { [key: string]: string[]}\n * @default\n * ```ts\n * { \"image/*\": [] }\n * ```\n * @example accept={[\"image/png\", \"image/jpeg\"]}\n */\n accept?: DropzoneProps['accept']\n\n /**\n * Maximum file size for the uploader.\n * @type number | undefined\n * @default 1024 * 1024 * 2 // 2MB\n * @example maxSize={1024 * 1024 * 2} // 2MB\n */\n maxSize?: DropzoneProps['maxSize']\n\n /**\n * Maximum number of files for the uploader.\n * @type number | undefined\n * @default 1\n * @example maxFileCount={4}\n */\n maxFileCount?: DropzoneProps['maxFiles']\n\n /**\n * Whether the uploader should accept multiple files.\n * @type boolean\n * @default false\n * @example multiple\n */\n multiple?: boolean\n\n /**\n * Whether the uploader is disabled.\n * @type boolean\n * @default false\n * @example disabled\n */\n disabled?: boolean\n\n showText?: boolean\n iconSize?: number\n}\n\nexport function FileUploader(props: FileUploaderProps) {\n const {\n value: valueProp,\n onValueChange,\n onUpload,\n progresses,\n accept = {\n 'image/*': [],\n },\n maxSize = 1024 * 1024 * 2,\n maxFileCount = 1,\n multiple = false,\n disabled = false,\n showText = true,\n iconSize,\n className,\n ...dropzoneProps\n } = props\n\n const [files, setFiles] = useControllableState({\n prop: valueProp,\n onChange: onValueChange,\n })\n\n const onDrop = React.useCallback(\n (acceptedFiles: File[], rejectedFiles: FileRejection[]) => {\n if (!multiple && maxFileCount === 1 && acceptedFiles.length > 1) {\n toast.error('Cannot upload more than 1 file at a time')\n\n return\n }\n\n if ((files?.length ?? 0) + acceptedFiles.length > maxFileCount) {\n toast.error(`Cannot upload more than ${maxFileCount} files`)\n return\n }\n\n const newFiles = acceptedFiles.map((file) =>\n Object.assign(file, {\n preview: URL.createObjectURL(file),\n }),\n )\n\n const updatedFiles = files ? [...files, ...newFiles] : newFiles\n\n setFiles(updatedFiles)\n\n if (rejectedFiles.length > 0) {\n rejectedFiles.forEach(({ file }) => {\n toast.error(`File ${file.name} was rejected`)\n })\n }\n\n if (onUpload && updatedFiles.length > 0 && updatedFiles.length <= maxFileCount) {\n const target = updatedFiles.length > 0 ? `${updatedFiles.length} files` : `file`\n\n onUpload(updatedFiles).then(() => {\n setFiles([])\n toast(`${target} uploaded`)\n })\n }\n },\n\n [files, maxFileCount, multiple, onUpload, setFiles],\n )\n\n function onRemove(index: number) {\n if (!files) return\n\n if (isFileWithPreview(files[index])) {\n URL.revokeObjectURL(files[index].preview)\n }\n\n const newFiles = files.filter((_, i) => i !== index)\n setFiles(newFiles)\n onValueChange?.(newFiles)\n }\n\n // Revoke preview url when component unmounts\n React.useEffect(() => {\n return () => {\n if (!files) return\n files.forEach((file) => {\n if (isFileWithPreview(file)) {\n URL.revokeObjectURL(file.preview)\n }\n })\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n const isDisabled = disabled || (files?.length ?? 0) >= maxFileCount\n\n return (\n <div className=\"relative flex w-full flex-col gap-6\">\n <Dropzone onDrop={onDrop} accept={accept} maxSize={maxSize} maxFiles={maxFileCount} multiple={maxFileCount > 1 || multiple} disabled={isDisabled}>\n {({ getRootProps, getInputProps, isDragActive }) => (\n <div\n {...getRootProps()}\n className={cn(\n 'group',\n 'border-border-weak',\n 'hover:bg-border-weak/20',\n 'relative grid h-52 w-full cursor-pointer place-items-center rounded-lg border-2 border-dashed px-5 py-2.5 text-center transition',\n 'ring-offset-background',\n 'focus-visible:ring-primary-weak',\n 'focus-visible:ring-2',\n 'focus-visible:ring-offset-2',\n 'focus-visible:outline-hidden',\n isDragActive && 'border-border-primary-strong bg-border-weak/40',\n isDisabled && 'pointer-events-none opacity-60',\n className,\n )}\n {...dropzoneProps}\n >\n <input {...getInputProps()} />\n {isDragActive ? (\n <div className=\"flex flex-col items-center justify-center gap-4 sm:px-5\">\n <div className=\"rounded-full border border-dashed p-3\">\n <Upload className=\"text-text-positive-muted size-7\" aria-hidden=\"true\" />\n </div>\n <p className=\"text-text-positive-muted font-medium\">Drop the files here</p>\n </div>\n ) : (\n <div className=\"flex flex-col items-center justify-center gap-4 sm:px-5\">\n <div className=\"rounded-full border border-dashed p-3\">\n <Upload size={iconSize || 24} className=\"text-muted-foreground\" aria-hidden=\"true\" />\n </div>\n {showText && (\n <div className=\"flex flex-col gap-px\">\n <p className=\"text-text-positive-weak text-xs font-medium\">Drag {`'n'`} drop files here, or click to select files</p>\n <p className=\"text-text-positive-muted text-xs\">\n You can upload\n {maxFileCount > 1\n ? ` ${maxFileCount === Infinity ? 'multiple' : maxFileCount}\n files (up to ${formatBytes(maxSize)} each)`\n : ` a file with ${formatBytes(maxSize)}`}\n </p>\n </div>\n )}\n </div>\n )}\n </div>\n )}\n </Dropzone>\n {files?.length ? (\n <div className=\"h-fit w-full overflow-y-auto\">\n <div className=\"flex items-center justify-between px-3 py-2.5\">\n <div className=\"text-text-positive-weak flex items-center gap-1\">\n <Image size={16} aria-hidden=\"true\" />\n <p className=\"text-sm\">Ảnh đã tải lên ({files.length})</p>\n </div>\n <button\n className=\"hover:text-text-positive text-text-positive-muted flex cursor-pointer items-center gap-1 transition-colors duration-200\"\n onClick={() => {\n if (!files) return\n files.forEach((file) => {\n if (!isFileWithPreview(file)) return\n URL.revokeObjectURL(file.preview)\n })\n setFiles([])\n onValueChange?.([])\n }}\n >\n <Trash2 size={16} aria-hidden=\"true\" />\n <p className=\"text-sm\">Xóa tất cả</p>\n </button>\n </div>\n <div className=\"flex flex-col gap-2.5\">\n {files?.map((file, index) => (\n <FileCard key={index} file={file} onRemove={() => onRemove(index)} progress={progresses?.[file.name]} />\n ))}\n </div>\n </div>\n ) : null}\n </div>\n )\n}\n\ninterface FileCardProps {\n file: File\n onRemove: () => void\n progress?: number\n}\n\nfunction FileCard({ file, progress, onRemove }: FileCardProps) {\n return (\n <div className=\"border-border-weak hover:border-border relative flex items-center gap-4 rounded-md border py-2 pr-3 pl-2 shadow-xs transition-colors\">\n <div className=\"flex flex-1 gap-2.5\">\n {isFileWithPreview(file) ? <FilePreview file={file} /> : null}\n <div className=\"flex w-full flex-col gap-2\">\n <div className=\"flex flex-col gap-y-0.5\">\n <p className=\"text-text-positive line-clamp-1 text-sm\">{file.name}</p>\n <p className=\"text-text-positive-muted text-xs\">{formatBytes(file.size)}</p>\n </div>\n {progress ? <Progress value={progress} /> : null}\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n <Button type=\"button\" variant=\"ghost\" color=\"secondary\" size=\"icon\" className=\"size-7\" onClick={onRemove}>\n <Trash2 size={16} className=\"text-text-positive-muted\" aria-hidden=\"true\" />\n <span className=\"sr-only\">Remove file</span>\n </Button>\n </div>\n </div>\n )\n}\n\nfunction isFileWithPreview(file: File): file is File & { preview: string } {\n return 'preview' in file && typeof file.preview === 'string'\n}\n\ninterface FilePreviewProps {\n file: File & { preview: string }\n}\n\nfunction FilePreview({ file }: FilePreviewProps) {\n if (file.type.startsWith('image/')) {\n return <img src={file.preview} className=\"border-border aspect-square size-10 shrink-0 rounded border object-cover object-top shadow-sm\" />\n }\n\n return <FileText className=\"text-text-positive-muted size-10 border\" aria-hidden=\"true\" />\n}\n"],"mappings":"sbA4FA,SAAgB,EAAa,EAA0B,CACrD,GAAM,CACJ,MAAO,EACP,gBACA,WACA,aACA,SAAS,CACP,UAAW,IAEb,UAAU,KAAO,KAAO,EACxB,eAAe,EACf,WAAW,GACX,WAAW,GACX,WAAW,GACX,WACA,YACA,GAAG,GACD,EAEE,CAAC,EAAO,IAAA,EAAA,EAAA,sBAAiC,CAC7C,KAAM,EACN,SAAU,IAGN,EAASA,EAAAA,QAAM,aAClB,EAAuB,IAAmC,CACzD,GAAI,CAAC,GAAY,IAAiB,GAAK,EAAc,OAAS,EAAG,CAC/D,EAAA,MAAM,MAAM,4CAEZ,OAGF,IAAK,GAAO,QAAU,GAAK,EAAc,OAAS,EAAc,CAC9D,EAAA,MAAM,MAAM,2BAA2B,EAAa,SACpD,OAGF,IAAM,EAAW,EAAc,IAAK,GAClC,OAAO,OAAO,EAAM,CAClB,QAAS,IAAI,gBAAgB,MAI3B,EAAe,EAAQ,CAAC,GAAG,EAAO,GAAG,GAAY,EAUvD,GARA,EAAS,GAEL,EAAc,OAAS,GACzB,EAAc,SAAS,CAAE,UAAW,CAClC,EAAA,MAAM,MAAM,QAAQ,EAAK,KAAK,kBAI9B,GAAY,EAAa,OAAS,GAAK,EAAa,QAAU,EAAc,CAC9E,IAAM,EAAS,EAAa,OAAS,EAAI,GAAG,EAAa,OAAO,QAAU,OAE1E,EAAS,GAAc,SAAW,CAChC,EAAS,KACT,EAAA,EAAA,OAAM,GAAG,EAAO,gBAKtB,CAAC,EAAO,EAAc,EAAU,EAAU,IAG5C,SAAS,EAAS,EAAe,CAC/B,GAAI,CAAC,EAAO,OAER,EAAkB,EAAM,KAC1B,IAAI,gBAAgB,EAAM,GAAO,SAGnC,IAAM,EAAW,EAAM,QAAQ,EAAG,IAAM,IAAM,GAC9C,EAAS,GACT,IA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AU,SAAS,QAAS,aAC9F,EAAA,EAAA,KAACF,EAAAA,OAAAA,CAAO,KAAM,GAAI,UAAU,2BAA2B,cAAY,UACnE,EAAA,EAAA,KAAC,OAAA,CAAK,UAAU,mBAAU,wBAOpC,SAAS,EAAkB,EAAgD,CACzE,MAAO,YAAa,GAAQ,OAAO,EAAK,SAAY,SAOtD,SAAS,EAAY,CAAE,QAA0B,CAK/C,OAJI,EAAK,KAAK,WAAW,WAChB,EAAA,EAAA,KAAC,MAAA,CAAI,IAAK,EAAK,QAAS,UAAU,mGAGpC,EAAA,EAAA,KAACG,EAAAA,SAAAA,CAAS,UAAU,0CAA0C,cAAY"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime159 from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { DropzoneProps } from "react-dropzone";
|
|
4
4
|
|
|
@@ -73,7 +73,7 @@ interface FileUploaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
73
73
|
showText?: boolean;
|
|
74
74
|
iconSize?: number;
|
|
75
75
|
}
|
|
76
|
-
declare function FileUploader(props: FileUploaderProps):
|
|
76
|
+
declare function FileUploader(props: FileUploaderProps): react_jsx_runtime159.JSX.Element;
|
|
77
77
|
//#endregion
|
|
78
78
|
export { FileUploader };
|
|
79
79
|
//# sourceMappingURL=file-uploader.d.cts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import * as react_jsx_runtime123 from "react/jsx-runtime";
|
|
1
2
|
import React from "react";
|
|
2
|
-
import * as react_jsx_runtime165 from "react/jsx-runtime";
|
|
3
3
|
import { DropzoneProps } from "react-dropzone";
|
|
4
4
|
|
|
5
5
|
//#region packages/components/ui/file-uploader.d.ts
|
|
@@ -73,7 +73,7 @@ interface FileUploaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
73
73
|
showText?: boolean;
|
|
74
74
|
iconSize?: number;
|
|
75
75
|
}
|
|
76
|
-
declare function FileUploader(props: FileUploaderProps):
|
|
76
|
+
declare function FileUploader(props: FileUploaderProps): react_jsx_runtime123.JSX.Element;
|
|
77
77
|
//#endregion
|
|
78
78
|
export { FileUploader };
|
|
79
79
|
//# sourceMappingURL=file-uploader.d.ts.map
|
package/dist/ui/file-uploader.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use client";import{Button as e}from"../button-DL_i4AVi.js";import{Progress as t}from"../progress-
|
|
2
|
-
files (up to ${
|
|
1
|
+
"use client";import{Button as e}from"../button-DL_i4AVi.js";import{Progress as t}from"../progress-CMMXIQct.js";import{cn as n,formatBytes as r}from"@customafk/react-toolkit/utils";import{jsx as i,jsxs as a}from"react/jsx-runtime";import o from"react";import{FileText as s,Image as c,Trash2 as l,Upload as u}from"lucide-react";import d from"react-dropzone";import{useControllableState as f}from"@customafk/react-toolkit/hooks/useControllableState";import{toast as p}from"sonner";function m(e){let{value:t,onValueChange:s,onUpload:m,progresses:_,accept:v={"image/*":[]},maxSize:y=1024*1024*2,maxFileCount:b=1,multiple:x=!1,disabled:S=!1,showText:C=!0,iconSize:w,className:T,...E}=e,[D,O]=f({prop:t,onChange:s}),k=o.useCallback((e,t)=>{if(!x&&b===1&&e.length>1){p.error(`Cannot upload more than 1 file at a time`);return}if((D?.length??0)+e.length>b){p.error(`Cannot upload more than ${b} files`);return}let n=e.map(e=>Object.assign(e,{preview:URL.createObjectURL(e)})),r=D?[...D,...n]:n;if(O(r),t.length>0&&t.forEach(({file:e})=>{p.error(`File ${e.name} was rejected`)}),m&&r.length>0&&r.length<=b){let e=r.length>0?`${r.length} files`:`file`;m(r).then(()=>{O([]),p(`${e} uploaded`)})}},[D,b,x,m,O]);function A(e){if(!D)return;g(D[e])&&URL.revokeObjectURL(D[e].preview);let t=D.filter((t,n)=>n!==e);O(t),s?.(t)}o.useEffect(()=>()=>{D&&D.forEach(e=>{g(e)&&URL.revokeObjectURL(e.preview)})},[]);let j=S||(D?.length??0)>=b;return a(`div`,{className:`relative flex w-full flex-col gap-6`,children:[i(d,{onDrop:k,accept:v,maxSize:y,maxFiles:b,multiple:b>1||x,disabled:j,children:({getRootProps:e,getInputProps:t,isDragActive:o})=>a(`div`,{...e(),className:n(`group`,`border-border-weak`,`hover:bg-border-weak/20`,`relative grid h-52 w-full cursor-pointer place-items-center rounded-lg border-2 border-dashed px-5 py-2.5 text-center transition`,`ring-offset-background`,`focus-visible:ring-primary-weak`,`focus-visible:ring-2`,`focus-visible:ring-offset-2`,`focus-visible:outline-hidden`,o&&`border-border-primary-strong bg-border-weak/40`,j&&`pointer-events-none opacity-60`,T),...E,children:[i(`input`,{...t()}),o?a(`div`,{className:`flex flex-col items-center justify-center gap-4 sm:px-5`,children:[i(`div`,{className:`rounded-full border border-dashed p-3`,children:i(u,{className:`text-text-positive-muted size-7`,"aria-hidden":`true`})}),i(`p`,{className:`text-text-positive-muted font-medium`,children:`Drop the files here`})]}):a(`div`,{className:`flex flex-col items-center justify-center gap-4 sm:px-5`,children:[i(`div`,{className:`rounded-full border border-dashed p-3`,children:i(u,{size:w||24,className:`text-muted-foreground`,"aria-hidden":`true`})}),C&&a(`div`,{className:`flex flex-col gap-px`,children:[a(`p`,{className:`text-text-positive-weak text-xs font-medium`,children:[`Drag `,`'n'`,` drop files here, or click to select files`]}),a(`p`,{className:`text-text-positive-muted text-xs`,children:[`You can upload`,b>1?` ${b===1/0?`multiple`:b}
|
|
2
|
+
files (up to ${r(y)} each)`:` a file with ${r(y)}`]})]})]})]})}),D?.length?a(`div`,{className:`h-fit w-full overflow-y-auto`,children:[a(`div`,{className:`flex items-center justify-between px-3 py-2.5`,children:[a(`div`,{className:`text-text-positive-weak flex items-center gap-1`,children:[i(c,{size:16,"aria-hidden":`true`}),a(`p`,{className:`text-sm`,children:[`Ảnh đã tải lên (`,D.length,`)`]})]}),a(`button`,{className:`hover:text-text-positive text-text-positive-muted flex cursor-pointer items-center gap-1 transition-colors duration-200`,onClick:()=>{D&&(D.forEach(e=>{g(e)&&URL.revokeObjectURL(e.preview)}),O([]),s?.([]))},children:[i(l,{size:16,"aria-hidden":`true`}),i(`p`,{className:`text-sm`,children:`Xóa tất cả`})]})]}),i(`div`,{className:`flex flex-col gap-2.5`,children:D?.map((e,t)=>i(h,{file:e,onRemove:()=>A(t),progress:_?.[e.name]},t))})]}):null]})}function h({file:n,progress:o,onRemove:s}){return a(`div`,{className:`border-border-weak hover:border-border relative flex items-center gap-4 rounded-md border py-2 pr-3 pl-2 shadow-xs transition-colors`,children:[a(`div`,{className:`flex flex-1 gap-2.5`,children:[g(n)?i(_,{file:n}):null,a(`div`,{className:`flex w-full flex-col gap-2`,children:[a(`div`,{className:`flex flex-col gap-y-0.5`,children:[i(`p`,{className:`text-text-positive line-clamp-1 text-sm`,children:n.name}),i(`p`,{className:`text-text-positive-muted text-xs`,children:r(n.size)})]}),o?i(t,{value:o}):null]})]}),i(`div`,{className:`flex items-center gap-2`,children:a(e,{type:`button`,variant:`ghost`,color:`secondary`,size:`icon`,className:`size-7`,onClick:s,children:[i(l,{size:16,className:`text-text-positive-muted`,"aria-hidden":`true`}),i(`span`,{className:`sr-only`,children:`Remove file`})]})})]})}function g(e){return`preview`in e&&typeof e.preview==`string`}function _({file:e}){return e.type.startsWith(`image/`)?i(`img`,{src:e.preview,className:`border-border aspect-square size-10 shrink-0 rounded border object-cover object-top shadow-sm`}):i(s,{className:`text-text-positive-muted size-10 border`,"aria-hidden":`true`})}export{m as FileUploader};
|
|
3
3
|
//# sourceMappingURL=file-uploader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-uploader.js","names":[],"sources":["../../packages/components/ui/file-uploader.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\nimport { FileText, Image, Trash2, Upload } from 'lucide-react'\nimport Dropzone, { type DropzoneProps, type FileRejection } from 'react-dropzone'\nimport { toast } from 'sonner'\n\nimport { Button } from '@/components/ui/button'\nimport { Progress } from '@/components/ui/progress'\nimport { useControllableState } from '@customafk/react-toolkit/hooks/useControllableState'\nimport { cn, formatBytes } from '@customafk/react-toolkit/utils'\n\ninterface FileUploaderProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Value of the uploader.\n * @type File[]\n * @default undefined\n * @example value={files}\n */\n value?: File[]\n\n /**\n * Function to be called when the value changes.\n * @type (files: File[]) => void\n * @default undefined\n * @example onValueChange={(files) => setFiles(files)}\n */\n onValueChange?: (files: File[]) => void\n\n /**\n * Function to be called when files are uploaded.\n * @type (files: File[]) => Promise<void>\n * @default undefined\n * @example onUpload={(files) => uploadFiles(files)}\n */\n onUpload?: (files: File[]) => Promise<void>\n\n /**\n * Progress of the uploaded files.\n * @type Record<string, number> | undefined\n * @default undefined\n * @example progresses={{ \"file1.png\": 50 }}\n */\n progresses?: Record<string, number>\n\n /**\n * Accepted file types for the uploader.\n * @type { [key: string]: string[]}\n * @default\n * ```ts\n * { \"image/*\": [] }\n * ```\n * @example accept={[\"image/png\", \"image/jpeg\"]}\n */\n accept?: DropzoneProps['accept']\n\n /**\n * Maximum file size for the uploader.\n * @type number | undefined\n * @default 1024 * 1024 * 2 // 2MB\n * @example maxSize={1024 * 1024 * 2} // 2MB\n */\n maxSize?: DropzoneProps['maxSize']\n\n /**\n * Maximum number of files for the uploader.\n * @type number | undefined\n * @default 1\n * @example maxFileCount={4}\n */\n maxFileCount?: DropzoneProps['maxFiles']\n\n /**\n * Whether the uploader should accept multiple files.\n * @type boolean\n * @default false\n * @example multiple\n */\n multiple?: boolean\n\n /**\n * Whether the uploader is disabled.\n * @type boolean\n * @default false\n * @example disabled\n */\n disabled?: boolean\n\n showText?: boolean\n iconSize?: number\n}\n\nexport function FileUploader(props: FileUploaderProps) {\n const {\n value: valueProp,\n onValueChange,\n onUpload,\n progresses,\n accept = {\n 'image/*': [],\n },\n maxSize = 1024 * 1024 * 2,\n maxFileCount = 1,\n multiple = false,\n disabled = false,\n showText = true,\n iconSize,\n className,\n ...dropzoneProps\n } = props\n\n const [files, setFiles] = useControllableState({\n prop: valueProp,\n onChange: onValueChange,\n })\n\n const onDrop = React.useCallback(\n (acceptedFiles: File[], rejectedFiles: FileRejection[]) => {\n if (!multiple && maxFileCount === 1 && acceptedFiles.length > 1) {\n toast.error('Cannot upload more than 1 file at a time')\n\n return\n }\n\n if ((files?.length ?? 0) + acceptedFiles.length > maxFileCount) {\n toast.error(`Cannot upload more than ${maxFileCount} files`)\n return\n }\n\n const newFiles = acceptedFiles.map((file) =>\n Object.assign(file, {\n preview: URL.createObjectURL(file),\n }),\n )\n\n const updatedFiles = files ? [...files, ...newFiles] : newFiles\n\n setFiles(updatedFiles)\n\n if (rejectedFiles.length > 0) {\n rejectedFiles.forEach(({ file }) => {\n toast.error(`File ${file.name} was rejected`)\n })\n }\n\n if (onUpload && updatedFiles.length > 0 && updatedFiles.length <= maxFileCount) {\n const target = updatedFiles.length > 0 ? `${updatedFiles.length} files` : `file`\n\n onUpload(updatedFiles).then(() => {\n setFiles([])\n toast(`${target} uploaded`)\n })\n }\n },\n\n [files, maxFileCount, multiple, onUpload, setFiles],\n )\n\n function onRemove(index: number) {\n if (!files) return\n\n if (isFileWithPreview(files[index])) {\n URL.revokeObjectURL(files[index].preview)\n }\n\n const newFiles = files.filter((_, i) => i !== index)\n setFiles(newFiles)\n onValueChange?.(newFiles)\n }\n\n // Revoke preview url when component unmounts\n React.useEffect(() => {\n return () => {\n if (!files) return\n files.forEach((file) => {\n if (isFileWithPreview(file)) {\n URL.revokeObjectURL(file.preview)\n }\n })\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n const isDisabled = disabled || (files?.length ?? 0) >= maxFileCount\n\n return (\n <div className=\"relative flex w-full flex-col gap-6\">\n <Dropzone onDrop={onDrop} accept={accept} maxSize={maxSize} maxFiles={maxFileCount} multiple={maxFileCount > 1 || multiple} disabled={isDisabled}>\n {({ getRootProps, getInputProps, isDragActive }) => (\n <div\n {...getRootProps()}\n className={cn(\n 'group',\n 'border-border-weak',\n 'hover:bg-border-weak/20',\n 'relative grid h-52 w-full cursor-pointer place-items-center rounded-lg border-2 border-dashed px-5 py-2.5 text-center transition',\n 'ring-offset-background',\n 'focus-visible:ring-primary-weak',\n 'focus-visible:ring-2',\n 'focus-visible:ring-offset-2',\n 'focus-visible:outline-hidden',\n isDragActive && 'border-border-primary-strong bg-border-weak/40',\n isDisabled && 'pointer-events-none opacity-60',\n className,\n )}\n {...dropzoneProps}\n >\n <input {...getInputProps()} />\n {isDragActive ? (\n <div className=\"flex flex-col items-center justify-center gap-4 sm:px-5\">\n <div className=\"rounded-full border border-dashed p-3\">\n <Upload className=\"text-text-positive-muted size-7\" aria-hidden=\"true\" />\n </div>\n <p className=\"text-text-positive-muted font-medium\">Drop the files here</p>\n </div>\n ) : (\n <div className=\"flex flex-col items-center justify-center gap-4 sm:px-5\">\n <div className=\"rounded-full border border-dashed p-3\">\n <Upload size={iconSize || 24} className=\"text-muted-foreground\" aria-hidden=\"true\" />\n </div>\n {showText && (\n <div className=\"flex flex-col gap-px\">\n <p className=\"text-text-positive-weak text-xs font-medium\">Drag {`'n'`} drop files here, or click to select files</p>\n <p className=\"text-text-positive-muted text-xs\">\n You can upload\n {maxFileCount > 1\n ? ` ${maxFileCount === Infinity ? 'multiple' : maxFileCount}\n files (up to ${formatBytes(maxSize)} each)`\n : ` a file with ${formatBytes(maxSize)}`}\n </p>\n </div>\n )}\n </div>\n )}\n </div>\n )}\n </Dropzone>\n {files?.length ? (\n <div className=\"h-fit w-full overflow-y-auto\">\n <div className=\"flex items-center justify-between px-3 py-2.5\">\n <div className=\"text-text-positive-weak flex items-center gap-1\">\n <Image size={16} aria-hidden=\"true\" />\n <p className=\"text-sm\">Ảnh đã tải lên ({files.length})</p>\n </div>\n <button\n className=\"hover:text-text-positive text-text-positive-muted flex cursor-pointer items-center gap-1 transition-colors duration-200\"\n onClick={() => {\n if (!files) return\n files.forEach((file) => {\n if (!isFileWithPreview(file)) return\n URL.revokeObjectURL(file.preview)\n })\n setFiles([])\n onValueChange?.([])\n }}\n >\n <Trash2 size={16} aria-hidden=\"true\" />\n <p className=\"text-sm\">Xóa tất cả</p>\n </button>\n </div>\n <div className=\"flex flex-col gap-2.5\">\n {files?.map((file, index) => (\n <FileCard key={index} file={file} onRemove={() => onRemove(index)} progress={progresses?.[file.name]} />\n ))}\n </div>\n </div>\n ) : null}\n </div>\n )\n}\n\ninterface FileCardProps {\n file: File\n onRemove: () => void\n progress?: number\n}\n\nfunction FileCard({ file, progress, onRemove }: FileCardProps) {\n return (\n <div className=\"border-border-weak hover:border-border relative flex items-center gap-4 rounded-md border py-2 pr-3 pl-2 shadow-xs transition-colors\">\n <div className=\"flex flex-1 gap-2.5\">\n {isFileWithPreview(file) ? <FilePreview file={file} /> : null}\n <div className=\"flex w-full flex-col gap-2\">\n <div className=\"flex flex-col gap-y-0.5\">\n <p className=\"text-text-positive line-clamp-1 text-sm\">{file.name}</p>\n <p className=\"text-text-positive-muted text-xs\">{formatBytes(file.size)}</p>\n </div>\n {progress ? <Progress value={progress} /> : null}\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n <Button type=\"button\" variant=\"ghost\" color=\"secondary\" size=\"icon\" className=\"size-7\" onClick={onRemove}>\n <Trash2 size={16} className=\"text-text-positive-muted\" aria-hidden=\"true\" />\n <span className=\"sr-only\">Remove file</span>\n </Button>\n </div>\n </div>\n )\n}\n\nfunction isFileWithPreview(file: File): file is File & { preview: string } {\n return 'preview' in file && typeof file.preview === 'string'\n}\n\ninterface FilePreviewProps {\n file: File & { preview: string }\n}\n\nfunction FilePreview({ file }: FilePreviewProps) {\n if (file.type.startsWith('image/')) {\n return <img src={file.preview} className=\"border-border aspect-square size-10 shrink-0 rounded border object-cover object-top shadow-sm\" />\n }\n\n return <FileText className=\"text-text-positive-muted size-10 border\" aria-hidden=\"true\" />\n}\n"],"mappings":"8dA2FA,SAAgB,EAAa,EAA0B,CACrD,GAAM,CACJ,MAAO,EACP,gBACA,WACA,aACA,SAAS,CACP,UAAW,IAEb,U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,EAAK,OAAhF,SAInB,QAWV,SAAS,EAAS,CAAE,OAAM,WAAU,YAA2B,CAC7D,OACE,EAAC,MAAA,CAAI,UAAU,iJACb,EAAC,MAAA,CAAI,UAAU,gCACZ,EAAkB,GAAQ,EAAC,EAAA,CAAkB,SAAW,KACzD,EAAC,MAAA,CAAI,UAAU,uCACb,EAAC,MAAA,CAAI,UAAU,oCACb,EAAC,IAAA,CAAE,UAAU,mDAA2C,EAAK,OAC7D,EAAC,IAAA,CAAE,UAAU,4CAAoC,EAAY,EAAK,WAEnE,EAAW,EAAC,EAAA,CAAS,MAAO,IAAe,WAGhD,EAAC,MAAA,CAAI,UAAU,mCACb,EAAC,EAAA,CAAO,KAAK,SAAS,QAAQ,QAAQ,MAAM,YAAY,KAAK,OAAO,UAAU,SAAS,QAAS,YAC9F,EAAC,EAAA,CAAO,KAAM,GAAI,UAAU,2BAA2B,cAAY,SACnE,EAAC,OAAA,CAAK,UAAU,mBAAU,wBAOpC,SAAS,EAAkB,EAAgD,CACzE,MAAO,YAAa,GAAQ,OAAO,EAAK,SAAY,SAOtD,SAAS,EAAY,CAAE,QAA0B,CAK/C,OAJI,EAAK,KAAK,WAAW,UAChB,EAAC,MAAA,CAAI,IAAK,EAAK,QAAS,UAAU,kGAGpC,EAAC,EAAA,CAAS,UAAU,0CAA0C,cAAY"}
|
|
1
|
+
{"version":3,"file":"file-uploader.js","names":[],"sources":["../../packages/components/ui/file-uploader.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\nimport Dropzone, { type DropzoneProps, type FileRejection } from 'react-dropzone'\nimport { useControllableState } from '@customafk/react-toolkit/hooks/useControllableState'\nimport { cn, formatBytes } from '@customafk/react-toolkit/utils'\n\nimport { FileText, Image, Trash2, Upload } from 'lucide-react'\nimport { toast } from 'sonner'\n\nimport { Button } from '@/components/ui/button'\nimport { Progress } from '@/components/ui/progress'\n\ninterface FileUploaderProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Value of the uploader.\n * @type File[]\n * @default undefined\n * @example value={files}\n */\n value?: File[]\n\n /**\n * Function to be called when the value changes.\n * @type (files: File[]) => void\n * @default undefined\n * @example onValueChange={(files) => setFiles(files)}\n */\n onValueChange?: (files: File[]) => void\n\n /**\n * Function to be called when files are uploaded.\n * @type (files: File[]) => Promise<void>\n * @default undefined\n * @example onUpload={(files) => uploadFiles(files)}\n */\n onUpload?: (files: File[]) => Promise<void>\n\n /**\n * Progress of the uploaded files.\n * @type Record<string, number> | undefined\n * @default undefined\n * @example progresses={{ \"file1.png\": 50 }}\n */\n progresses?: Record<string, number>\n\n /**\n * Accepted file types for the uploader.\n * @type { [key: string]: string[]}\n * @default\n * ```ts\n * { \"image/*\": [] }\n * ```\n * @example accept={[\"image/png\", \"image/jpeg\"]}\n */\n accept?: DropzoneProps['accept']\n\n /**\n * Maximum file size for the uploader.\n * @type number | undefined\n * @default 1024 * 1024 * 2 // 2MB\n * @example maxSize={1024 * 1024 * 2} // 2MB\n */\n maxSize?: DropzoneProps['maxSize']\n\n /**\n * Maximum number of files for the uploader.\n * @type number | undefined\n * @default 1\n * @example maxFileCount={4}\n */\n maxFileCount?: DropzoneProps['maxFiles']\n\n /**\n * Whether the uploader should accept multiple files.\n * @type boolean\n * @default false\n * @example multiple\n */\n multiple?: boolean\n\n /**\n * Whether the uploader is disabled.\n * @type boolean\n * @default false\n * @example disabled\n */\n disabled?: boolean\n\n showText?: boolean\n iconSize?: number\n}\n\nexport function FileUploader(props: FileUploaderProps) {\n const {\n value: valueProp,\n onValueChange,\n onUpload,\n progresses,\n accept = {\n 'image/*': [],\n },\n maxSize = 1024 * 1024 * 2,\n maxFileCount = 1,\n multiple = false,\n disabled = false,\n showText = true,\n iconSize,\n className,\n ...dropzoneProps\n } = props\n\n const [files, setFiles] = useControllableState({\n prop: valueProp,\n onChange: onValueChange,\n })\n\n const onDrop = React.useCallback(\n (acceptedFiles: File[], rejectedFiles: FileRejection[]) => {\n if (!multiple && maxFileCount === 1 && acceptedFiles.length > 1) {\n toast.error('Cannot upload more than 1 file at a time')\n\n return\n }\n\n if ((files?.length ?? 0) + acceptedFiles.length > maxFileCount) {\n toast.error(`Cannot upload more than ${maxFileCount} files`)\n return\n }\n\n const newFiles = acceptedFiles.map((file) =>\n Object.assign(file, {\n preview: URL.createObjectURL(file),\n }),\n )\n\n const updatedFiles = files ? [...files, ...newFiles] : newFiles\n\n setFiles(updatedFiles)\n\n if (rejectedFiles.length > 0) {\n rejectedFiles.forEach(({ file }) => {\n toast.error(`File ${file.name} was rejected`)\n })\n }\n\n if (onUpload && updatedFiles.length > 0 && updatedFiles.length <= maxFileCount) {\n const target = updatedFiles.length > 0 ? `${updatedFiles.length} files` : `file`\n\n onUpload(updatedFiles).then(() => {\n setFiles([])\n toast(`${target} uploaded`)\n })\n }\n },\n\n [files, maxFileCount, multiple, onUpload, setFiles],\n )\n\n function onRemove(index: number) {\n if (!files) return\n\n if (isFileWithPreview(files[index])) {\n URL.revokeObjectURL(files[index].preview)\n }\n\n const newFiles = files.filter((_, i) => i !== index)\n setFiles(newFiles)\n onValueChange?.(newFiles)\n }\n\n // Revoke preview url when component unmounts\n React.useEffect(() => {\n return () => {\n if (!files) return\n files.forEach((file) => {\n if (isFileWithPreview(file)) {\n URL.revokeObjectURL(file.preview)\n }\n })\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n const isDisabled = disabled || (files?.length ?? 0) >= maxFileCount\n\n return (\n <div className=\"relative flex w-full flex-col gap-6\">\n <Dropzone onDrop={onDrop} accept={accept} maxSize={maxSize} maxFiles={maxFileCount} multiple={maxFileCount > 1 || multiple} disabled={isDisabled}>\n {({ getRootProps, getInputProps, isDragActive }) => (\n <div\n {...getRootProps()}\n className={cn(\n 'group',\n 'border-border-weak',\n 'hover:bg-border-weak/20',\n 'relative grid h-52 w-full cursor-pointer place-items-center rounded-lg border-2 border-dashed px-5 py-2.5 text-center transition',\n 'ring-offset-background',\n 'focus-visible:ring-primary-weak',\n 'focus-visible:ring-2',\n 'focus-visible:ring-offset-2',\n 'focus-visible:outline-hidden',\n isDragActive && 'border-border-primary-strong bg-border-weak/40',\n isDisabled && 'pointer-events-none opacity-60',\n className,\n )}\n {...dropzoneProps}\n >\n <input {...getInputProps()} />\n {isDragActive ? (\n <div className=\"flex flex-col items-center justify-center gap-4 sm:px-5\">\n <div className=\"rounded-full border border-dashed p-3\">\n <Upload className=\"text-text-positive-muted size-7\" aria-hidden=\"true\" />\n </div>\n <p className=\"text-text-positive-muted font-medium\">Drop the files here</p>\n </div>\n ) : (\n <div className=\"flex flex-col items-center justify-center gap-4 sm:px-5\">\n <div className=\"rounded-full border border-dashed p-3\">\n <Upload size={iconSize || 24} className=\"text-muted-foreground\" aria-hidden=\"true\" />\n </div>\n {showText && (\n <div className=\"flex flex-col gap-px\">\n <p className=\"text-text-positive-weak text-xs font-medium\">Drag {`'n'`} drop files here, or click to select files</p>\n <p className=\"text-text-positive-muted text-xs\">\n You can upload\n {maxFileCount > 1\n ? ` ${maxFileCount === Infinity ? 'multiple' : maxFileCount}\n files (up to ${formatBytes(maxSize)} each)`\n : ` a file with ${formatBytes(maxSize)}`}\n </p>\n </div>\n )}\n </div>\n )}\n </div>\n )}\n </Dropzone>\n {files?.length ? (\n <div className=\"h-fit w-full overflow-y-auto\">\n <div className=\"flex items-center justify-between px-3 py-2.5\">\n <div className=\"text-text-positive-weak flex items-center gap-1\">\n <Image size={16} aria-hidden=\"true\" />\n <p className=\"text-sm\">Ảnh đã tải lên ({files.length})</p>\n </div>\n <button\n className=\"hover:text-text-positive text-text-positive-muted flex cursor-pointer items-center gap-1 transition-colors duration-200\"\n onClick={() => {\n if (!files) return\n files.forEach((file) => {\n if (!isFileWithPreview(file)) return\n URL.revokeObjectURL(file.preview)\n })\n setFiles([])\n onValueChange?.([])\n }}\n >\n <Trash2 size={16} aria-hidden=\"true\" />\n <p className=\"text-sm\">Xóa tất cả</p>\n </button>\n </div>\n <div className=\"flex flex-col gap-2.5\">\n {files?.map((file, index) => (\n <FileCard key={index} file={file} onRemove={() => onRemove(index)} progress={progresses?.[file.name]} />\n ))}\n </div>\n </div>\n ) : null}\n </div>\n )\n}\n\ninterface FileCardProps {\n file: File\n onRemove: () => void\n progress?: number\n}\n\nfunction FileCard({ file, progress, onRemove }: FileCardProps) {\n return (\n <div className=\"border-border-weak hover:border-border relative flex items-center gap-4 rounded-md border py-2 pr-3 pl-2 shadow-xs transition-colors\">\n <div className=\"flex flex-1 gap-2.5\">\n {isFileWithPreview(file) ? <FilePreview file={file} /> : null}\n <div className=\"flex w-full flex-col gap-2\">\n <div className=\"flex flex-col gap-y-0.5\">\n <p className=\"text-text-positive line-clamp-1 text-sm\">{file.name}</p>\n <p className=\"text-text-positive-muted text-xs\">{formatBytes(file.size)}</p>\n </div>\n {progress ? <Progress value={progress} /> : null}\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n <Button type=\"button\" variant=\"ghost\" color=\"secondary\" size=\"icon\" className=\"size-7\" onClick={onRemove}>\n <Trash2 size={16} className=\"text-text-positive-muted\" aria-hidden=\"true\" />\n <span className=\"sr-only\">Remove file</span>\n </Button>\n </div>\n </div>\n )\n}\n\nfunction isFileWithPreview(file: File): file is File & { preview: string } {\n return 'preview' in file && typeof file.preview === 'string'\n}\n\ninterface FilePreviewProps {\n file: File & { preview: string }\n}\n\nfunction FilePreview({ file }: FilePreviewProps) {\n if (file.type.startsWith('image/')) {\n return <img src={file.preview} className=\"border-border aspect-square size-10 shrink-0 rounded border object-cover object-top shadow-sm\" />\n }\n\n return <FileText className=\"text-text-positive-muted size-10 border\" aria-hidden=\"true\" />\n}\n"],"mappings":"8dA4FA,SAAgB,EAAa,EAA0B,CACrD,GAAM,CACJ,MAAO,EACP,gBACA,WACA,aACA,SAAS,CACP,UAAW,IAEb,UAAU,KAAO,KAAO,EACxB,eAAe,EACf,WAAW,GACX,WAAW,GACX,WAAW,GACX,WACA,YACA,GAAG,GACD,EAEE,CAAC,EAAO,GAAY,EAAqB,CAC7C,KAAM,EACN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,EAAkB,GAAQ,EAAC,EAAA,CAAkB,SAAW,KACzD,EAAC,MAAA,CAAI,UAAU,uCACb,EAAC,MAAA,CAAI,UAAU,oCACb,EAAC,IAAA,CAAE,UAAU,mDAA2C,EAAK,OAC7D,EAAC,IAAA,CAAE,UAAU,4CAAoC,EAAY,EAAK,WAEnE,EAAW,EAAC,EAAA,CAAS,MAAO,IAAe,WAGhD,EAAC,MAAA,CAAI,UAAU,mCACb,EAAC,EAAA,CAAO,KAAK,SAAS,QAAQ,QAAQ,MAAM,YAAY,KAAK,OAAO,UAAU,SAAS,QAAS,YAC9F,EAAC,EAAA,CAAO,KAAM,GAAI,UAAU,2BAA2B,cAAY,SACnE,EAAC,OAAA,CAAK,UAAU,mBAAU,wBAOpC,SAAS,EAAkB,EAAgD,CACzE,MAAO,YAAa,GAAQ,OAAO,EAAK,SAAY,SAOtD,SAAS,EAAY,CAAE,QAA0B,CAK/C,OAJI,EAAK,KAAK,WAAW,UAChB,EAAC,MAAA,CAAI,IAAK,EAAK,QAAS,UAAU,kGAGpC,EAAC,EAAA,CAAS,UAAU,0CAA0C,cAAY"}
|
package/dist/ui/form.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";require(`../label-
|
|
1
|
+
"use client";require(`../label-BvHMsK0O.cjs`);const e=require(`../form-Dcd2HzUB.cjs`);exports.Form=e.Form,exports.FormControl=e.FormControl,exports.FormDescription=e.FormDescription,exports.FormField=e.FormField,exports.FormItem=e.FormItem,exports.FormLabel=e.FormLabel,exports.FormMessage=e.FormMessage,exports.useFormField=e.useFormField;
|
package/dist/ui/form.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime94 from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Label, Slot } from "radix-ui";
|
|
4
4
|
import * as react_hook_form0 from "react-hook-form";
|
|
@@ -8,7 +8,7 @@ import { ControllerProps, FieldPath, FieldValues } from "react-hook-form";
|
|
|
8
8
|
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: react_hook_form0.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
9
9
|
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({
|
|
10
10
|
...props
|
|
11
|
-
}: ControllerProps<TFieldValues, TName>) =>
|
|
11
|
+
}: ControllerProps<TFieldValues, TName>) => react_jsx_runtime94.JSX.Element;
|
|
12
12
|
declare const useFormField: () => {
|
|
13
13
|
invalid: boolean;
|
|
14
14
|
isDirty: boolean;
|
|
@@ -26,23 +26,23 @@ declare const useFormField: () => {
|
|
|
26
26
|
declare function FormItem({
|
|
27
27
|
className,
|
|
28
28
|
...props
|
|
29
|
-
}: React.ComponentProps<'div'>):
|
|
29
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime94.JSX.Element;
|
|
30
30
|
declare function FormLabel({
|
|
31
31
|
className,
|
|
32
32
|
...props
|
|
33
|
-
}: React.ComponentProps<typeof Label.Root>):
|
|
33
|
+
}: React.ComponentProps<typeof Label.Root>): react_jsx_runtime94.JSX.Element;
|
|
34
34
|
declare function FormControl({
|
|
35
35
|
...props
|
|
36
|
-
}: React.ComponentProps<typeof Slot.Slot>):
|
|
36
|
+
}: React.ComponentProps<typeof Slot.Slot>): react_jsx_runtime94.JSX.Element;
|
|
37
37
|
declare function FormDescription({
|
|
38
38
|
className,
|
|
39
39
|
...props
|
|
40
|
-
}: React.ComponentProps<'p'>):
|
|
40
|
+
}: React.ComponentProps<'p'>): react_jsx_runtime94.JSX.Element;
|
|
41
41
|
declare function FormMessage({
|
|
42
42
|
className,
|
|
43
43
|
children,
|
|
44
44
|
...props
|
|
45
|
-
}: React.ComponentProps<'p'>):
|
|
45
|
+
}: React.ComponentProps<'p'>): react_jsx_runtime94.JSX.Element;
|
|
46
46
|
//#endregion
|
|
47
47
|
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };
|
|
48
48
|
//# sourceMappingURL=form.d.cts.map
|
package/dist/ui/form.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import * as react_jsx_runtime103 from "react/jsx-runtime";
|
|
1
2
|
import React from "react";
|
|
2
|
-
import * as react_jsx_runtime130 from "react/jsx-runtime";
|
|
3
3
|
import { Label, Slot } from "radix-ui";
|
|
4
4
|
import * as react_hook_form0 from "react-hook-form";
|
|
5
5
|
import { ControllerProps, FieldPath, FieldValues } from "react-hook-form";
|
|
@@ -8,7 +8,7 @@ import { ControllerProps, FieldPath, FieldValues } from "react-hook-form";
|
|
|
8
8
|
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: react_hook_form0.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
9
9
|
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({
|
|
10
10
|
...props
|
|
11
|
-
}: ControllerProps<TFieldValues, TName>) =>
|
|
11
|
+
}: ControllerProps<TFieldValues, TName>) => react_jsx_runtime103.JSX.Element;
|
|
12
12
|
declare const useFormField: () => {
|
|
13
13
|
invalid: boolean;
|
|
14
14
|
isDirty: boolean;
|
|
@@ -26,23 +26,23 @@ declare const useFormField: () => {
|
|
|
26
26
|
declare function FormItem({
|
|
27
27
|
className,
|
|
28
28
|
...props
|
|
29
|
-
}: React.ComponentProps<'div'>):
|
|
29
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime103.JSX.Element;
|
|
30
30
|
declare function FormLabel({
|
|
31
31
|
className,
|
|
32
32
|
...props
|
|
33
|
-
}: React.ComponentProps<typeof Label.Root>):
|
|
33
|
+
}: React.ComponentProps<typeof Label.Root>): react_jsx_runtime103.JSX.Element;
|
|
34
34
|
declare function FormControl({
|
|
35
35
|
...props
|
|
36
|
-
}: React.ComponentProps<typeof Slot.Slot>):
|
|
36
|
+
}: React.ComponentProps<typeof Slot.Slot>): react_jsx_runtime103.JSX.Element;
|
|
37
37
|
declare function FormDescription({
|
|
38
38
|
className,
|
|
39
39
|
...props
|
|
40
|
-
}: React.ComponentProps<'p'>):
|
|
40
|
+
}: React.ComponentProps<'p'>): react_jsx_runtime103.JSX.Element;
|
|
41
41
|
declare function FormMessage({
|
|
42
42
|
className,
|
|
43
43
|
children,
|
|
44
44
|
...props
|
|
45
|
-
}: React.ComponentProps<'p'>):
|
|
45
|
+
}: React.ComponentProps<'p'>): react_jsx_runtime103.JSX.Element;
|
|
46
46
|
//#endregion
|
|
47
47
|
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };
|
|
48
48
|
//# sourceMappingURL=form.d.ts.map
|
package/dist/ui/form.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import"../label-
|
|
1
|
+
"use client";import"../label-BpefWj7m.js";import{Form as e,FormControl as t,FormDescription as n,FormField as r,FormItem as i,FormLabel as a,FormMessage as o,useFormField as s}from"../form-RRTCXIG6.js";export{e as Form,t as FormControl,n as FormDescription,r as FormField,i as FormItem,a as FormLabel,o as FormMessage,s as useFormField};
|
package/dist/ui/hover-card.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require(`../chunk-CUT6urMc.cjs`),t=e.__toESM(require(
|
|
1
|
+
"use client";const e=require(`../chunk-CUT6urMc.cjs`),t=e.__toESM(require(`@customafk/react-toolkit/utils`)),n=e.__toESM(require(`react/jsx-runtime`)),r=e.__toESM(require(`react`)),i=e.__toESM(require(`radix-ui`));function a({...e}){return(0,n.jsx)(i.HoverCard.Root,{"data-slot":`hover-card`,...e})}function o({...e}){return(0,n.jsx)(i.HoverCard.Trigger,{"data-slot":`hover-card-trigger`,...e})}function s({className:e,align:r=`center`,sideOffset:a=4,...o}){return(0,n.jsx)(i.HoverCard.Portal,{"data-slot":`hover-card-portal`,children:(0,n.jsx)(i.HoverCard.Content,{"data-slot":`hover-card-content`,align:r,sideOffset:a,className:(0,t.cn)(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden`,e),...o})})}exports.HoverCard=a,exports.HoverCardContent=s,exports.HoverCardTrigger=o;
|
|
2
2
|
//# sourceMappingURL=hover-card.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover-card.cjs","names":["HoverCardPrimitive"],"sources":["../../packages/components/ui/hover-card.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\nimport {
|
|
1
|
+
{"version":3,"file":"hover-card.cjs","names":["HoverCardPrimitive"],"sources":["../../packages/components/ui/hover-card.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\nimport { cn } from '@customafk/react-toolkit/utils'\n\nimport { HoverCard as HoverCardPrimitive } from 'radix-ui'\n\nfunction HoverCard({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Root>) {\n return <HoverCardPrimitive.Root data-slot=\"hover-card\" {...props} />\n}\n\nfunction HoverCardTrigger({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Trigger>) {\n return <HoverCardPrimitive.Trigger data-slot=\"hover-card-trigger\" {...props} />\n}\n\nfunction HoverCardContent({ className, align = 'center', sideOffset = 4, ...props }: React.ComponentProps<typeof HoverCardPrimitive.Content>) {\n return (\n <HoverCardPrimitive.Portal data-slot=\"hover-card-portal\">\n <HoverCardPrimitive.Content\n data-slot=\"hover-card-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden',\n className,\n )}\n {...props}\n />\n </HoverCardPrimitive.Portal>\n )\n}\n\nexport { HoverCard, HoverCardContent, HoverCardTrigger }\n"],"mappings":"sNAMA,SAAS,EAAU,CAAE,GAAG,GAA+D,CACrF,OAAO,EAAA,EAAA,KAACA,EAAAA,UAAmB,KAAA,CAAK,YAAU,aAAa,GAAI,IAG7D,SAAS,EAAiB,CAAE,GAAG,GAAkE,CAC/F,OAAO,EAAA,EAAA,KAACA,EAAAA,UAAmB,QAAA,CAAQ,YAAU,qBAAqB,GAAI,IAGxE,SAAS,EAAiB,CAAE,YAAW,QAAQ,SAAU,aAAa,EAAG,GAAG,GAAkE,CAC5I,OACE,EAAA,EAAA,KAACA,EAAAA,UAAmB,OAAA,CAAO,YAAU,8BACnC,EAAA,EAAA,KAACA,EAAAA,UAAmB,QAAA,CAClB,YAAU,qBACH,QACK,aACZ,WAAA,EAAA,EAAA,IACE,oeACA,GAEF,GAAI"}
|
package/dist/ui/hover-card.d.cts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime115 from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { HoverCard as HoverCard$1 } from "radix-ui";
|
|
4
4
|
|
|
5
5
|
//#region packages/components/ui/hover-card.d.ts
|
|
6
6
|
declare function HoverCard({
|
|
7
7
|
...props
|
|
8
|
-
}: React.ComponentProps<typeof HoverCard$1.Root>):
|
|
8
|
+
}: React.ComponentProps<typeof HoverCard$1.Root>): react_jsx_runtime115.JSX.Element;
|
|
9
9
|
declare function HoverCardTrigger({
|
|
10
10
|
...props
|
|
11
|
-
}: React.ComponentProps<typeof HoverCard$1.Trigger>):
|
|
11
|
+
}: React.ComponentProps<typeof HoverCard$1.Trigger>): react_jsx_runtime115.JSX.Element;
|
|
12
12
|
declare function HoverCardContent({
|
|
13
13
|
className,
|
|
14
14
|
align,
|
|
15
15
|
sideOffset,
|
|
16
16
|
...props
|
|
17
|
-
}: React.ComponentProps<typeof HoverCard$1.Content>):
|
|
17
|
+
}: React.ComponentProps<typeof HoverCard$1.Content>): react_jsx_runtime115.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { HoverCard, HoverCardContent, HoverCardTrigger };
|
|
20
20
|
//# sourceMappingURL=hover-card.d.cts.map
|