@customafk/lunas-ui 0.0.64 → 0.0.65
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/dist/{add-new-Dw0uZWxo.js → add-new-BFDOXej7.js} +1 -1
- package/dist/{add-new-Dw0uZWxo.js.map → add-new-BFDOXej7.js.map} +1 -1
- package/dist/{add-new-C2dDiCV3.cjs → add-new-D3b8hc2C.cjs} +1 -1
- package/dist/{add-new-C2dDiCV3.cjs.map → add-new-D3b8hc2C.cjs.map} +1 -1
- package/dist/{alert-dialog-BOMy-TmT.js → alert-dialog-B5dXkMIF.js} +1 -1
- package/dist/{alert-dialog-BOMy-TmT.js.map → alert-dialog-B5dXkMIF.js.map} +1 -1
- package/dist/{alert-dialog-lwTxSl-r.cjs → alert-dialog-D-4wxqLK.cjs} +1 -1
- package/dist/{alert-dialog-lwTxSl-r.cjs.map → alert-dialog-D-4wxqLK.cjs.map} +1 -1
- package/dist/{avatar-BaNIRUku.cjs → avatar-Ch6Lx2oc.cjs} +1 -1
- package/dist/{avatar-BaNIRUku.cjs.map → avatar-Ch6Lx2oc.cjs.map} +1 -1
- package/dist/{avatar-DZU7feMQ.js → avatar-ClIgQDJO.js} +1 -1
- package/dist/{avatar-DZU7feMQ.js.map → avatar-ClIgQDJO.js.map} +1 -1
- package/dist/{button-CS4aajjP.d.ts → button-DUWg-QPz.d.ts} +5 -5
- package/dist/{button-De2032Bs.d.cts → button-st5plaQt.d.cts} +5 -5
- package/dist/{calendar-CUDdTiC-.cjs → calendar-B6F_Lppz.cjs} +1 -1
- package/dist/{calendar-CUDdTiC-.cjs.map → calendar-B6F_Lppz.cjs.map} +1 -1
- package/dist/{calendar-BZRNZdsJ.js → calendar-CXddeN7A.js} +1 -1
- package/dist/{calendar-BZRNZdsJ.js.map → calendar-CXddeN7A.js.map} +1 -1
- package/dist/cards/simple-card.d.cts +2 -2
- package/dist/cards/simple-card.d.ts +2 -2
- package/dist/{command-B9nlrxXh.cjs → command-BNYekOzL.cjs} +2 -2
- package/dist/{command-B9nlrxXh.cjs.map → command-BNYekOzL.cjs.map} +1 -1
- package/dist/{command-D7AHVkgQ.d.ts → command-CL9pytMx.d.cts} +12 -12
- package/dist/{command-DKD5gHi_.js → command-CyWyRcle.js} +2 -2
- package/dist/{command-DKD5gHi_.js.map → command-CyWyRcle.js.map} +1 -1
- package/dist/{command-Db5JViIx.d.cts → command-zikueR7l.d.ts} +12 -12
- package/dist/data-display/empty.d.cts +2 -2
- package/dist/data-display/statistic.d.cts +2 -2
- package/dist/data-display/statistic.d.ts +2 -2
- package/dist/data-display/user.cjs +2 -0
- package/dist/data-display/user.cjs.map +1 -0
- package/dist/data-display/user.d.cts +10 -0
- package/dist/data-display/user.d.ts +10 -0
- package/dist/data-display/user.js +2 -0
- package/dist/data-display/user.js.map +1 -0
- package/dist/{dialog-yE-2SRfz.d.ts → dialog-Dease_8R.d.ts} +12 -12
- package/dist/{dialog-CiqPVetj.d.cts → dialog-oAOedasX.d.cts} +12 -12
- package/dist/{dialog-DbI18XF9.js → dialog-pMHkBJ-w.js} +1 -1
- package/dist/{dialog-DbI18XF9.js.map → dialog-pMHkBJ-w.js.map} +1 -1
- package/dist/{dialog-CGrbU7PO.cjs → dialog-wX27mb8E.cjs} +1 -1
- package/dist/{dialog-CGrbU7PO.cjs.map → dialog-wX27mb8E.cjs.map} +1 -1
- 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 +30 -30
- package/dist/dialogs/detail-dialog/component/sidebar.d.ts +30 -30
- 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.js +1 -1
- package/dist/dialogs/error-dialog.cjs +1 -1
- package/dist/dialogs/error-dialog.js +1 -1
- package/dist/dialogs/form-dialog.cjs +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/loading-dialog.cjs +1 -1
- package/dist/dialogs/loading-dialog.js +1 -1
- package/dist/{drawer-B7OJzlXZ.js → drawer-DnhgwetT.js} +1 -1
- package/dist/{drawer-B7OJzlXZ.js.map → drawer-DnhgwetT.js.map} +1 -1
- package/dist/{drawer-Dh9uXVnU.cjs → drawer-sRfKhXA3.cjs} +1 -1
- package/dist/{drawer-Dh9uXVnU.cjs.map → drawer-sRfKhXA3.cjs.map} +1 -1
- package/dist/{dropdown-menu-Cn96vqMy.js → dropdown-menu-Bj39Rmxd.js} +1 -1
- package/dist/{dropdown-menu-Cn96vqMy.js.map → dropdown-menu-Bj39Rmxd.js.map} +1 -1
- package/dist/{dropdown-menu-BtNJk8EZ.cjs → dropdown-menu-SNcBwTOA.cjs} +1 -1
- package/dist/{dropdown-menu-BtNJk8EZ.cjs.map → dropdown-menu-SNcBwTOA.cjs.map} +1 -1
- package/dist/{error-dialog-D3tnycqF.js → error-dialog-CphiTB4y.js} +2 -2
- package/dist/{error-dialog-D3tnycqF.js.map → error-dialog-CphiTB4y.js.map} +1 -1
- package/dist/{error-dialog-BkCaUR7F.cjs → error-dialog-DGg0x5xF.cjs} +2 -2
- package/dist/{error-dialog-BkCaUR7F.cjs.map → error-dialog-DGg0x5xF.cjs.map} +1 -1
- package/dist/{form-D-gDMD-J.js → form-B-KLKj5u.js} +2 -2
- package/dist/{form-D-gDMD-J.js.map → form-B-KLKj5u.js.map} +1 -1
- package/dist/{form-CaxhlWxK.cjs → form-CtpHZKmh.cjs} +2 -2
- package/dist/{form-CaxhlWxK.cjs.map → form-CtpHZKmh.cjs.map} +1 -1
- package/dist/{form-wrapper-BUkoh-c7.cjs → form-wrapper-C3pU1F5r.cjs} +2 -2
- package/dist/{form-wrapper-BUkoh-c7.cjs.map → form-wrapper-C3pU1F5r.cjs.map} +1 -1
- package/dist/{form-wrapper-BbScjpBv.js → form-wrapper-Deo8gKv5.js} +2 -2
- package/dist/{form-wrapper-BbScjpBv.js.map → form-wrapper-Deo8gKv5.js.map} +1 -1
- package/dist/forms/combobox-field.cjs +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/date-field.cjs +1 -1
- package/dist/forms/date-field.d.ts +2 -2
- package/dist/forms/date-field.js +1 -1
- package/dist/forms/form-wrapper.cjs +1 -1
- package/dist/forms/form-wrapper.d.cts +2 -2
- package/dist/forms/form-wrapper.d.ts +2 -2
- package/dist/forms/form-wrapper.js +1 -1
- package/dist/forms/multi-select-field.cjs +1 -1
- package/dist/forms/multi-select-field.d.cts +2 -2
- package/dist/forms/multi-select-field.d.ts +2 -2
- package/dist/forms/multi-select-field.js +1 -1
- package/dist/forms/number-field.cjs +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/password-field.cjs +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/select-field.cjs +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/switch-field.cjs +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/text-field.cjs +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/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-BFZuwsER.js → input-BUYJ4_aj.js} +1 -1
- package/dist/{input-BFZuwsER.js.map → input-BUYJ4_aj.js.map} +1 -1
- package/dist/{input-BayoSfCE.d.cts → input-BXxtPvIa.d.cts} +3 -3
- package/dist/{input-BjiwI6EW.d.ts → input-DO3Z69kK.d.ts} +3 -3
- package/dist/{input-ERPHY3v4.cjs → input-DgtTVBtN.cjs} +1 -1
- package/dist/{input-ERPHY3v4.cjs.map → input-DgtTVBtN.cjs.map} +1 -1
- package/dist/{label-BBPPT0-L.cjs → label-BZqk7MPJ.cjs} +1 -1
- package/dist/{label-BBPPT0-L.cjs.map → label-BZqk7MPJ.cjs.map} +1 -1
- package/dist/{label-DdpIoRiG.js → label-HVpeECNr.js} +1 -1
- package/dist/{label-DdpIoRiG.js.map → label-HVpeECNr.js.map} +1 -1
- package/dist/layouts/app-layout/index.d.cts +28 -28
- package/dist/layouts/app-layout/index.d.ts +3 -3
- package/dist/layouts/flex.d.cts +4 -4
- package/dist/layouts/flex.d.ts +2 -2
- package/dist/layouts/service-layout/index.cjs +1 -1
- package/dist/layouts/service-layout/index.cjs.map +1 -1
- package/dist/layouts/service-layout/index.d.cts +15 -15
- package/dist/layouts/service-layout/index.d.ts +3 -3
- package/dist/layouts/service-layout/index.js +1 -1
- package/dist/layouts/service-layout/index.js.map +1 -1
- package/dist/{multi-select-BAXHYtlU.cjs → multi-select-DRKqFg1M.cjs} +2 -2
- package/dist/{multi-select-BAXHYtlU.cjs.map → multi-select-DRKqFg1M.cjs.map} +1 -1
- package/dist/{multi-select-oXuLHx0A.js → multi-select-DyhAPckx.js} +2 -2
- package/dist/{multi-select-oXuLHx0A.js.map → multi-select-DyhAPckx.js.map} +1 -1
- package/dist/{popover-ByL6Igxn.cjs → popover-Bi7GLJT5.cjs} +1 -1
- package/dist/{popover-ByL6Igxn.cjs.map → popover-Bi7GLJT5.cjs.map} +1 -1
- package/dist/{popover-DMt7GPSm.js → popover-CxOK3oy2.js} +1 -1
- package/dist/{popover-DMt7GPSm.js.map → popover-CxOK3oy2.js.map} +1 -1
- package/dist/{refresh-BVSXOk3A.cjs → refresh-CQyFVZx9.cjs} +1 -1
- package/dist/{refresh-BVSXOk3A.cjs.map → refresh-CQyFVZx9.cjs.map} +1 -1
- package/dist/{refresh-CHzDlf3i.js → refresh-CTcKzu_a.js} +1 -1
- package/dist/{refresh-CHzDlf3i.js.map → refresh-CTcKzu_a.js.map} +1 -1
- package/dist/{scroll-area-C4Mg89Qh.js → scroll-area-CqevC_nb.js} +1 -1
- package/dist/{scroll-area-C4Mg89Qh.js.map → scroll-area-CqevC_nb.js.map} +1 -1
- package/dist/{scroll-area-qPdEy4lg.cjs → scroll-area-Dgjr1n1T.cjs} +1 -1
- package/dist/{scroll-area-qPdEy4lg.cjs.map → scroll-area-Dgjr1n1T.cjs.map} +1 -1
- package/dist/{search-input-DWLfcXEU.cjs → search-input-BkhVqB3R.cjs} +2 -2
- package/dist/{search-input-DWLfcXEU.cjs.map → search-input-BkhVqB3R.cjs.map} +1 -1
- package/dist/{search-input-B_L6kaz-.js → search-input-DnYrPBeT.js} +2 -2
- package/dist/{search-input-B_L6kaz-.js.map → search-input-DnYrPBeT.js.map} +1 -1
- package/dist/{select-CijI0HX0.js → select-Cmq5a3Wg.js} +1 -1
- package/dist/{select-CijI0HX0.js.map → select-Cmq5a3Wg.js.map} +1 -1
- package/dist/{select-oxr4KoHx.cjs → select-DAE3Xg7g.cjs} +1 -1
- package/dist/{select-oxr4KoHx.cjs.map → select-DAE3Xg7g.cjs.map} +1 -1
- package/dist/{separator-BSmwGEtT.d.cts → separator-B-TIckT4.d.cts} +3 -3
- package/dist/{separator-zD-G3xIG.d.ts → separator-CO0oTpOK.d.ts} +3 -3
- package/dist/{sidebar-BxGyCuTJ.cjs → sidebar-CROF88rz.cjs} +2 -2
- package/dist/{sidebar-BxGyCuTJ.cjs.map → sidebar-CROF88rz.cjs.map} +1 -1
- package/dist/{sidebar-CMWETVDr.js → sidebar-CrStgrmq.js} +2 -2
- package/dist/{sidebar-CMWETVDr.js.map → sidebar-CrStgrmq.js.map} +1 -1
- package/dist/{switch-BPSKvrTw.cjs → switch-BnHSwQ5T.cjs} +1 -1
- package/dist/{switch-BPSKvrTw.cjs.map → switch-BnHSwQ5T.cjs.map} +1 -1
- package/dist/{switch-Crju8DJO.js → switch-iwm2-R_e.js} +1 -1
- package/dist/{switch-Crju8DJO.js.map → switch-iwm2-R_e.js.map} +1 -1
- package/dist/table/index.cjs +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-CSvLRXlk.cjs → table-CuhHhpgi.cjs} +2 -2
- package/dist/{table-CSvLRXlk.cjs.map → table-CuhHhpgi.cjs.map} +1 -1
- package/dist/{table-DCmuhHSH.js → table-oROsZcz4.js} +2 -2
- package/dist/{table-DCmuhHSH.js.map → table-oROsZcz4.js.map} +1 -1
- package/dist/{textarea-BtACo9UF.cjs → textarea-DK_bNV0u.cjs} +1 -1
- package/dist/{textarea-BtACo9UF.cjs.map → textarea-DK_bNV0u.cjs.map} +1 -1
- package/dist/{textarea-BCZiUxv7.js → textarea-DbNqKCAi.js} +1 -1
- package/dist/{textarea-BCZiUxv7.js.map → textarea-DbNqKCAi.js.map} +1 -1
- package/dist/{title-sD8UJhwY.cjs → title-B51-Oj-Y.cjs} +1 -1
- package/dist/{title-sD8UJhwY.cjs.map → title-B51-Oj-Y.cjs.map} +1 -1
- package/dist/{title-CtD4oOTk.js → title-Cb4SosQb.js} +1 -1
- package/dist/{title-CtD4oOTk.js.map → title-Cb4SosQb.js.map} +1 -1
- package/dist/{toggle-CP8phE7Y.d.cts → toggle-BHyG321X.d.ts} +5 -5
- package/dist/{toggle-BtGh6fdx.d.ts → toggle-DdY6X9AI.d.cts} +4 -4
- package/dist/{tooltip-CamHYf1v.d.ts → tooltip-BURz5fQL.d.ts} +6 -6
- package/dist/{tooltip-DLNDOfBF.d.cts → tooltip-C0_WxGo5.d.cts} +6 -6
- package/dist/typography/paragraph.d.cts +2 -2
- package/dist/typography/paragraph.d.ts +2 -2
- package/dist/typography/title.cjs +1 -1
- package/dist/typography/title.d.cts +2 -2
- package/dist/typography/title.d.ts +2 -2
- package/dist/typography/title.js +1 -1
- 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.d.cts +4 -4
- package/dist/ui/alert.d.ts +6 -6
- package/dist/ui/aspect-ratio.d.cts +2 -2
- package/dist/ui/aspect-ratio.d.ts +2 -2
- package/dist/ui/avatar.cjs +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/badge.d.cts +4 -4
- package/dist/ui/badge.d.ts +4 -4
- package/dist/ui/breadcrumb.d.cts +8 -8
- package/dist/ui/breadcrumb.d.ts +8 -8
- package/dist/ui/button.d.cts +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/calendar.cjs +1 -1
- package/dist/ui/calendar.d.cts +4 -4
- 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.d.cts +7 -7
- package/dist/ui/carousel.d.ts +7 -7
- package/dist/ui/collapsible.d.cts +4 -4
- package/dist/ui/collapsible.d.ts +4 -4
- package/dist/ui/command.cjs +1 -1
- package/dist/ui/command.d.cts +2 -2
- package/dist/ui/command.d.ts +2 -2
- package/dist/ui/command.js +1 -1
- package/dist/ui/context-menu.d.cts +16 -16
- package/dist/ui/context-menu.d.ts +16 -16
- package/dist/ui/dialog.cjs +1 -1
- package/dist/ui/dialog.d.cts +1 -1
- package/dist/ui/dialog.d.ts +1 -1
- package/dist/ui/dialog.js +1 -1
- package/dist/ui/dropdown-menu.cjs +1 -1
- package/dist/ui/dropdown-menu.d.cts +16 -16
- package/dist/ui/dropdown-menu.d.ts +16 -16
- package/dist/ui/dropdown-menu.js +1 -1
- package/dist/ui/file-uploader.d.cts +2 -2
- package/dist/ui/file-uploader.d.ts +2 -2
- 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.d.cts +4 -4
- package/dist/ui/hover-card.d.ts +4 -4
- package/dist/ui/input-otp.d.cts +5 -5
- package/dist/ui/input-otp.d.ts +5 -5
- 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.d.cts +17 -17
- package/dist/ui/menubar.d.ts +17 -17
- 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.d.cts +11 -11
- package/dist/ui/navigation-menu.d.ts +11 -11
- package/dist/ui/pagination.d.cts +9 -9
- package/dist/ui/pagination.d.ts +9 -9
- package/dist/ui/popover.cjs +1 -1
- package/dist/ui/popover.d.cts +5 -5
- package/dist/ui/popover.d.ts +5 -5
- package/dist/ui/popover.js +1 -1
- package/dist/ui/progress.d.cts +2 -2
- package/dist/ui/progress.d.ts +2 -2
- package/dist/ui/radio-group.d.cts +3 -3
- package/dist/ui/radio-group.d.ts +3 -3
- package/dist/ui/resizable.d.cts +4 -4
- package/dist/ui/resizable.d.ts +4 -4
- package/dist/ui/scroll-area.cjs +1 -1
- package/dist/ui/scroll-area.d.cts +3 -3
- package/dist/ui/scroll-area.d.ts +3 -3
- package/dist/ui/scroll-area.js +1 -1
- 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.d.cts +1 -1
- package/dist/ui/separator.d.ts +1 -1
- package/dist/ui/sheet.d.cts +9 -9
- package/dist/ui/sheet.d.ts +9 -9
- package/dist/ui/sidebar.cjs +1 -1
- package/dist/ui/sidebar.d.cts +30 -30
- package/dist/ui/sidebar.d.ts +28 -28
- package/dist/ui/sidebar.js +1 -1
- package/dist/ui/skeleton.d.cts +2 -2
- package/dist/ui/skeleton.d.ts +2 -2
- package/dist/ui/slider.d.cts +2 -2
- package/dist/ui/slider.d.ts +2 -2
- 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.d.cts +5 -5
- package/dist/ui/tabs.d.ts +5 -5
- 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.d.cts +4 -4
- package/dist/ui/toggle-group.d.ts +4 -4
- package/dist/ui/toggle.d.cts +1 -1
- package/dist/ui/toggle.d.ts +1 -1
- package/dist/ui/tooltip.d.cts +1 -1
- package/dist/ui/tooltip.d.ts +1 -1
- package/package.json +6 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`./chunk-CUT6urMc.cjs`),t=require(`./alert-dialog-
|
|
2
|
-
//# sourceMappingURL=error-dialog-
|
|
1
|
+
const e=require(`./chunk-CUT6urMc.cjs`),t=require(`./alert-dialog-D-4wxqLK.cjs`),n=e.__toESM(require(`lucide-react`)),r=e.__toESM(require(`react/jsx-runtime`)),i=e.__toESM(require(`react`)),a=({open:e,title:a,children:o,onOpenChange:s})=>{let c=(0,i.useCallback)(()=>{s?.(!1)},[s]);return(0,r.jsx)(t.AlertDialog,{open:e,onOpenChange:s,children:(0,r.jsxs)(t.AlertDialogContent,{className:`gap-8 p-4 sm:max-w-md`,children:[(0,r.jsx)(t.AlertDialogHeader,{children:(0,r.jsxs)(`div`,{className:`text-destructive flex flex-col items-center`,children:[(0,r.jsx)(n.AlertTriangleIcon,{size:42}),(0,r.jsx)(t.AlertDialogTitle,{className:`text-xl font-medium`,children:a||`An error occurred`})]})}),o,(0,r.jsx)(t.AlertDialogFooter,{children:(0,r.jsx)(t.AlertDialogAction,{className:`w-full sm:w-28`,onClick:c,children:`Close`})})]})})};Object.defineProperty(exports,`ErrorDialog`,{enumerable:!0,get:function(){return a}});
|
|
2
|
+
//# sourceMappingURL=error-dialog-DGg0x5xF.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-dialog-
|
|
1
|
+
{"version":3,"file":"error-dialog-DGg0x5xF.cjs","names":["ErrorDialog: React.FC<React.PropsWithChildren<Props>>","AlertDialog","AlertDialogContent","AlertDialogHeader","AlertTriangleIcon","AlertDialogTitle","AlertDialogFooter","AlertDialogAction"],"sources":["../packages/components/dialogs/error-dialog.tsx"],"sourcesContent":["import { useCallback } from 'react'\n\nimport { AlertTriangleIcon } from 'lucide-react'\n\nimport { AlertDialog, AlertDialogAction, AlertDialogContent, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from '../ui/alert-dialog'\n\ntype Props = {\n open?: boolean\n title?: string\n description?: string\n onOpenChange?: (open: boolean) => void\n}\nexport const ErrorDialog: React.FC<React.PropsWithChildren<Props>> = ({ open, title, children, onOpenChange }) => {\n const handleClose = useCallback(() => {\n onOpenChange?.(false)\n }, [onOpenChange])\n return (\n <AlertDialog open={open} onOpenChange={onOpenChange}>\n <AlertDialogContent className=\"gap-8 p-4 sm:max-w-md\">\n <AlertDialogHeader>\n <div className=\"text-destructive flex flex-col items-center\">\n <AlertTriangleIcon size={42} />\n <AlertDialogTitle className=\"text-xl font-medium\">{title || 'An error occurred'}</AlertDialogTitle>\n </div>\n </AlertDialogHeader>\n {children}\n <AlertDialogFooter>\n <AlertDialogAction className=\"w-full sm:w-28\" onClick={handleClose}>\n Close\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n )\n}\n"],"mappings":"8LAYaA,GAAyD,CAAE,OAAM,QAAO,WAAU,kBAAmB,CAChH,IAAM,GAAA,EAAA,EAAA,iBAAgC,CACpC,IAAe,KACd,CAAC,IACJ,OACE,EAAA,EAAA,KAACC,EAAAA,YAAAA,CAAkB,OAAoB,yBACrC,EAAA,EAAA,MAACC,EAAAA,mBAAAA,CAAmB,UAAU,mCAC5B,EAAA,EAAA,KAACC,EAAAA,kBAAAA,CAAAA,UACC,EAAA,EAAA,MAAC,MAAA,CAAI,UAAU,yDACb,EAAA,EAAA,KAACC,EAAAA,kBAAAA,CAAkB,KAAM,MACzB,EAAA,EAAA,KAACC,EAAAA,iBAAAA,CAAiB,UAAU,+BAAuB,GAAS,2BAG/D,GACD,EAAA,EAAA,KAACC,EAAAA,kBAAAA,CAAAA,UACC,EAAA,EAAA,KAACC,EAAAA,kBAAAA,CAAkB,UAAU,iBAAiB,QAAS,WAAa"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Label as e}from"./label-
|
|
2
|
-
//# sourceMappingURL=form-
|
|
1
|
+
import{Label as e}from"./label-HVpeECNr.js";import{cn as t}from"@customafk/react-toolkit/utils";import{Label as n,Slot as r}from"radix-ui";import{jsx as i}from"react/jsx-runtime";import{createContext as a,useContext as o,useId as s}from"react";import{Controller as c,FormProvider as l,useFormContext as u,useFormState as d}from"react-hook-form";const f=l,p=a({}),m=({...e})=>i(p.Provider,{value:{name:e.name},children:i(c,{...e})}),h=()=>{let e=o(p),t=o(g),{getFieldState:n,control:r,resetField:i}=u(),a=d({name:e.name}),s=n(e.name,a);if(!e)throw Error(`useFormField should be used within <FormField>`);let{id:c}=t;return{id:c,control:r,resetField:i,name:e.name,formItemId:`${c}-form-item`,formDescriptionId:`${c}-form-item-description`,formMessageId:`${c}-form-item-message`,...s}},g=a({});function _({className:e,...n}){let r=s();return i(g.Provider,{value:{id:r},children:i(`div`,{"data-slot":`form-item`,className:t(`grid gap-1`,e),...n})})}function v({className:n,...r}){let{formItemId:a}=h();return i(e,{"data-slot":`form-label`,className:t(`text-xs`,n),htmlFor:a,...r})}function y({...e}){let{error:t,formItemId:n,formDescriptionId:a,formMessageId:o}=h();return i(r.Slot,{"data-slot":`form-control`,id:n,"aria-describedby":t?`${a} ${o}`:`${a}`,"aria-invalid":!!t,...e})}function b({className:e,...n}){let{formDescriptionId:r}=h();return i(`p`,{"data-slot":`form-description`,id:r,className:t(`text-text-positive-weak text-sm`,e),...n})}function x({className:e,children:n,...r}){let{error:a,formMessageId:o}=h();return i(`span`,{"data-slot":`form-message`,id:o,className:t(`text-danger text-xs`,e),...r,children:a?String(a?.message??``):n})}export{f as Form,y as FormControl,b as FormDescription,m as FormField,_ as FormItem,v as FormLabel,x as FormMessage,h as useFormField};
|
|
2
|
+
//# sourceMappingURL=form-B-KLKj5u.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-
|
|
1
|
+
{"version":3,"file":"form-B-KLKj5u.js","names":["Label","SlotPrimitive"],"sources":["../packages/components/ui/form.tsx"],"sourcesContent":["'use client'\nimport { createContext, useContext, useId } from 'react'\nimport { Controller, type ControllerProps, type FieldPath, type FieldValues, FormProvider, useFormContext, useFormState } from 'react-hook-form'\nimport { cn } from '@customafk/react-toolkit/utils'\n\nimport { Label } from '@/components/ui/label'\n\nimport { Label as LabelPrimitive, Slot as SlotPrimitive } from 'radix-ui'\n\nconst Form = FormProvider\n\ntype FormFieldContextValue<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {\n name: TName\n}\n\nconst FormFieldContext = createContext<FormFieldContextValue>({} as FormFieldContextValue)\n\nconst FormField = <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n )\n}\n\nconst useFormField = () => {\n const fieldContext = useContext(FormFieldContext)\n const itemContext = useContext(FormItemContext)\n const { getFieldState, control, resetField } = useFormContext()\n const formState = useFormState({ name: fieldContext.name })\n const fieldState = getFieldState(fieldContext.name, formState)\n\n if (!fieldContext) {\n throw new Error('useFormField should be used within <FormField>')\n }\n\n const { id } = itemContext\n\n return {\n id,\n control,\n resetField,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n }\n}\n\ntype FormItemContextValue = {\n id: string\n}\n\nconst FormItemContext = createContext<FormItemContextValue>({} as FormItemContextValue)\n\nfunction FormItem({ className, ...props }: React.ComponentProps<'div'>) {\n const id = useId()\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div data-slot=\"form-item\" className={cn('grid gap-1', className)} {...props} />\n </FormItemContext.Provider>\n )\n}\n\nfunction FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {\n const { formItemId } = useFormField()\n return <Label data-slot=\"form-label\" className={cn('text-xs', className)} htmlFor={formItemId} {...props} />\n}\n\nfunction FormControl({ ...props }: React.ComponentProps<typeof SlotPrimitive.Slot>) {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField()\n\n return (\n <SlotPrimitive.Slot\n data-slot=\"form-control\"\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n )\n}\n\nfunction FormDescription({ className, ...props }: React.ComponentProps<'p'>) {\n const { formDescriptionId } = useFormField()\n\n return <p data-slot=\"form-description\" id={formDescriptionId} className={cn('text-text-positive-weak text-sm', className)} {...props} />\n}\n\nfunction FormMessage({ className, children, ...props }: React.ComponentProps<'p'>) {\n const { error, formMessageId } = useFormField()\n\n return (\n <span data-slot=\"form-message\" id={formMessageId} className={cn('text-danger text-xs', className)} {...props}>\n {error ? String(error?.message ?? '') : children}\n </span>\n )\n}\n\n// eslint-disable-next-line react-refresh/only-export-components\nexport { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField }\n"],"mappings":"yVASA,MAAM,EAAO,EAMP,EAAmB,EAAqC,IAExD,GAA8H,CAClI,GAAG,KAGD,EAAC,EAAiB,SAAA,CAAS,MAAO,CAAE,KAAM,EAAM,eAC9C,EAAC,EAAA,CAAW,GAAI,MAKhB,MAAqB,CACzB,IAAM,EAAe,EAAW,GAC1B,EAAc,EAAW,GACzB,CAAE,gBAAe,UAAS,cAAe,IACzC,EAAY,EAAa,CAAE,KAAM,EAAa,OAC9C,EAAa,EAAc,EAAa,KAAM,GAEpD,GAAI,CAAC,EACH,MAAU,MAAM,kDAGlB,GAAM,CAAE,MAAO,EAEf,MAAO,CACL,KACA,UACA,aACA,KAAM,EAAa,KACnB,WAAY,GAAG,EAAG,YAClB,kBAAmB,GAAG,EAAG,wBACzB,cAAe,GAAG,EAAG,oBACrB,GAAG,IAQD,EAAkB,EAAoC,IAE5D,SAAS,EAAS,CAAE,YAAW,GAAG,GAAsC,CACtE,IAAM,EAAK,IAEX,OACE,EAAC,EAAgB,SAAA,CAAS,MAAO,CAAE,eACjC,EAAC,MAAA,CAAI,YAAU,YAAY,UAAW,EAAG,aAAc,GAAY,GAAI,MAK7E,SAAS,EAAU,CAAE,YAAW,GAAG,GAA2D,CAC5F,GAAM,CAAE,cAAe,IACvB,OAAO,EAACA,EAAAA,CAAM,YAAU,aAAa,UAAW,EAAG,UAAW,GAAY,QAAS,EAAY,GAAI,IAGrG,SAAS,EAAY,CAAE,GAAG,GAA0D,CAClF,GAAM,CAAE,QAAO,aAAY,oBAAmB,iBAAkB,IAEhE,OACE,EAACC,EAAc,KAAA,CACb,YAAU,eACV,GAAI,EACJ,mBAAmB,EAAiC,GAAG,EAAkB,GAAG,IAAjD,GAAG,IAC9B,eAAc,CAAC,CAAC,EAChB,GAAI,IAKV,SAAS,EAAgB,CAAE,YAAW,GAAG,GAAoC,CAC3E,GAAM,CAAE,qBAAsB,IAE9B,OAAO,EAAC,IAAA,CAAE,YAAU,mBAAmB,GAAI,EAAmB,UAAW,EAAG,kCAAmC,GAAY,GAAI,IAGjI,SAAS,EAAY,CAAE,YAAW,WAAU,GAAG,GAAoC,CACjF,GAAM,CAAE,QAAO,iBAAkB,IAEjC,OACE,EAAC,OAAA,CAAK,YAAU,eAAe,GAAI,EAAe,UAAW,EAAG,sBAAuB,GAAY,GAAI,WACpG,EAAQ,OAAO,GAAO,SAAW,IAAM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`./chunk-CUT6urMc.cjs`),t=require(`./label-
|
|
2
|
-
//# sourceMappingURL=form-
|
|
1
|
+
const e=require(`./chunk-CUT6urMc.cjs`),t=require(`./label-BZqk7MPJ.cjs`),n=e.__toESM(require(`@customafk/react-toolkit/utils`)),r=e.__toESM(require(`radix-ui`)),i=e.__toESM(require(`react/jsx-runtime`)),a=e.__toESM(require(`react`)),o=e.__toESM(require(`react-hook-form`)),s=o.FormProvider,c=(0,a.createContext)({}),l=({...e})=>(0,i.jsx)(c.Provider,{value:{name:e.name},children:(0,i.jsx)(o.Controller,{...e})}),u=()=>{let e=(0,a.useContext)(c),t=(0,a.useContext)(d),{getFieldState:n,control:r,resetField:i}=(0,o.useFormContext)(),s=(0,o.useFormState)({name:e.name}),l=n(e.name,s);if(!e)throw Error(`useFormField should be used within <FormField>`);let{id:u}=t;return{id:u,control:r,resetField:i,name:e.name,formItemId:`${u}-form-item`,formDescriptionId:`${u}-form-item-description`,formMessageId:`${u}-form-item-message`,...l}},d=(0,a.createContext)({});function f({className:e,...t}){let r=(0,a.useId)();return(0,i.jsx)(d.Provider,{value:{id:r},children:(0,i.jsx)(`div`,{"data-slot":`form-item`,className:(0,n.cn)(`grid gap-1`,e),...t})})}function p({className:e,...r}){let{formItemId:a}=u();return(0,i.jsx)(t.Label,{"data-slot":`form-label`,className:(0,n.cn)(`text-xs`,e),htmlFor:a,...r})}function m({...e}){let{error:t,formItemId:n,formDescriptionId:a,formMessageId:o}=u();return(0,i.jsx)(r.Slot.Slot,{"data-slot":`form-control`,id:n,"aria-describedby":t?`${a} ${o}`:`${a}`,"aria-invalid":!!t,...e})}function h({className:e,...t}){let{formDescriptionId:r}=u();return(0,i.jsx)(`p`,{"data-slot":`form-description`,id:r,className:(0,n.cn)(`text-text-positive-weak text-sm`,e),...t})}function g({className:e,children:t,...r}){let{error:a,formMessageId:o}=u();return(0,i.jsx)(`span`,{"data-slot":`form-message`,id:o,className:(0,n.cn)(`text-danger text-xs`,e),...r,children:a?String(a?.message??``):t})}Object.defineProperty(exports,`Form`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`FormControl`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`FormDescription`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`FormField`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`FormItem`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`FormLabel`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`FormMessage`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`useFormField`,{enumerable:!0,get:function(){return u}});
|
|
2
|
+
//# sourceMappingURL=form-CtpHZKmh.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-
|
|
1
|
+
{"version":3,"file":"form-CtpHZKmh.cjs","names":["FormProvider","Controller","Label","SlotPrimitive"],"sources":["../packages/components/ui/form.tsx"],"sourcesContent":["'use client'\nimport { createContext, useContext, useId } from 'react'\nimport { Controller, type ControllerProps, type FieldPath, type FieldValues, FormProvider, useFormContext, useFormState } from 'react-hook-form'\nimport { cn } from '@customafk/react-toolkit/utils'\n\nimport { Label } from '@/components/ui/label'\n\nimport { Label as LabelPrimitive, Slot as SlotPrimitive } from 'radix-ui'\n\nconst Form = FormProvider\n\ntype FormFieldContextValue<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {\n name: TName\n}\n\nconst FormFieldContext = createContext<FormFieldContextValue>({} as FormFieldContextValue)\n\nconst FormField = <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n )\n}\n\nconst useFormField = () => {\n const fieldContext = useContext(FormFieldContext)\n const itemContext = useContext(FormItemContext)\n const { getFieldState, control, resetField } = useFormContext()\n const formState = useFormState({ name: fieldContext.name })\n const fieldState = getFieldState(fieldContext.name, formState)\n\n if (!fieldContext) {\n throw new Error('useFormField should be used within <FormField>')\n }\n\n const { id } = itemContext\n\n return {\n id,\n control,\n resetField,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n }\n}\n\ntype FormItemContextValue = {\n id: string\n}\n\nconst FormItemContext = createContext<FormItemContextValue>({} as FormItemContextValue)\n\nfunction FormItem({ className, ...props }: React.ComponentProps<'div'>) {\n const id = useId()\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div data-slot=\"form-item\" className={cn('grid gap-1', className)} {...props} />\n </FormItemContext.Provider>\n )\n}\n\nfunction FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {\n const { formItemId } = useFormField()\n return <Label data-slot=\"form-label\" className={cn('text-xs', className)} htmlFor={formItemId} {...props} />\n}\n\nfunction FormControl({ ...props }: React.ComponentProps<typeof SlotPrimitive.Slot>) {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField()\n\n return (\n <SlotPrimitive.Slot\n data-slot=\"form-control\"\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n )\n}\n\nfunction FormDescription({ className, ...props }: React.ComponentProps<'p'>) {\n const { formDescriptionId } = useFormField()\n\n return <p data-slot=\"form-description\" id={formDescriptionId} className={cn('text-text-positive-weak text-sm', className)} {...props} />\n}\n\nfunction FormMessage({ className, children, ...props }: React.ComponentProps<'p'>) {\n const { error, formMessageId } = useFormField()\n\n return (\n <span data-slot=\"form-message\" id={formMessageId} className={cn('text-danger text-xs', className)} {...props}>\n {error ? String(error?.message ?? '') : children}\n </span>\n )\n}\n\n// eslint-disable-next-line react-refresh/only-export-components\nexport { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField }\n"],"mappings":"kRASM,EAAOA,EAAAA,aAMP,GAAA,EAAA,EAAA,eAAwD,IAExD,GAA8H,CAClI,GAAG,MAGD,EAAA,EAAA,KAAC,EAAiB,SAAA,CAAS,MAAO,CAAE,KAAM,EAAM,gBAC9C,EAAA,EAAA,KAACC,EAAAA,WAAAA,CAAW,GAAI,MAKhB,MAAqB,CACzB,IAAM,GAAA,EAAA,EAAA,YAA0B,GAC1B,GAAA,EAAA,EAAA,YAAyB,GACzB,CAAE,gBAAe,UAAS,eAAA,EAAA,EAAA,kBAC1B,GAAA,EAAA,EAAA,cAAyB,CAAE,KAAM,EAAa,OAC9C,EAAa,EAAc,EAAa,KAAM,GAEpD,GAAI,CAAC,EACH,MAAU,MAAM,kDAGlB,GAAM,CAAE,MAAO,EAEf,MAAO,CACL,KACA,UACA,aACA,KAAM,EAAa,KACnB,WAAY,GAAG,EAAG,YAClB,kBAAmB,GAAG,EAAG,wBACzB,cAAe,GAAG,EAAG,oBACrB,GAAG,IAQD,GAAA,EAAA,EAAA,eAAsD,IAE5D,SAAS,EAAS,CAAE,YAAW,GAAG,GAAsC,CACtE,IAAM,GAAA,EAAA,EAAA,SAEN,OACE,EAAA,EAAA,KAAC,EAAgB,SAAA,CAAS,MAAO,CAAE,gBACjC,EAAA,EAAA,KAAC,MAAA,CAAI,YAAU,YAAY,WAAA,EAAA,EAAA,IAAc,aAAc,GAAY,GAAI,MAK7E,SAAS,EAAU,CAAE,YAAW,GAAG,GAA2D,CAC5F,GAAM,CAAE,cAAe,IACvB,OAAO,EAAA,EAAA,KAACC,EAAAA,MAAAA,CAAM,YAAU,aAAa,WAAA,EAAA,EAAA,IAAc,UAAW,GAAY,QAAS,EAAY,GAAI,IAGrG,SAAS,EAAY,CAAE,GAAG,GAA0D,CAClF,GAAM,CAAE,QAAO,aAAY,oBAAmB,iBAAkB,IAEhE,OACE,EAAA,EAAA,KAACC,EAAAA,KAAc,KAAA,CACb,YAAU,eACV,GAAI,EACJ,mBAAmB,EAAiC,GAAG,EAAkB,GAAG,IAAjD,GAAG,IAC9B,eAAc,CAAC,CAAC,EAChB,GAAI,IAKV,SAAS,EAAgB,CAAE,YAAW,GAAG,GAAoC,CAC3E,GAAM,CAAE,qBAAsB,IAE9B,OAAO,EAAA,EAAA,KAAC,IAAA,CAAE,YAAU,mBAAmB,GAAI,EAAmB,WAAA,EAAA,EAAA,IAAc,kCAAmC,GAAY,GAAI,IAGjI,SAAS,EAAY,CAAE,YAAW,WAAU,GAAG,GAAoC,CACjF,GAAM,CAAE,QAAO,iBAAkB,IAEjC,OACE,EAAA,EAAA,KAAC,OAAA,CAAK,YAAU,eAAe,GAAI,EAAe,WAAA,EAAA,EAAA,IAAc,sBAAuB,GAAY,GAAI,WACpG,EAAQ,OAAO,GAAO,SAAW,IAAM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`./chunk-CUT6urMc.cjs`),t=require(`./error-dialog-
|
|
2
|
-
//# sourceMappingURL=form-wrapper-
|
|
1
|
+
const e=require(`./chunk-CUT6urMc.cjs`),t=require(`./error-dialog-DGg0x5xF.cjs`),n=require(`./form-CtpHZKmh.cjs`),r=e.__toESM(require(`lucide-react`)),i=e.__toESM(require(`react/jsx-runtime`)),a=e.__toESM(require(`react`)),o=e.__toESM(require(`react-hook-form`)),s=e.__toESM(require(`@hookform/error-message`)),c=({form:e,isResetAfterSubmit:c=!0,className:l,onSubmit:u,onError:d,onSubcribe:f,children:p})=>{let m=(0,o.useForm)({...e,criteriaMode:`all`}),{formState:h,reset:g,handleSubmit:_,subscribe:v}=m,{dirtyFields:y}=h,[b,x]=(0,a.useState)(!1),S=(0,a.useCallback)(e=>{u(e,h,y),c&&g()},[y,h,c,u,g]),C=(0,a.useCallback)(e=>{let t=Object.keys(e);t.length!==0&&(d?.(e),x(!0))},[d]);return(0,a.useEffect)(()=>{if(!f)return;let e=v({formState:{values:!0},callback:({values:e})=>{f(e)}});return()=>e()},[f,v]),(0,i.jsxs)(n.Form,{...m,children:[(0,i.jsx)(`form`,{className:l,onSubmit:_(S,C),children:p}),(0,i.jsx)(t.ErrorDialog,{open:b,title:`Lỗi nhập dữ liệu`,description:`An unexpected error has occurred. Please check the errors below and try again.`,onOpenChange:x,children:b&&(0,i.jsx)(i.Fragment,{children:Object.keys(h.errors).length>0?(0,i.jsxs)(`div`,{className:`flex max-w-100 flex-col gap-2 px-4`,children:[(0,i.jsx)(`p`,{className:`text-muted-foreground text-sm font-semibold`,children:`Cảnh báo: Vui lòng kiểm tra các lỗi sau:`}),(0,i.jsx)(`div`,{className:`flex flex-col space-y-1`,children:Object.entries(h.errors).map(([e])=>(0,i.jsx)(s.ErrorMessage,{errors:h.errors,name:e,render:({messages:e})=>(0,i.jsx)(i.Fragment,{children:e?Object.entries(e).map(([e,t])=>(0,i.jsxs)(`div`,{className:`text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal`,children:[(0,i.jsx)(r.AlertCircleIcon,{size:16,className:`text-destructive mt-0.5 min-w-4 flex-0`}),(0,i.jsx)(`p`,{className:`line-clamp-2 flex-1 text-wrap`,children:t})]},e)):null})},e))})]}):(0,i.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No errors found.`})})})]})};Object.defineProperty(exports,`FormWrapper`,{enumerable:!0,get:function(){return c}});
|
|
2
|
+
//# sourceMappingURL=form-wrapper-C3pU1F5r.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-wrapper-
|
|
1
|
+
{"version":3,"file":"form-wrapper-C3pU1F5r.cjs","names":["Form","ErrorDialog","ErrorMessage","AlertCircleIcon"],"sources":["../packages/components/forms/form-wrapper.tsx"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react'\nimport { type FieldValues, type FormState, type SubmitErrorHandler, type SubmitHandler, useForm, type UseFormProps } from 'react-hook-form'\n\nimport { AlertCircleIcon } from 'lucide-react'\n\nimport type { AnyEntity } from '@/types'\nimport { ErrorMessage } from '@hookform/error-message'\n\nimport { ErrorDialog } from '../dialogs/error-dialog'\nimport { Form } from '../ui/form'\n\ntype Props<TFieldValues extends FieldValues = FieldValues> = {\n form: UseFormProps<TFieldValues>\n isResetAfterSubmit?: boolean\n className?: string\n onSubmit: (data: TFieldValues, formState: FormState<FieldValues>, dirtyFields: FormState<FieldValues>['dirtyFields']) => void | Promise<void>\n onError?: SubmitErrorHandler<TFieldValues>\n onSubcribe?: (values: TFieldValues) => void\n}\n\nexport const FormWrapper = <TFieldValues extends FieldValues = FieldValues>({\n form: FormConfig,\n isResetAfterSubmit = true,\n className,\n onSubmit,\n onError,\n onSubcribe,\n children,\n}: React.PropsWithChildren<Props<TFieldValues>>) => {\n const form = useForm({\n ...FormConfig,\n criteriaMode: 'all',\n })\n\n const { formState, reset, handleSubmit, subscribe } = form\n const { dirtyFields } = formState\n\n const [errorOpen, setErrorOpen] = useState<boolean>(false)\n\n const handleFormSubmit = useCallback<SubmitHandler<TFieldValues>>(\n (data) => {\n onSubmit(data, formState, dirtyFields)\n if (isResetAfterSubmit) {\n reset()\n }\n },\n [dirtyFields, formState, isResetAfterSubmit, onSubmit, reset],\n )\n\n const handleFormError = useCallback<SubmitErrorHandler<TFieldValues>>(\n (errors) => {\n const errorKeys = Object.keys(errors)\n if (errorKeys.length === 0) return\n onError?.(errors)\n setErrorOpen(true)\n },\n [onError],\n )\n\n useEffect(() => {\n if (!onSubcribe) return\n const callback = subscribe({\n formState: { values: true },\n callback: ({ values }) => {\n onSubcribe(values)\n },\n })\n return () => callback()\n }, [onSubcribe, subscribe])\n\n return (\n <Form {...form}>\n <form className={className} onSubmit={handleSubmit(handleFormSubmit, handleFormError)}>\n {children}\n </form>\n <ErrorDialog\n open={errorOpen}\n title=\"Lỗi nhập dữ liệu\"\n description=\"An unexpected error has occurred. Please check the errors below and try again.\"\n onOpenChange={setErrorOpen}\n >\n {errorOpen && (\n <>\n {Object.keys(formState.errors).length > 0 ? (\n <div className=\"flex max-w-100 flex-col gap-2 px-4\">\n <p className=\"text-muted-foreground text-sm font-semibold\">Cảnh báo: Vui lòng kiểm tra các lỗi sau:</p>\n <div className=\"flex flex-col space-y-1\">\n {Object.entries(formState.errors).map(([key]) => (\n <ErrorMessage\n key={key}\n errors={formState.errors}\n name={key as AnyEntity}\n render={({ messages }) => {\n return (\n <>\n {messages\n ? Object.entries(messages).map(([type, message]) => {\n return (\n <div key={type} className=\"text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal\">\n <AlertCircleIcon size={16} className=\"text-destructive mt-0.5 min-w-4 flex-0\" />\n <p className=\"line-clamp-2 flex-1 text-wrap\">{message}</p>\n </div>\n )\n })\n : null}\n </>\n )\n }}\n />\n ))}\n </div>\n </div>\n ) : (\n <p className=\"text-muted-foreground text-sm\">No errors found.</p>\n )}\n </>\n )}\n </ErrorDialog>\n </Form>\n )\n}\n"],"mappings":"uTAoBa,GAA+D,CAC1E,KAAM,EACN,qBAAqB,GACrB,YACA,WACA,UACA,aACA,cACkD,CAClD,IAAM,GAAA,EAAA,EAAA,SAAe,CACnB,GAAG,EACH,aAAc,QAGV,CAAE,YAAW,QAAO,eAAc,aAAc,EAChD,CAAE,eAAgB,EAElB,CAAC,EAAW,IAAA,EAAA,EAAA,UAAkC,IAE9C,GAAA,EAAA,EAAA,aACH,GAAS,CACR,EAAS,EAAM,EAAW,GACtB,GACF,KAGJ,CAAC,EAAa,EAAW,EAAoB,EAAU,IAGnD,GAAA,EAAA,EAAA,aACH,GAAW,CACV,IAAM,EAAY,OAAO,KAAK,GAC1B,EAAU,SAAW,IACzB,IAAU,GACV,EAAa,MAEf,CAAC,IAcH,OAXA,EAAA,EAAA,eAAgB,CACd,GAAI,CAAC,EAAY,OACjB,IAAM,EAAW,EAAU,CACzB,UAAW,CAAE,OAAQ,IACrB,UAAW,CAAE,YAAa,CACxB,EAAW,MAGf,UAAa,KACZ,CAAC,EAAY,KAGd,EAAA,EAAA,MAACA,EAAAA,KAAAA,CAAK,GAAI,aACR,EAAA,EAAA,KAAC,OAAA,CAAgB,YAAW,SAAU,EAAa,EAAkB,GAClE,cAEH,EAAA,EAAA,KAACC,EAAAA,YAAAA,CACC,KAAM,EACN,MAAM,mBACN,YAAY,iFACZ,aAAc,WAEb,IACC,EAAA,EAAA,KAAA,EAAA,SAAA,CAAA,SACG,OAAO,KAAK,EAAU,QAAQ,OAAS,GACtC,EAAA,EAAA,MAAC,MAAA,CAAI,UAAU,gDACb,EAAA,EAAA,KAAC,IAAA,CAAE,UAAU,uDAA8C,8CAC3D,EAAA,EAAA,KAAC,MAAA,CAAI,UAAU,mCACZ,OAAO,QAAQ,EAAU,QAAQ,KAAK,CAAC,MACtC,EAAA,EAAA,KAACC,EAAAA,aAAAA,CAEC,OAAQ,EAAU,OAClB,KAAM,EACN,QAAS,CAAE,eAEP,EAAA,EAAA,KAAA,EAAA,SAAA,CAAA,SACG,EACG,OAAO,QAAQ,GAAU,KAAK,CAAC,EAAM,MAEjC,EAAA,EAAA,MAAC,MAAA,CAAe,UAAU,0FACxB,EAAA,EAAA,KAACC,EAAAA,gBAAAA,CAAgB,KAAM,GAAI,UAAU,4CACrC,EAAA,EAAA,KAAC,IAAA,CAAE,UAAU,yCAAiC,MAFtC,IAMd,QAfL,UAwBb,EAAA,EAAA,KAAC,IAAA,CAAE,UAAU,yCAAgC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ErrorDialog as e}from"./error-dialog-
|
|
2
|
-
//# sourceMappingURL=form-wrapper-
|
|
1
|
+
import{ErrorDialog as e}from"./error-dialog-CphiTB4y.js";import{Form as t}from"./form-B-KLKj5u.js";import{AlertCircleIcon as n}from"lucide-react";import{Fragment as r,jsx as i,jsxs as a}from"react/jsx-runtime";import{useCallback as o,useEffect as s,useState as c}from"react";import{useForm as l}from"react-hook-form";import{ErrorMessage as u}from"@hookform/error-message";const d=({form:d,isResetAfterSubmit:f=!0,className:p,onSubmit:m,onError:h,onSubcribe:g,children:_})=>{let v=l({...d,criteriaMode:`all`}),{formState:y,reset:b,handleSubmit:x,subscribe:S}=v,{dirtyFields:C}=y,[w,T]=c(!1),E=o(e=>{m(e,y,C),f&&b()},[C,y,f,m,b]),D=o(e=>{let t=Object.keys(e);t.length!==0&&(h?.(e),T(!0))},[h]);return s(()=>{if(!g)return;let e=S({formState:{values:!0},callback:({values:e})=>{g(e)}});return()=>e()},[g,S]),a(t,{...v,children:[i(`form`,{className:p,onSubmit:x(E,D),children:_}),i(e,{open:w,title:`Lỗi nhập dữ liệu`,description:`An unexpected error has occurred. Please check the errors below and try again.`,onOpenChange:T,children:w&&i(r,{children:Object.keys(y.errors).length>0?a(`div`,{className:`flex max-w-100 flex-col gap-2 px-4`,children:[i(`p`,{className:`text-muted-foreground text-sm font-semibold`,children:`Cảnh báo: Vui lòng kiểm tra các lỗi sau:`}),i(`div`,{className:`flex flex-col space-y-1`,children:Object.entries(y.errors).map(([e])=>i(u,{errors:y.errors,name:e,render:({messages:e})=>i(r,{children:e?Object.entries(e).map(([e,t])=>a(`div`,{className:`text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal`,children:[i(n,{size:16,className:`text-destructive mt-0.5 min-w-4 flex-0`}),i(`p`,{className:`line-clamp-2 flex-1 text-wrap`,children:t})]},e)):null})},e))})]}):i(`p`,{className:`text-muted-foreground text-sm`,children:`No errors found.`})})})]})};export{d as FormWrapper};
|
|
2
|
+
//# sourceMappingURL=form-wrapper-Deo8gKv5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-wrapper-
|
|
1
|
+
{"version":3,"file":"form-wrapper-Deo8gKv5.js","names":[],"sources":["../packages/components/forms/form-wrapper.tsx"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react'\nimport { type FieldValues, type FormState, type SubmitErrorHandler, type SubmitHandler, useForm, type UseFormProps } from 'react-hook-form'\n\nimport { AlertCircleIcon } from 'lucide-react'\n\nimport type { AnyEntity } from '@/types'\nimport { ErrorMessage } from '@hookform/error-message'\n\nimport { ErrorDialog } from '../dialogs/error-dialog'\nimport { Form } from '../ui/form'\n\ntype Props<TFieldValues extends FieldValues = FieldValues> = {\n form: UseFormProps<TFieldValues>\n isResetAfterSubmit?: boolean\n className?: string\n onSubmit: (data: TFieldValues, formState: FormState<FieldValues>, dirtyFields: FormState<FieldValues>['dirtyFields']) => void | Promise<void>\n onError?: SubmitErrorHandler<TFieldValues>\n onSubcribe?: (values: TFieldValues) => void\n}\n\nexport const FormWrapper = <TFieldValues extends FieldValues = FieldValues>({\n form: FormConfig,\n isResetAfterSubmit = true,\n className,\n onSubmit,\n onError,\n onSubcribe,\n children,\n}: React.PropsWithChildren<Props<TFieldValues>>) => {\n const form = useForm({\n ...FormConfig,\n criteriaMode: 'all',\n })\n\n const { formState, reset, handleSubmit, subscribe } = form\n const { dirtyFields } = formState\n\n const [errorOpen, setErrorOpen] = useState<boolean>(false)\n\n const handleFormSubmit = useCallback<SubmitHandler<TFieldValues>>(\n (data) => {\n onSubmit(data, formState, dirtyFields)\n if (isResetAfterSubmit) {\n reset()\n }\n },\n [dirtyFields, formState, isResetAfterSubmit, onSubmit, reset],\n )\n\n const handleFormError = useCallback<SubmitErrorHandler<TFieldValues>>(\n (errors) => {\n const errorKeys = Object.keys(errors)\n if (errorKeys.length === 0) return\n onError?.(errors)\n setErrorOpen(true)\n },\n [onError],\n )\n\n useEffect(() => {\n if (!onSubcribe) return\n const callback = subscribe({\n formState: { values: true },\n callback: ({ values }) => {\n onSubcribe(values)\n },\n })\n return () => callback()\n }, [onSubcribe, subscribe])\n\n return (\n <Form {...form}>\n <form className={className} onSubmit={handleSubmit(handleFormSubmit, handleFormError)}>\n {children}\n </form>\n <ErrorDialog\n open={errorOpen}\n title=\"Lỗi nhập dữ liệu\"\n description=\"An unexpected error has occurred. Please check the errors below and try again.\"\n onOpenChange={setErrorOpen}\n >\n {errorOpen && (\n <>\n {Object.keys(formState.errors).length > 0 ? (\n <div className=\"flex max-w-100 flex-col gap-2 px-4\">\n <p className=\"text-muted-foreground text-sm font-semibold\">Cảnh báo: Vui lòng kiểm tra các lỗi sau:</p>\n <div className=\"flex flex-col space-y-1\">\n {Object.entries(formState.errors).map(([key]) => (\n <ErrorMessage\n key={key}\n errors={formState.errors}\n name={key as AnyEntity}\n render={({ messages }) => {\n return (\n <>\n {messages\n ? Object.entries(messages).map(([type, message]) => {\n return (\n <div key={type} className=\"text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal\">\n <AlertCircleIcon size={16} className=\"text-destructive mt-0.5 min-w-4 flex-0\" />\n <p className=\"line-clamp-2 flex-1 text-wrap\">{message}</p>\n </div>\n )\n })\n : null}\n </>\n )\n }}\n />\n ))}\n </div>\n </div>\n ) : (\n <p className=\"text-muted-foreground text-sm\">No errors found.</p>\n )}\n </>\n )}\n </ErrorDialog>\n </Form>\n )\n}\n"],"mappings":"oXAoBA,MAAa,GAA+D,CAC1E,KAAM,EACN,qBAAqB,GACrB,YACA,WACA,UACA,aACA,cACkD,CAClD,IAAM,EAAO,EAAQ,CACnB,GAAG,EACH,aAAc,QAGV,CAAE,YAAW,QAAO,eAAc,aAAc,EAChD,CAAE,eAAgB,EAElB,CAAC,EAAW,GAAgB,EAAkB,IAE9C,EAAmB,EACtB,GAAS,CACR,EAAS,EAAM,EAAW,GACtB,GACF,KAGJ,CAAC,EAAa,EAAW,EAAoB,EAAU,IAGnD,EAAkB,EACrB,GAAW,CACV,IAAM,EAAY,OAAO,KAAK,GAC1B,EAAU,SAAW,IACzB,IAAU,GACV,EAAa,MAEf,CAAC,IAcH,OAXA,MAAgB,CACd,GAAI,CAAC,EAAY,OACjB,IAAM,EAAW,EAAU,CACzB,UAAW,CAAE,OAAQ,IACrB,UAAW,CAAE,YAAa,CACxB,EAAW,MAGf,UAAa,KACZ,CAAC,EAAY,IAGd,EAAC,EAAA,CAAK,GAAI,YACR,EAAC,OAAA,CAAgB,YAAW,SAAU,EAAa,EAAkB,GAClE,aAEH,EAAC,EAAA,CACC,KAAM,EACN,MAAM,mBACN,YAAY,iFACZ,aAAc,WAEb,GACC,EAAA,EAAA,CAAA,SACG,OAAO,KAAK,EAAU,QAAQ,OAAS,EACtC,EAAC,MAAA,CAAI,UAAU,+CACb,EAAC,IAAA,CAAE,UAAU,uDAA8C,6CAC3D,EAAC,MAAA,CAAI,UAAU,mCACZ,OAAO,QAAQ,EAAU,QAAQ,KAAK,CAAC,KACtC,EAAC,EAAA,CAEC,OAAQ,EAAU,OAClB,KAAM,EACN,QAAS,CAAE,cAEP,EAAA,EAAA,CAAA,SACG,EACG,OAAO,QAAQ,GAAU,KAAK,CAAC,EAAM,KAEjC,EAAC,MAAA,CAAe,UAAU,yFACxB,EAAC,EAAA,CAAgB,KAAM,GAAI,UAAU,2CACrC,EAAC,IAAA,CAAE,UAAU,yCAAiC,MAFtC,IAMd,QAfL,SAwBb,EAAC,IAAA,CAAE,UAAU,yCAAgC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require(`../chunk-CUT6urMc.cjs`),t=require(`../button-119IIVCy.cjs`);require(`../label-
|
|
1
|
+
"use client";const e=require(`../chunk-CUT6urMc.cjs`),t=require(`../button-119IIVCy.cjs`);require(`../label-BZqk7MPJ.cjs`);const n=require(`../form-CtpHZKmh.cjs`);require(`../dialog-wX27mb8E.cjs`);const r=require(`../command-BNYekOzL.cjs`),i=require(`../popover-Bi7GLJT5.cjs`),a=e.__toESM(require(`lucide-react`)),o=e.__toESM(require(`@customafk/react-toolkit/utils`)),s=e.__toESM(require(`react/jsx-runtime`)),c=({name:e,label:c=`Combobox`,placeholder:l=`Chọn một mục`,description:u,options:d,onAddNewItem:f})=>(0,s.jsx)(n.FormField,{name:e,render:({field:e})=>(0,s.jsxs)(n.FormItem,{className:`w-full`,children:[(0,s.jsx)(n.FormLabel,{children:c}),(0,s.jsxs)(i.Popover,{modal:!0,children:[(0,s.jsx)(i.PopoverTrigger,{asChild:!0,children:(0,s.jsx)(n.FormControl,{children:(0,s.jsxs)(t.Button,{type:`button`,variant:`outline`,role:`combobox`,color:`muted`,className:(0,o.cn)(`shadow-input flex justify-between rounded-md px-3`,`outline-border-weak font-normal`,`[&_div]:w-full`,`[&_div]:justify-between`,`hover:outline-border`,`data-[state=open]:text-text-positive-muted`,`data-[state=open]:outline-1`,`data-[state=open]:outline-primary-strong`,`data-[state=open]:ring-primary-weak`,`data-[state=open]:ring-4`,`focus:border-primary-strong`,`focus:ring-4`,`focus:ring-primary-weak`,`focus:outline-1`,`focus:outline-primary-strong`),children:[e.value?(0,s.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`,children:d?.find(({value:t})=>t===e.value)?.label}):(0,s.jsx)(`span`,{className:`text-text-positive-muted`,children:l}),(0,s.jsx)(a.ChevronDownIcon,{size:16,className:`text-text-positive-weak shrink-0`,"aria-hidden":`true`})]})})}),(0,s.jsx)(i.PopoverContent,{className:`w-[var(--radix-popover-trigger-width)] p-0`,children:(0,s.jsxs)(r.Command,{className:`border-none`,children:[(0,s.jsx)(r.CommandInput,{placeholder:l??`Tìm kiếm`}),(0,s.jsxs)(r.CommandList,{children:[(0,s.jsx)(r.CommandGroup,{className:`max-h-40 overflow-y-auto`,children:d?.map(({value:t,label:n})=>(0,s.jsx)(r.CommandItem,{value:n,onSelect:()=>e.onChange(t),children:n},t))}),f&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.CommandSeparator,{}),(0,s.jsx)(r.CommandGroup,{children:(0,s.jsxs)(t.Button,{type:`button`,variant:`ghost`,className:`w-full justify-start font-normal`,children:[(0,s.jsx)(a.PlusIcon,{size:14,className:`-ms-2 opacity-60`,"aria-hidden":`true`}),`Thêm mới`]})})]})]}),(0,s.jsx)(r.CommandEmpty,{children:`Không có kết quả`})]})})]}),!!u&&(0,s.jsx)(n.FormDescription,{children:u})]})});exports.ComboboxField=c;
|
|
2
2
|
//# sourceMappingURL=combobox-field.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime31 from "react/jsx-runtime";
|
|
2
2
|
import { FieldPath, FieldValues } from "react-hook-form";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/forms/combobox-field.d.ts
|
|
@@ -22,7 +22,7 @@ declare const ComboboxField: <TFieldValues extends FieldValues = FieldValues>({
|
|
|
22
22
|
description,
|
|
23
23
|
options,
|
|
24
24
|
onAddNewItem
|
|
25
|
-
}: Props<TFieldValues>) =>
|
|
25
|
+
}: Props<TFieldValues>) => react_jsx_runtime31.JSX.Element;
|
|
26
26
|
//#endregion
|
|
27
27
|
export { ComboboxField };
|
|
28
28
|
//# sourceMappingURL=combobox-field.d.cts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime7 from "react/jsx-runtime";
|
|
2
2
|
import { FieldPath, FieldValues } from "react-hook-form";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/forms/combobox-field.d.ts
|
|
@@ -22,7 +22,7 @@ declare const ComboboxField: <TFieldValues extends FieldValues = FieldValues>({
|
|
|
22
22
|
description,
|
|
23
23
|
options,
|
|
24
24
|
onAddNewItem
|
|
25
|
-
}: Props<TFieldValues>) =>
|
|
25
|
+
}: Props<TFieldValues>) => react_jsx_runtime7.JSX.Element;
|
|
26
26
|
//#endregion
|
|
27
27
|
export { ComboboxField };
|
|
28
28
|
//# sourceMappingURL=combobox-field.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{Button as e}from"../button-CvQQTSka.js";import"../label-
|
|
1
|
+
"use client";import{Button as e}from"../button-CvQQTSka.js";import"../label-HVpeECNr.js";import{FormControl as t,FormDescription as n,FormField as r,FormItem as i,FormLabel as a}from"../form-B-KLKj5u.js";import"../dialog-pMHkBJ-w.js";import{Command as o,CommandEmpty as s,CommandGroup as c,CommandInput as l,CommandItem as u,CommandList as d,CommandSeparator as f}from"../command-CyWyRcle.js";import{Popover as p,PopoverContent as m,PopoverTrigger as h}from"../popover-CxOK3oy2.js";import{ChevronDownIcon as g,PlusIcon as _}from"lucide-react";import{cn as v}from"@customafk/react-toolkit/utils";import{Fragment as y,jsx as b,jsxs as x}from"react/jsx-runtime";const S=({name:S,label:C=`Combobox`,placeholder:w=`Chọn một mục`,description:T,options:E,onAddNewItem:D})=>b(r,{name:S,render:({field:r})=>x(i,{className:`w-full`,children:[b(a,{children:C}),x(p,{modal:!0,children:[b(h,{asChild:!0,children:b(t,{children:x(e,{type:`button`,variant:`outline`,role:`combobox`,color:`muted`,className:v(`shadow-input flex justify-between rounded-md px-3`,`outline-border-weak font-normal`,`[&_div]:w-full`,`[&_div]:justify-between`,`hover:outline-border`,`data-[state=open]:text-text-positive-muted`,`data-[state=open]:outline-1`,`data-[state=open]:outline-primary-strong`,`data-[state=open]:ring-primary-weak`,`data-[state=open]:ring-4`,`focus:border-primary-strong`,`focus:ring-4`,`focus:ring-primary-weak`,`focus:outline-1`,`focus:outline-primary-strong`),children:[r.value?b(`span`,{className:`flex min-w-0 items-center gap-2`,children:E?.find(({value:e})=>e===r.value)?.label}):b(`span`,{className:`text-text-positive-muted`,children:w}),b(g,{size:16,className:`text-text-positive-weak shrink-0`,"aria-hidden":`true`})]})})}),b(m,{className:`w-[var(--radix-popover-trigger-width)] p-0`,children:x(o,{className:`border-none`,children:[b(l,{placeholder:w??`Tìm kiếm`}),x(d,{children:[b(c,{className:`max-h-40 overflow-y-auto`,children:E?.map(({value:e,label:t})=>b(u,{value:t,onSelect:()=>r.onChange(e),children:t},e))}),D&&x(y,{children:[b(f,{}),b(c,{children:x(e,{type:`button`,variant:`ghost`,className:`w-full justify-start font-normal`,children:[b(_,{size:14,className:`-ms-2 opacity-60`,"aria-hidden":`true`}),`Thêm mới`]})})]})]}),b(s,{children:`Không có kết quả`})]})})]}),!!T&&b(n,{children:T})]})});export{S as ComboboxField};
|
|
2
2
|
//# sourceMappingURL=combobox-field.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require(`../chunk-CUT6urMc.cjs`),t=require(`../button-119IIVCy.cjs`);require(`../label-
|
|
1
|
+
"use client";const e=require(`../chunk-CUT6urMc.cjs`),t=require(`../button-119IIVCy.cjs`);require(`../label-BZqk7MPJ.cjs`);const n=require(`../form-CtpHZKmh.cjs`),r=require(`../popover-Bi7GLJT5.cjs`),i=require(`../calendar-B6F_Lppz.cjs`),a=e.__toESM(require(`lucide-react`)),o=e.__toESM(require(`@customafk/react-toolkit/utils`)),s=e.__toESM(require(`react/jsx-runtime`)),c=e.__toESM(require(`@customafk/react-toolkit/date-fns`)),l=({name:e,label:l=`Date Field`,placeholder:u=`Select a date`,description:d=``,isShowErrorMsg:f=!1})=>(0,s.jsx)(n.FormField,{name:e,render:({field:e})=>(0,s.jsxs)(n.FormItem,{className:`w-full`,children:[(0,s.jsx)(n.FormLabel,{children:l}),(0,s.jsxs)(r.Popover,{modal:!0,children:[(0,s.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,s.jsx)(n.FormControl,{children:(0,s.jsxs)(t.Button,{variant:`outline`,color:`muted`,className:(0,o.cn)(`w-full pl-3 text-left font-normal`,`outline-border-weak font-normal`,`hover:outline-border`,`data-[state=open]:text-text-positive-muted`,`data-[state=open]:outline-1`,`data-[state=open]:outline-primary-strong`,`data-[state=open]:ring-primary-weak`,`data-[state=open]:ring-4`,`focus:border-primary-strong`,`focus:ring-4`,`focus:ring-primary-weak`,`focus:outline-1`,`focus:outline-primary-strong`,!e.value&&`text-text-positive-muted`),children:[e.value?(0,c.format)(e.value,`PPP`):(0,s.jsxs)(`span`,{children:[` `,u||`Pick a date`]}),(0,s.jsx)(a.CalendarIcon,{className:`text-text-positive-weak ml-auto size-4`})]})})}),(0,s.jsx)(r.PopoverContent,{className:`w-auto p-0`,align:`start`,children:(0,s.jsx)(i.Calendar,{mode:`single`,selected:e.value,onSelect:t=>{e.onChange(t?.toISOString())},captionLayout:`dropdown`,disabled:e=>e<new Date(`2022-01-01`)})})]}),!!d&&(0,s.jsx)(n.FormDescription,{children:d}),f&&(0,s.jsx)(n.FormMessage,{})]})});exports.DateField=l;
|
|
2
2
|
//# sourceMappingURL=date-field.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
2
2
|
import { FieldPath, FieldValues } from "react-hook-form";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/forms/date-field.d.ts
|
|
@@ -16,7 +16,7 @@ declare const DateField: <TFieldValues extends FieldValues = FieldValues>({
|
|
|
16
16
|
placeholder,
|
|
17
17
|
description,
|
|
18
18
|
isShowErrorMsg
|
|
19
|
-
}: Props<TFieldValues>) =>
|
|
19
|
+
}: Props<TFieldValues>) => react_jsx_runtime1.JSX.Element;
|
|
20
20
|
//#endregion
|
|
21
21
|
export { DateField };
|
|
22
22
|
//# sourceMappingURL=date-field.d.ts.map
|
package/dist/forms/date-field.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{Button as e}from"../button-CvQQTSka.js";import"../label-
|
|
1
|
+
"use client";import{Button as e}from"../button-CvQQTSka.js";import"../label-HVpeECNr.js";import{FormControl as t,FormDescription as n,FormField as r,FormItem as i,FormLabel as a,FormMessage as o}from"../form-B-KLKj5u.js";import{Popover as s,PopoverContent as c,PopoverTrigger as l}from"../popover-CxOK3oy2.js";import{Calendar as u}from"../calendar-CXddeN7A.js";import{CalendarIcon as d}from"lucide-react";import{cn as f}from"@customafk/react-toolkit/utils";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{format as h}from"@customafk/react-toolkit/date-fns";const g=({name:g,label:_=`Date Field`,placeholder:v=`Select a date`,description:y=``,isShowErrorMsg:b=!1})=>p(r,{name:g,render:({field:r})=>m(i,{className:`w-full`,children:[p(a,{children:_}),m(s,{modal:!0,children:[p(l,{asChild:!0,children:p(t,{children:m(e,{variant:`outline`,color:`muted`,className:f(`w-full pl-3 text-left font-normal`,`outline-border-weak font-normal`,`hover:outline-border`,`data-[state=open]:text-text-positive-muted`,`data-[state=open]:outline-1`,`data-[state=open]:outline-primary-strong`,`data-[state=open]:ring-primary-weak`,`data-[state=open]:ring-4`,`focus:border-primary-strong`,`focus:ring-4`,`focus:ring-primary-weak`,`focus:outline-1`,`focus:outline-primary-strong`,!r.value&&`text-text-positive-muted`),children:[r.value?h(r.value,`PPP`):m(`span`,{children:[` `,v||`Pick a date`]}),p(d,{className:`text-text-positive-weak ml-auto size-4`})]})})}),p(c,{className:`w-auto p-0`,align:`start`,children:p(u,{mode:`single`,selected:r.value,onSelect:e=>{r.onChange(e?.toISOString())},captionLayout:`dropdown`,disabled:e=>e<new Date(`2022-01-01`)})})]}),!!y&&p(n,{children:y}),b&&p(o,{})]})});export{g as DateField};
|
|
2
2
|
//# sourceMappingURL=date-field.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../button-119IIVCy.cjs`),require(`../alert-dialog-
|
|
1
|
+
require(`../button-119IIVCy.cjs`),require(`../alert-dialog-D-4wxqLK.cjs`),require(`../error-dialog-DGg0x5xF.cjs`),require(`../label-BZqk7MPJ.cjs`),require(`../form-CtpHZKmh.cjs`);const e=require(`../form-wrapper-C3pU1F5r.cjs`);exports.FormWrapper=e.FormWrapper;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime4 from "react/jsx-runtime";
|
|
2
2
|
import { FieldValues, FormState, SubmitErrorHandler, UseFormProps } from "react-hook-form";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/forms/form-wrapper.d.ts
|
|
@@ -18,7 +18,7 @@ declare const FormWrapper: <TFieldValues extends FieldValues = FieldValues>({
|
|
|
18
18
|
onError,
|
|
19
19
|
onSubcribe,
|
|
20
20
|
children
|
|
21
|
-
}: React.PropsWithChildren<Props<TFieldValues>>) =>
|
|
21
|
+
}: React.PropsWithChildren<Props<TFieldValues>>) => react_jsx_runtime4.JSX.Element;
|
|
22
22
|
//#endregion
|
|
23
23
|
export { FormWrapper };
|
|
24
24
|
//# sourceMappingURL=form-wrapper.d.cts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
2
2
|
import { FieldValues, FormState, SubmitErrorHandler, UseFormProps } from "react-hook-form";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/forms/form-wrapper.d.ts
|
|
@@ -18,7 +18,7 @@ declare const FormWrapper: <TFieldValues extends FieldValues = FieldValues>({
|
|
|
18
18
|
onError,
|
|
19
19
|
onSubcribe,
|
|
20
20
|
children
|
|
21
|
-
}: React.PropsWithChildren<Props<TFieldValues>>) =>
|
|
21
|
+
}: React.PropsWithChildren<Props<TFieldValues>>) => react_jsx_runtime3.JSX.Element;
|
|
22
22
|
//#endregion
|
|
23
23
|
export { FormWrapper };
|
|
24
24
|
//# sourceMappingURL=form-wrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../button-CvQQTSka.js";import"../alert-dialog-
|
|
1
|
+
import"../button-CvQQTSka.js";import"../alert-dialog-B5dXkMIF.js";import"../error-dialog-CphiTB4y.js";import"../label-HVpeECNr.js";import"../form-B-KLKj5u.js";import{FormWrapper as e}from"../form-wrapper-Deo8gKv5.js";export{e as FormWrapper};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require(`../chunk-CUT6urMc.cjs`);require(`../button-119IIVCy.cjs`),require(`../label-
|
|
1
|
+
"use client";const e=require(`../chunk-CUT6urMc.cjs`);require(`../button-119IIVCy.cjs`),require(`../label-BZqk7MPJ.cjs`);const t=require(`../form-CtpHZKmh.cjs`);require(`../dialog-wX27mb8E.cjs`),require(`../command-BNYekOzL.cjs`);const n=require(`../multi-select-DRKqFg1M.cjs`),r=e.__toESM(require(`react/jsx-runtime`)),i=({name:e,label:i=`Multi Select Field`,isShowLabel:a=!0,isShowErrorMsg:o,placeholder:s=`Select options`,description:c=``,options:l=[],onAdd:u})=>(0,r.jsx)(t.FormField,{name:e,render:({field:{value:e,onChange:d}})=>{let f=l.filter(t=>e?.includes(t.value)),p=e=>{let t=e.map(e=>e.value);d(t)};return(0,r.jsxs)(t.FormItem,{className:`w-full gap-0`,children:[a&&(0,r.jsx)(t.FormLabel,{children:i}),(0,r.jsx)(t.FormControl,{children:(0,r.jsx)(n.MultipleSelector,{placeholder:s,emptyIndicator:`No options available`,value:f,options:l,onChange:p,onAddNewItem:u})}),!!c&&(0,r.jsx)(t.FormDescription,{children:c}),o&&(0,r.jsx)(t.FormMessage,{})]})}});exports.MultiSelectField=i;
|
|
2
2
|
//# sourceMappingURL=multi-select-field.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
2
2
|
import { FieldPath, FieldValues } from "react-hook-form";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/forms/multi-select-field.d.ts
|
|
@@ -24,7 +24,7 @@ declare const MultiSelectField: <TFieldValues extends FieldValues = FieldValues>
|
|
|
24
24
|
description,
|
|
25
25
|
options,
|
|
26
26
|
onAdd
|
|
27
|
-
}: Props<TFieldValues>) =>
|
|
27
|
+
}: Props<TFieldValues>) => react_jsx_runtime9.JSX.Element;
|
|
28
28
|
//#endregion
|
|
29
29
|
export { MultiSelectField };
|
|
30
30
|
//# sourceMappingURL=multi-select-field.d.cts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
2
2
|
import { FieldPath, FieldValues } from "react-hook-form";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/forms/multi-select-field.d.ts
|
|
@@ -24,7 +24,7 @@ declare const MultiSelectField: <TFieldValues extends FieldValues = FieldValues>
|
|
|
24
24
|
description,
|
|
25
25
|
options,
|
|
26
26
|
onAdd
|
|
27
|
-
}: Props<TFieldValues>) =>
|
|
27
|
+
}: Props<TFieldValues>) => react_jsx_runtime2.JSX.Element;
|
|
28
28
|
//#endregion
|
|
29
29
|
export { MultiSelectField };
|
|
30
30
|
//# sourceMappingURL=multi-select-field.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import"../button-CvQQTSka.js";import"../label-
|
|
1
|
+
"use client";import"../button-CvQQTSka.js";import"../label-HVpeECNr.js";import{FormControl as e,FormDescription as t,FormField as n,FormItem as r,FormLabel as i,FormMessage as a}from"../form-B-KLKj5u.js";import"../dialog-pMHkBJ-w.js";import"../command-CyWyRcle.js";import{MultipleSelector as o}from"../multi-select-DyhAPckx.js";import{jsx as s,jsxs as c}from"react/jsx-runtime";const l=({name:l,label:u=`Multi Select Field`,isShowLabel:d=!0,isShowErrorMsg:f,placeholder:p=`Select options`,description:m=``,options:h=[],onAdd:g})=>s(n,{name:l,render:({field:{value:n,onChange:l}})=>{let _=h.filter(e=>n?.includes(e.value)),v=e=>{let t=e.map(e=>e.value);l(t)};return c(r,{className:`w-full gap-0`,children:[d&&s(i,{children:u}),s(e,{children:s(o,{placeholder:p,emptyIndicator:`No options available`,value:_,options:h,onChange:v,onAddNewItem:g})}),!!m&&s(t,{children:m}),f&&s(a,{})]})}});export{l as MultiSelectField};
|
|
2
2
|
//# sourceMappingURL=multi-select-field.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`../chunk-CUT6urMc.cjs`);require(`../label-
|
|
1
|
+
const e=require(`../chunk-CUT6urMc.cjs`);require(`../label-BZqk7MPJ.cjs`);const t=require(`../form-CtpHZKmh.cjs`),n=require(`../input-DgtTVBtN.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(`react-hook-form`)),s=e=>e?/^-?\d*\.?\d*$/:/^\d*\.?\d*$/,c=e=>Number(e).toLocaleString(),l=({disabled:e=!1,readonly:t=!1,allowNegative:o=!1,numberAfterDecimalPoint:l=2,roundingRule:u=`none`,value:d=``,unitText:f,decimal:p,placeholder:m,precision:h,onChange:g,onValueChange:_,onBlur:v,...y})=>{let b=(0,a.useRef)(null),x=(0,a.useRef)(null),[S,C]=(0,a.useState)(d.toString()),w=p?.[1]??l,T=p&&p[0]-p[1],E=(0,a.useMemo)(()=>s(o),[o]),D=(0,a.useCallback)(e=>{if(!w&&e.includes(`.`))return!1;let t=e.split(`.`)[1];return!t||t.length<=w},[w]),O=(0,a.useCallback)(e=>{if(!p||e===`-`)return!0;let[t,n=``]=e.split(`.`);return n.length<=p[1]&&(t.startsWith(`-`)?t.length-1:t.length)<=T},[p,T]),k=(0,a.useCallback)((e,t)=>{if(u===`none`)return e;let n=Math.pow(10,t),r=e*n;switch(u){case`up`:return Math.ceil(r)/n;case`down`:return Math.floor(r)/n;case`nearest`:return r%1<.1?Math.floor(r)/n:r%1>=.59?Math.ceil(r)/n:(Math.floor(r)+.5)/n;default:return e}},[u]),A=(0,a.useCallback)(e=>!l&&e.includes(`.`)||e.split(`.`)[1]?.length>l,[l]),j=(0,a.useCallback)(e=>{if(e===`0`)return`0`;if(!Number(e))return``;let t=parseFloat(e),n=Math.min(w-1,h||0),r=k(t,n).toString(),[i,a=``]=r.split(`.`),o=c(i);return a?`${o}.${a}`:o},[k,w,h]),M=(0,a.useCallback)(e=>{if(!p||e===`-`)return!0;let[t,n=``]=e.split(`.`),r=t.startsWith(`-`)?t.length-1:t.length,i=p[0]-p[1];return n.length<=p[1]&&r<=i},[p]),N=(0,a.useCallback)(e=>{g?.(e);let{value:t}=e.target;if(!t){_?.(void 0),C(``);return}let n=t===`0`,r=t===`-`&&o;if(n||r){_?.(0),C(t);return}let i=E.test(t)&&O(t)&&(p||D(t));if(!i)return;let a=parseFloat(t)||0;_?.(a),C(t)},[o,p,D,O,g,_,E]),P=(0,a.useCallback)(()=>{t||C(e=>e.replace(/,/g,``))},[t]),F=(0,a.useCallback)(()=>{t||(v?.(),C(e=>j(e)))},[t,v,j]);return(0,a.useEffect)(()=>{let e=document.activeElement===x.current;if(!d||!E.test(d.toString())||!M(d.toString())||!p&&A(d.toString())){C(``);return}C(t=>t===`-`?`-`:t?e?d.toString():j(d.toString()):``)},[p,j,d,A,M,E]),(0,a.useEffect)(()=>{if(!b.current||!x.current||!f)return;let e=b.current.offsetWidth;x.current.style.setProperty(`padding-right`,`${(e+10)/16}rem`)},[e,f]),(0,i.jsxs)(`div`,{className:`relative`,children:[(0,i.jsx)(n.Input,{...y,ref:x,value:S||(t?`0`:``),placeholder:m,disabled:e,readOnly:t,className:(0,r.cn)(`font-number text-end`,t&&`bg-muted text-muted-foreground`),onChange:N,onFocus:P,onBlur:F}),f&&(0,i.jsx)(`span`,{ref:b,className:`text-muted-foreground pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 text-sm`,children:f})]})},u=({name:e,label:n=`Number Field`,placeholder:r=`0`,isShowErrorMsg:a=!1,isShowCount:s=!1,unitText:c=``,description:u=``,onValueChange:d})=>{let f=(0,o.useWatch)({name:e});return(0,i.jsx)(t.FormField,{name:e,render:({field:{onChange:e,...o}})=>(0,i.jsxs)(t.FormItem,{className:`w-full gap-0`,children:[(0,i.jsx)(t.FormLabel,{children:n}),(0,i.jsx)(t.FormControl,{children:(0,i.jsx)(l,{...o,placeholder:r,className:`w-full`,unitText:c,onValueChange:t=>{e(t),d?.(t)}})}),s&&(0,i.jsxs)(`div`,{className:`text-muted-foreground text-end text-xs`,children:[f?.length??0,` characters`]}),!!u&&(0,i.jsx)(t.FormDescription,{children:u}),a&&(0,i.jsx)(t.FormMessage,{})]})})};exports.NumberField=u;
|
|
2
2
|
//# sourceMappingURL=number-field.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
2
|
import { FieldPath, FieldValues } from "react-hook-form";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/forms/number-field.d.ts
|
|
@@ -22,7 +22,7 @@ declare const NumberField: <TFieldValues extends FieldValues = FieldValues>({
|
|
|
22
22
|
unitText,
|
|
23
23
|
description,
|
|
24
24
|
onValueChange
|
|
25
|
-
}: Props<TFieldValues>) =>
|
|
25
|
+
}: Props<TFieldValues>) => react_jsx_runtime0.JSX.Element;
|
|
26
26
|
//#endregion
|
|
27
27
|
export { NumberField };
|
|
28
28
|
//# sourceMappingURL=number-field.d.cts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime18 from "react/jsx-runtime";
|
|
2
2
|
import { FieldPath, FieldValues } from "react-hook-form";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/forms/number-field.d.ts
|
|
@@ -22,7 +22,7 @@ declare const NumberField: <TFieldValues extends FieldValues = FieldValues>({
|
|
|
22
22
|
unitText,
|
|
23
23
|
description,
|
|
24
24
|
onValueChange
|
|
25
|
-
}: Props<TFieldValues>) =>
|
|
25
|
+
}: Props<TFieldValues>) => react_jsx_runtime18.JSX.Element;
|
|
26
26
|
//#endregion
|
|
27
27
|
export { NumberField };
|
|
28
28
|
//# sourceMappingURL=number-field.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../label-
|
|
1
|
+
import"../label-HVpeECNr.js";import{FormControl as e,FormDescription as t,FormField as n,FormItem as r,FormLabel as i,FormMessage as a}from"../form-B-KLKj5u.js";import{Input as o}from"../input-BUYJ4_aj.js";import{cn as s}from"@customafk/react-toolkit/utils";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{useCallback as u,useEffect as d,useMemo as f,useRef as p,useState as m}from"react";import{useWatch as h}from"react-hook-form";const g=e=>e?/^-?\d*\.?\d*$/:/^\d*\.?\d*$/,_=e=>Number(e).toLocaleString(),v=({disabled:e=!1,readonly:t=!1,allowNegative:n=!1,numberAfterDecimalPoint:r=2,roundingRule:i=`none`,value:a=``,unitText:h,decimal:v,placeholder:y,precision:b,onChange:x,onValueChange:S,onBlur:C,...w})=>{let T=p(null),E=p(null),[D,O]=m(a.toString()),k=v?.[1]??r,A=v&&v[0]-v[1],j=f(()=>g(n),[n]),M=u(e=>{if(!k&&e.includes(`.`))return!1;let t=e.split(`.`)[1];return!t||t.length<=k},[k]),N=u(e=>{if(!v||e===`-`)return!0;let[t,n=``]=e.split(`.`);return n.length<=v[1]&&(t.startsWith(`-`)?t.length-1:t.length)<=A},[v,A]),P=u((e,t)=>{if(i===`none`)return e;let n=Math.pow(10,t),r=e*n;switch(i){case`up`:return Math.ceil(r)/n;case`down`:return Math.floor(r)/n;case`nearest`:return r%1<.1?Math.floor(r)/n:r%1>=.59?Math.ceil(r)/n:(Math.floor(r)+.5)/n;default:return e}},[i]),F=u(e=>!r&&e.includes(`.`)||e.split(`.`)[1]?.length>r,[r]),I=u(e=>{if(e===`0`)return`0`;if(!Number(e))return``;let t=parseFloat(e),n=Math.min(k-1,b||0),r=P(t,n).toString(),[i,a=``]=r.split(`.`),o=_(i);return a?`${o}.${a}`:o},[P,k,b]),L=u(e=>{if(!v||e===`-`)return!0;let[t,n=``]=e.split(`.`),r=t.startsWith(`-`)?t.length-1:t.length,i=v[0]-v[1];return n.length<=v[1]&&r<=i},[v]),R=u(e=>{x?.(e);let{value:t}=e.target;if(!t){S?.(void 0),O(``);return}let r=t===`0`,i=t===`-`&&n;if(r||i){S?.(0),O(t);return}let a=j.test(t)&&N(t)&&(v||M(t));if(!a)return;let o=parseFloat(t)||0;S?.(o),O(t)},[n,v,M,N,x,S,j]),z=u(()=>{t||O(e=>e.replace(/,/g,``))},[t]),B=u(()=>{t||(C?.(),O(e=>I(e)))},[t,C,I]);return d(()=>{let e=document.activeElement===E.current;if(!a||!j.test(a.toString())||!L(a.toString())||!v&&F(a.toString())){O(``);return}O(t=>t===`-`?`-`:t?e?a.toString():I(a.toString()):``)},[v,I,a,F,L,j]),d(()=>{if(!T.current||!E.current||!h)return;let e=T.current.offsetWidth;E.current.style.setProperty(`padding-right`,`${(e+10)/16}rem`)},[e,h]),l(`div`,{className:`relative`,children:[c(o,{...w,ref:E,value:D||(t?`0`:``),placeholder:y,disabled:e,readOnly:t,className:s(`font-number text-end`,t&&`bg-muted text-muted-foreground`),onChange:R,onFocus:z,onBlur:B}),h&&c(`span`,{ref:T,className:`text-muted-foreground pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 text-sm`,children:h})]})},y=({name:o,label:s=`Number Field`,placeholder:u=`0`,isShowErrorMsg:d=!1,isShowCount:f=!1,unitText:p=``,description:m=``,onValueChange:g})=>{let _=h({name:o});return c(n,{name:o,render:({field:{onChange:n,...o}})=>l(r,{className:`w-full gap-0`,children:[c(i,{children:s}),c(e,{children:c(v,{...o,placeholder:u,className:`w-full`,unitText:p,onValueChange:e=>{n(e),g?.(e)}})}),f&&l(`div`,{className:`text-muted-foreground text-end text-xs`,children:[_?.length??0,` characters`]}),!!m&&c(t,{children:m}),d&&c(a,{})]})})};export{y as NumberField};
|
|
2
2
|
//# sourceMappingURL=number-field.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require(`../chunk-CUT6urMc.cjs`);require(`../label-
|
|
1
|
+
"use client";const e=require(`../chunk-CUT6urMc.cjs`);require(`../label-BZqk7MPJ.cjs`);const t=require(`../form-CtpHZKmh.cjs`),n=require(`../input-DgtTVBtN.cjs`),r=e.__toESM(require(`lucide-react`)),i=e.__toESM(require(`@customafk/react-toolkit/utils`)),a=e.__toESM(require(`react/jsx-runtime`)),o=({className:e,...t})=>{let o=React.useId(),[s,c]=React.useState(!1),l=React.useCallback(()=>c(e=>!e),[]);return(0,a.jsxs)(`div`,{className:`relative`,children:[(0,a.jsx)(n.Input,{...t,id:o,placeholder:`Password`,type:s?`text`:`password`,className:(0,i.cn)(`pe-9`,e)}),(0,a.jsx)(`button`,{className:`text-muted-foreground/80 hover:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center rounded-e-md transition-[color,box-shadow] outline-none focus:z-10 focus-visible:ring-[3px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,type:`button`,onClick:l,"aria-label":s?`Hide password`:`Show password`,"aria-pressed":s,"aria-controls":`password`,children:s?(0,a.jsx)(r.EyeOffIcon,{size:16,"aria-hidden":`true`}):(0,a.jsx)(r.EyeIcon,{size:16,"aria-hidden":`true`})})]})},s=({name:e,label:n=`Text Field`,placeholder:r=`Enter text here`,isShowErrorMsg:i=!1,description:s,onValueChange:c})=>(0,a.jsx)(t.FormField,{name:e,render:({field:e})=>(0,a.jsxs)(t.FormItem,{className:`w-full`,children:[(0,a.jsx)(t.FormLabel,{children:n}),(0,a.jsx)(t.FormControl,{children:(0,a.jsx)(o,{placeholder:r,...e,onValueChange:c})}),!!s&&(0,a.jsx)(t.FormDescription,{children:s}),i&&(0,a.jsx)(t.FormMessage,{})]})});exports.PasswordField=s;
|
|
2
2
|
//# sourceMappingURL=password-field.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime13 from "react/jsx-runtime";
|
|
2
2
|
import { FieldPath, FieldValues } from "react-hook-form";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/forms/password-field.d.ts
|
|
@@ -17,7 +17,7 @@ declare const PasswordField: <TFieldValues extends FieldValues = FieldValues>({
|
|
|
17
17
|
isShowErrorMsg,
|
|
18
18
|
description,
|
|
19
19
|
onValueChange
|
|
20
|
-
}: Props<TFieldValues>) =>
|
|
20
|
+
}: Props<TFieldValues>) => react_jsx_runtime13.JSX.Element;
|
|
21
21
|
//#endregion
|
|
22
22
|
export { PasswordField };
|
|
23
23
|
//# sourceMappingURL=password-field.d.cts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime6 from "react/jsx-runtime";
|
|
2
2
|
import { FieldPath, FieldValues } from "react-hook-form";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/forms/password-field.d.ts
|
|
@@ -17,7 +17,7 @@ declare const PasswordField: <TFieldValues extends FieldValues = FieldValues>({
|
|
|
17
17
|
isShowErrorMsg,
|
|
18
18
|
description,
|
|
19
19
|
onValueChange
|
|
20
|
-
}: Props<TFieldValues>) =>
|
|
20
|
+
}: Props<TFieldValues>) => react_jsx_runtime6.JSX.Element;
|
|
21
21
|
//#endregion
|
|
22
22
|
export { PasswordField };
|
|
23
23
|
//# sourceMappingURL=password-field.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import"../label-
|
|
1
|
+
"use client";import"../label-HVpeECNr.js";import{FormControl as e,FormDescription as t,FormField as n,FormItem as r,FormLabel as i,FormMessage as a}from"../form-B-KLKj5u.js";import{Input as o}from"../input-BUYJ4_aj.js";import{EyeIcon as s,EyeOffIcon as c}from"lucide-react";import{cn as l}from"@customafk/react-toolkit/utils";import{jsx as u,jsxs as d}from"react/jsx-runtime";const f=({className:e,...t})=>{let n=React.useId(),[r,i]=React.useState(!1),a=React.useCallback(()=>i(e=>!e),[]);return d(`div`,{className:`relative`,children:[u(o,{...t,id:n,placeholder:`Password`,type:r?`text`:`password`,className:l(`pe-9`,e)}),u(`button`,{className:`text-muted-foreground/80 hover:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center rounded-e-md transition-[color,box-shadow] outline-none focus:z-10 focus-visible:ring-[3px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,type:`button`,onClick:a,"aria-label":r?`Hide password`:`Show password`,"aria-pressed":r,"aria-controls":`password`,children:u(r?c:s,{size:16,"aria-hidden":`true`})})]})},p=({name:o,label:s=`Text Field`,placeholder:c=`Enter text here`,isShowErrorMsg:l=!1,description:p,onValueChange:m})=>u(n,{name:o,render:({field:n})=>d(r,{className:`w-full`,children:[u(i,{children:s}),u(e,{children:u(f,{placeholder:c,...n,onValueChange:m})}),!!p&&u(t,{children:p}),l&&u(a,{})]})});export{p as PasswordField};
|
|
2
2
|
//# sourceMappingURL=password-field.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require(`../chunk-CUT6urMc.cjs`);require(`../label-
|
|
1
|
+
"use client";const e=require(`../chunk-CUT6urMc.cjs`);require(`../label-BZqk7MPJ.cjs`);const t=require(`../form-CtpHZKmh.cjs`),n=require(`../select-DAE3Xg7g.cjs`),r=e.__toESM(require(`@customafk/react-toolkit/utils`)),i=e.__toESM(require(`react/jsx-runtime`)),a=({name:e,label:a=`Select Field`,placeholder:o=`Select an option`,disabledValues:s=[],options:c=[],isShowLabel:l=!0,isShowErrorMsg:u=!1,description:d=``,className:f=``})=>(0,i.jsx)(t.FormField,{name:e,render:({field:e})=>(0,i.jsxs)(t.FormItem,{className:(0,r.cn)(`w-full`,f),children:[l&&(0,i.jsx)(t.FormLabel,{children:a}),(0,i.jsxs)(n.Select,{defaultValue:e.value,onValueChange:e.onChange,children:[(0,i.jsx)(t.FormControl,{children:(0,i.jsx)(n.SelectTrigger,{className:`w-full`,children:(0,i.jsx)(n.SelectValue,{placeholder:o})})}),(0,i.jsx)(n.SelectContent,{children:c.map(e=>(0,i.jsx)(n.SelectItem,{disabled:s.includes(e.value),value:e.value,children:e.label},e.value))})]}),!!d&&(0,i.jsx)(t.FormDescription,{children:d}),u&&(0,i.jsx)(t.FormMessage,{})]})});exports.SelectField=a;
|
|
2
2
|
//# sourceMappingURL=select-field.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime14 from "react/jsx-runtime";
|
|
2
2
|
import { FieldPath, FieldValues } from "react-hook-form";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/forms/select-field.d.ts
|
|
@@ -27,7 +27,7 @@ declare const SelectField: <TFieldValues extends FieldValues = FieldValues>({
|
|
|
27
27
|
isShowErrorMsg,
|
|
28
28
|
description,
|
|
29
29
|
className
|
|
30
|
-
}: Props<TFieldValues>) =>
|
|
30
|
+
}: Props<TFieldValues>) => react_jsx_runtime14.JSX.Element;
|
|
31
31
|
//#endregion
|
|
32
32
|
export { SelectField };
|
|
33
33
|
//# sourceMappingURL=select-field.d.cts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime4 from "react/jsx-runtime";
|
|
2
2
|
import { FieldPath, FieldValues } from "react-hook-form";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/forms/select-field.d.ts
|
|
@@ -27,7 +27,7 @@ declare const SelectField: <TFieldValues extends FieldValues = FieldValues>({
|
|
|
27
27
|
isShowErrorMsg,
|
|
28
28
|
description,
|
|
29
29
|
className
|
|
30
|
-
}: Props<TFieldValues>) =>
|
|
30
|
+
}: Props<TFieldValues>) => react_jsx_runtime4.JSX.Element;
|
|
31
31
|
//#endregion
|
|
32
32
|
export { SelectField };
|
|
33
33
|
//# sourceMappingURL=select-field.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import"../label-
|
|
1
|
+
"use client";import"../label-HVpeECNr.js";import{FormControl as e,FormDescription as t,FormField as n,FormItem as r,FormLabel as i,FormMessage as a}from"../form-B-KLKj5u.js";import{Select as o,SelectContent as s,SelectItem as c,SelectTrigger as l,SelectValue as u}from"../select-Cmq5a3Wg.js";import{cn as d}from"@customafk/react-toolkit/utils";import{jsx as f,jsxs as p}from"react/jsx-runtime";const m=({name:m,label:h=`Select Field`,placeholder:g=`Select an option`,disabledValues:_=[],options:v=[],isShowLabel:y=!0,isShowErrorMsg:b=!1,description:x=``,className:S=``})=>f(n,{name:m,render:({field:n})=>p(r,{className:d(`w-full`,S),children:[y&&f(i,{children:h}),p(o,{defaultValue:n.value,onValueChange:n.onChange,children:[f(e,{children:f(l,{className:`w-full`,children:f(u,{placeholder:g})})}),f(s,{children:v.map(e=>f(c,{disabled:_.includes(e.value),value:e.value,children:e.label},e.value))})]}),!!x&&f(t,{children:x}),b&&f(a,{})]})});export{m as SelectField};
|
|
2
2
|
//# sourceMappingURL=select-field.js.map
|