@customafk/lunas-ui 0.0.31 → 0.0.32
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-DN1gIKY3.js +2 -0
- package/dist/add-new-DN1gIKY3.js.map +1 -0
- package/dist/add-new-xS6skbx-.cjs +2 -0
- package/dist/add-new-xS6skbx-.cjs.map +1 -0
- package/dist/{alert-dialog-CdGmeas1.cjs → alert-dialog-CDkk0pu6.cjs} +2 -2
- package/dist/{alert-dialog-CdGmeas1.cjs.map → alert-dialog-CDkk0pu6.cjs.map} +1 -1
- package/dist/{alert-dialog-Dt_GKzSK.js → alert-dialog-sZgsVmHQ.js} +2 -2
- package/dist/{alert-dialog-Dt_GKzSK.js.map → alert-dialog-sZgsVmHQ.js.map} +1 -1
- package/dist/{badge-DzKUgC8v.js → badge-DVsw3QBx.js} +2 -2
- package/dist/{badge-DzKUgC8v.js.map → badge-DVsw3QBx.js.map} +1 -1
- package/dist/{badge-D4NxkKeN.cjs → badge-Z4Ilpic1.cjs} +2 -2
- package/dist/{badge-D4NxkKeN.cjs.map → badge-Z4Ilpic1.cjs.map} +1 -1
- package/dist/{button-DXBDPgBI.cjs → button-Bux-wVsx.cjs} +2 -2
- package/dist/{button-DXBDPgBI.cjs.map → button-Bux-wVsx.cjs.map} +1 -1
- package/dist/{button-IGXr9cbw.d.ts → button-CW3uac34.d.ts} +6 -6
- package/dist/{button-pBtzye3X.d.cts → button-DS3TloNb.d.cts} +6 -6
- package/dist/{button-f-Ak6B1N.js → button-k365f5HA.js} +2 -2
- package/dist/{button-f-Ak6B1N.js.map → button-k365f5HA.js.map} +1 -1
- package/dist/{calendar-CW1Khn4u.cjs → calendar-2P8RXz57.cjs} +2 -2
- package/dist/{calendar-CW1Khn4u.cjs.map → calendar-2P8RXz57.cjs.map} +1 -1
- package/dist/{calendar-yJx3vJIV.js → calendar-Bk2fba-V.js} +2 -2
- package/dist/{calendar-yJx3vJIV.js.map → calendar-Bk2fba-V.js.map} +1 -1
- package/dist/{card-CgQjctUE.js → card-CBX9KFaT.js} +1 -1
- package/dist/{card-CgQjctUE.js.map → card-CBX9KFaT.js.map} +1 -1
- package/dist/{card-DYVCumPc.cjs → card-DadColF9.cjs} +1 -1
- package/dist/{card-DYVCumPc.cjs.map → card-DadColF9.cjs.map} +1 -1
- package/dist/cards/simple-card.cjs +1 -1
- package/dist/cards/simple-card.d.cts +2 -2
- package/dist/cards/simple-card.d.ts +2 -2
- package/dist/cards/simple-card.js +1 -1
- package/dist/{command-CYwHqx-K.d.cts → command-DiAu-f2T.d.cts} +12 -12
- package/dist/{command-CwMS_md8.d.ts → command-lCWgB6gY.d.ts} +12 -12
- package/dist/{command-Dbkg10QA.js → command-rOYjhGsH.js} +2 -2
- package/dist/{command-Dbkg10QA.js.map → command-rOYjhGsH.js.map} +1 -1
- package/dist/{command-IL3ogESu.cjs → command-uFfTLVLB.cjs} +2 -2
- package/dist/{command-IL3ogESu.cjs.map → command-uFfTLVLB.cjs.map} +1 -1
- package/dist/data-display/country.cjs +1 -1
- package/dist/data-display/country.js +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.js +1 -1
- package/dist/data-display/empty.cjs +1 -1
- package/dist/data-display/empty.d.cts +2 -2
- 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.js +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.js +1 -1
- package/dist/data-display/statistic.cjs +1 -1
- package/dist/data-display/statistic.d.cts +2 -2
- package/dist/data-display/statistic.d.ts +2 -2
- package/dist/data-display/statistic.js +1 -1
- package/dist/{date-BMq_DNsv.js → date-CNMmc1dw.js} +1 -1
- package/dist/{date-BMq_DNsv.js.map → date-CNMmc1dw.js.map} +1 -1
- package/dist/{date-nd8WkPlx.cjs → date-DipuxrP1.cjs} +1 -1
- package/dist/{date-nd8WkPlx.cjs.map → date-DipuxrP1.cjs.map} +1 -1
- package/dist/{dialog-BjDyl_AI.d.ts → dialog-BgHMBAZR.d.ts} +12 -12
- package/dist/{dialog-BEdMA5Lp.js → dialog-CQ7VFVqq.js} +2 -2
- package/dist/{dialog-BEdMA5Lp.js.map → dialog-CQ7VFVqq.js.map} +1 -1
- package/dist/{dialog-BtIiLMNM.d.cts → dialog-CyrANigE.d.cts} +12 -12
- package/dist/{dialog-C4oHnJNN.cjs → dialog-D15fYo-V.cjs} +2 -2
- package/dist/{dialog-C4oHnJNN.cjs.map → dialog-D15fYo-V.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 +5 -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.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.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.js +1 -1
- package/dist/{dropdown-menu-BnfaOPEM.cjs → dropdown-menu-D61L7wHT.cjs} +2 -2
- package/dist/{dropdown-menu-BnfaOPEM.cjs.map → dropdown-menu-D61L7wHT.cjs.map} +1 -1
- package/dist/{dropdown-menu-D5uG4HZA.js → dropdown-menu-DLg0SDyR.js} +2 -2
- package/dist/{dropdown-menu-D5uG4HZA.js.map → dropdown-menu-DLg0SDyR.js.map} +1 -1
- package/dist/error-dialog-BUsOIdF7.cjs +2 -0
- package/dist/{error-dialog-BFrwuKU8.cjs.map → error-dialog-BUsOIdF7.cjs.map} +1 -1
- package/dist/error-dialog-HL0trgFF.js +2 -0
- package/dist/{error-dialog-uuG-q2Rc.js.map → error-dialog-HL0trgFF.js.map} +1 -1
- package/dist/{flex-CNA_SId-.cjs → flex-BuUVu_Lf.cjs} +2 -2
- package/dist/{flex-CNA_SId-.cjs.map → flex-BuUVu_Lf.cjs.map} +1 -1
- package/dist/{flex-ILvQrYMJ.js → flex-uO6z0kNw.js} +2 -2
- package/dist/{flex-ILvQrYMJ.js.map → flex-uO6z0kNw.js.map} +1 -1
- package/dist/form-BURcRgfV.js +2 -0
- package/dist/{form-tabDlutX.js.map → form-BURcRgfV.js.map} +1 -1
- package/dist/{form-CHs85hm6.cjs → form-DxHTpatW.cjs} +2 -2
- package/dist/{form-CHs85hm6.cjs.map → form-DxHTpatW.cjs.map} +1 -1
- package/dist/form-wrapper-CRvx6rtV.js +2 -0
- package/dist/{form-wrapper-C9oeenhj.js.map → form-wrapper-CRvx6rtV.js.map} +1 -1
- package/dist/form-wrapper-DlT1h1BU.cjs +2 -0
- package/dist/{form-wrapper-SxIzZP7y.cjs.map → form-wrapper-DlT1h1BU.cjs.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.cts +2 -2
- 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.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-BWigXg7N.d.cts → input-CGh5d1fe.d.cts} +3 -3
- package/dist/{input-VZiryzkl.cjs → input-DahIflvq.cjs} +1 -1
- package/dist/{input-VZiryzkl.cjs.map → input-DahIflvq.cjs.map} +1 -1
- package/dist/{input--6vqz8UI.js → input-YG15tKEM.js} +1 -1
- package/dist/{input--6vqz8UI.js.map → input-YG15tKEM.js.map} +1 -1
- package/dist/{input-BW1Ds8ll.d.ts → input-kLb5KdnV.d.ts} +3 -3
- package/dist/{label-B_2ZQn0X.cjs → label-BJkXZ3TJ.cjs} +2 -2
- package/dist/{label-B_2ZQn0X.cjs.map → label-BJkXZ3TJ.cjs.map} +1 -1
- package/dist/{label-D1XmKlc3.js → label-D6HPmJBN.js} +2 -2
- package/dist/{label-D1XmKlc3.js.map → label-D6HPmJBN.js.map} +1 -1
- package/dist/layouts/app-layout/index.cjs +1 -1
- package/dist/layouts/app-layout/index.d.cts +3 -3
- package/dist/layouts/app-layout/index.d.ts +26 -26
- package/dist/layouts/app-layout/index.js +1 -1
- package/dist/layouts/flex.cjs +1 -1
- package/dist/layouts/flex.d.cts +5 -5
- package/dist/layouts/flex.d.ts +3 -3
- package/dist/layouts/flex.js +1 -1
- package/dist/layouts/main/index.cjs +1 -1
- package/dist/layouts/main/index.cjs.map +1 -1
- package/dist/layouts/main/index.d.cts +4 -4
- package/dist/layouts/main/index.d.ts +4 -4
- package/dist/layouts/main/index.js +1 -1
- package/dist/{multi-select-BYABQRsW.cjs → multi-select-Ccun4tko.cjs} +2 -2
- package/dist/{multi-select-BYABQRsW.cjs.map → multi-select-Ccun4tko.cjs.map} +1 -1
- package/dist/{multi-select-5maZ70Hh.js → multi-select-orMSloDe.js} +2 -2
- package/dist/{multi-select-5maZ70Hh.js.map → multi-select-orMSloDe.js.map} +1 -1
- package/dist/paragraph-C7lEumt1.cjs +2 -0
- package/dist/{paragraph-DcRBcRhQ.cjs.map → paragraph-C7lEumt1.cjs.map} +1 -1
- package/dist/paragraph-DdDkztSr.js +2 -0
- package/dist/{paragraph-B4cQhLhW.js.map → paragraph-DdDkztSr.js.map} +1 -1
- package/dist/{popover-CqAD7HNo.js → popover-Bm8yrn27.js} +2 -2
- package/dist/{popover-CqAD7HNo.js.map → popover-Bm8yrn27.js.map} +1 -1
- package/dist/{popover-Dd0acCEk.cjs → popover-CZqrOSLU.cjs} +2 -2
- package/dist/{popover-Dd0acCEk.cjs.map → popover-CZqrOSLU.cjs.map} +1 -1
- package/dist/{progress-DLxh7x1P.cjs → progress-BN-Us1HI.cjs} +2 -2
- package/dist/{progress-DLxh7x1P.cjs.map → progress-BN-Us1HI.cjs.map} +1 -1
- package/dist/{progress-DWrtxJv0.js → progress-DI4g21bW.js} +2 -2
- package/dist/{progress-DWrtxJv0.js.map → progress-DI4g21bW.js.map} +1 -1
- package/dist/refresh-DD8oIITt.js +2 -0
- package/dist/refresh-DD8oIITt.js.map +1 -0
- package/dist/refresh-DQYWPM4I.cjs +2 -0
- package/dist/refresh-DQYWPM4I.cjs.map +1 -0
- package/dist/scroll-area-C2rZa7Ua.js +2 -0
- package/dist/{scroll-area-C0KQbcG0.js.map → scroll-area-C2rZa7Ua.js.map} +1 -1
- package/dist/{scroll-area-CBq8XL4c.cjs → scroll-area-Cc6UjeXy.cjs} +2 -2
- package/dist/{scroll-area-CBq8XL4c.cjs.map → scroll-area-Cc6UjeXy.cjs.map} +1 -1
- package/dist/{search-input-DqcwkgsY.js → search-input-BWd4Nofw.js} +2 -2
- package/dist/{search-input-DqcwkgsY.js.map → search-input-BWd4Nofw.js.map} +1 -1
- package/dist/{search-input-yweS9EMM.cjs → search-input-tuRulq_7.cjs} +2 -2
- package/dist/{search-input-yweS9EMM.cjs.map → search-input-tuRulq_7.cjs.map} +1 -1
- package/dist/{select-BHjk6yT3.cjs → select-AvmLfchI.cjs} +2 -2
- package/dist/{select-BHjk6yT3.cjs.map → select-AvmLfchI.cjs.map} +1 -1
- package/dist/{select-C6N3CXuY.js → select-CFwOPSRe.js} +2 -2
- package/dist/{select-C6N3CXuY.js.map → select-CFwOPSRe.js.map} +1 -1
- package/dist/{separator-Cigaqna1.cjs → separator-BT-ElB51.cjs} +2 -2
- package/dist/{separator-Cigaqna1.cjs.map → separator-BT-ElB51.cjs.map} +1 -1
- package/dist/{separator-sdRVQ17j.d.cts → separator-BprGaC5W.d.cts} +3 -3
- package/dist/{separator-aLdI4FQe.js → separator-CMpvCcC2.js} +2 -2
- package/dist/{separator-aLdI4FQe.js.map → separator-CMpvCcC2.js.map} +1 -1
- package/dist/{separator-DAPmuIm9.d.ts → separator-j1m9MZW8.d.ts} +3 -3
- package/dist/{sheet-CX3PajAc.cjs → sheet-DDzZ8aNz.cjs} +2 -2
- package/dist/{sheet-CX3PajAc.cjs.map → sheet-DDzZ8aNz.cjs.map} +1 -1
- package/dist/{sheet-DqPtcv9H.js → sheet-DZGisKJ7.js} +2 -2
- package/dist/{sheet-DqPtcv9H.js.map → sheet-DZGisKJ7.js.map} +1 -1
- package/dist/{sidebar-D5ahdZZ5.cjs → sidebar-Cwy_Lyyv.cjs} +2 -2
- package/dist/{sidebar-D5ahdZZ5.cjs.map → sidebar-Cwy_Lyyv.cjs.map} +1 -1
- package/dist/{sidebar-DI94-6Yv.js → sidebar-DJh4he1F.js} +2 -2
- package/dist/{sidebar-DI94-6Yv.js.map → sidebar-DJh4he1F.js.map} +1 -1
- package/dist/{sidebar-DhH37dk_.js → sidebar-DhskzF2y.js} +2 -2
- package/dist/{sidebar-DhH37dk_.js.map → sidebar-DhskzF2y.js.map} +1 -1
- package/dist/{sidebar-DUTLRFYa.cjs → sidebar-s8CA2I3B.cjs} +2 -2
- package/dist/{sidebar-DUTLRFYa.cjs.map → sidebar-s8CA2I3B.cjs.map} +1 -1
- package/dist/{switch-965kHdW_.js → switch-CgOE6qbi.js} +2 -2
- package/dist/{switch-965kHdW_.js.map → switch-CgOE6qbi.js.map} +1 -1
- package/dist/{switch-C3igCoxt.cjs → switch-qWUhH4Jx.cjs} +2 -2
- package/dist/{switch-C3igCoxt.cjs.map → switch-qWUhH4Jx.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/{textarea-3XRFTUZ8.cjs → textarea-DCzz0uEq.cjs} +1 -1
- package/dist/{textarea-3XRFTUZ8.cjs.map → textarea-DCzz0uEq.cjs.map} +1 -1
- package/dist/{textarea-CQ6gAnm5.js → textarea-hhVaJpsh.js} +1 -1
- package/dist/{textarea-CQ6gAnm5.js.map → textarea-hhVaJpsh.js.map} +1 -1
- package/dist/title-CD5GinA7.js +2 -0
- package/dist/{title-CxIwADiB.js.map → title-CD5GinA7.js.map} +1 -1
- package/dist/{title-6Uosk2b4.cjs → title-DjjjRvCQ.cjs} +2 -2
- package/dist/{title-6Uosk2b4.cjs.map → title-DjjjRvCQ.cjs.map} +1 -1
- package/dist/{toggle-B7nXBZ9r.cjs → toggle-62dJdAzP.cjs} +2 -2
- package/dist/{toggle-B7nXBZ9r.cjs.map → toggle-62dJdAzP.cjs.map} +1 -1
- package/dist/{toggle-A6eGkFij.js → toggle-CRvl17br.js} +2 -2
- package/dist/{toggle-A6eGkFij.js.map → toggle-CRvl17br.js.map} +1 -1
- package/dist/{toggle-UTf5bV7k.d.ts → toggle-CXaM4Z5s.d.ts} +4 -4
- package/dist/{toggle-DupM6kQx.d.cts → toggle-CeboRSo7.d.cts} +5 -5
- package/dist/{tooltip-CMERxaRy.d.cts → tooltip-Ccg2G_fB.d.cts} +6 -6
- package/dist/{tooltip-DFsHixOs.d.ts → tooltip-D0uAyaLw.d.ts} +6 -6
- package/dist/{tooltip-B8KdfOeT.js → tooltip-DYs9DCpH.js} +2 -2
- package/dist/{tooltip-B8KdfOeT.js.map → tooltip-DYs9DCpH.js.map} +1 -1
- package/dist/{tooltip-DLnAwybV.cjs → tooltip-DkJH6hxt.cjs} +2 -2
- package/dist/{tooltip-DLnAwybV.cjs.map → tooltip-DkJH6hxt.cjs.map} +1 -1
- package/dist/{types-CrbWxjnp.cjs → types-B-zo-oaH.cjs} +1 -1
- package/dist/{types-CrbWxjnp.cjs.map → types-B-zo-oaH.cjs.map} +1 -1
- package/dist/{types-DaIHddx7.js → types-juSjg5ED.js} +1 -1
- package/dist/{types-DaIHddx7.js.map → types-juSjg5ED.js.map} +1 -1
- package/dist/typography/paragraph.cjs +1 -1
- package/dist/typography/paragraph.d.cts +2 -2
- package/dist/typography/paragraph.d.ts +2 -2
- package/dist/typography/paragraph.js +1 -1
- 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 +1 -1
- package/dist/ui/alert-dialog.js +1 -1
- package/dist/ui/alert.cjs +1 -1
- package/dist/ui/alert.d.cts +6 -6
- package/dist/ui/alert.d.ts +4 -4
- package/dist/ui/alert.js +1 -1
- package/dist/ui/aspect-ratio.cjs +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/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.cjs +1 -1
- package/dist/ui/badge.d.cts +3 -3
- package/dist/ui/badge.d.ts +5 -5
- package/dist/ui/badge.js +1 -1
- package/dist/ui/breadcrumb.cjs +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/button.cjs +1 -1
- package/dist/ui/button.d.cts +1 -1
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/button.js +1 -1
- package/dist/ui/buttons/add-new.cjs +1 -1
- package/dist/ui/buttons/add-new.js +1 -1
- package/dist/ui/buttons/edit.cjs +1 -1
- package/dist/ui/buttons/edit.cjs.map +1 -1
- package/dist/ui/buttons/edit.js +1 -1
- package/dist/ui/buttons/edit.js.map +1 -1
- package/dist/ui/buttons/refresh.cjs +1 -1
- package/dist/ui/buttons/refresh.js +1 -1
- package/dist/ui/buttons/trash.cjs +1 -1
- package/dist/ui/buttons/trash.cjs.map +1 -1
- package/dist/ui/buttons/trash.js +1 -1
- package/dist/ui/buttons/trash.js.map +1 -1
- package/dist/ui/buttons/upload-image.cjs +1 -1
- package/dist/ui/buttons/upload-image.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.cjs +1 -1
- package/dist/ui/card.d.cts +8 -8
- package/dist/ui/card.d.ts +8 -8
- package/dist/ui/card.js +1 -1
- package/dist/ui/carousel.cjs +1 -1
- package/dist/ui/carousel.d.cts +7 -7
- package/dist/ui/carousel.d.ts +7 -7
- package/dist/ui/carousel.js +1 -1
- package/dist/ui/collapsible.cjs +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/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.cjs +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/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.cjs +2 -2
- 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/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.d.cts +4 -4
- package/dist/ui/hover-card.d.ts +4 -4
- package/dist/ui/hover-card.js +1 -1
- package/dist/ui/input-otp.cjs +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.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 +1 -1
- 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.d.cts +17 -17
- package/dist/ui/menubar.d.ts +17 -17
- package/dist/ui/menubar.js +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 +1 -1
- package/dist/ui/navigation-menu.d.cts +11 -11
- package/dist/ui/navigation-menu.d.ts +9 -9
- package/dist/ui/navigation-menu.js +1 -1
- package/dist/ui/pagination.cjs +1 -1
- package/dist/ui/pagination.d.cts +9 -9
- package/dist/ui/pagination.d.ts +9 -9
- package/dist/ui/pagination.js +1 -1
- 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.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.d.cts +3 -3
- package/dist/ui/radio-group.d.ts +3 -3
- package/dist/ui/radio-group.js +1 -1
- package/dist/ui/resizable.cjs +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/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.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 +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.cjs +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/sonner.cjs +1 -1
- package/dist/ui/sonner.d.cts +2 -2
- package/dist/ui/sonner.d.ts +2 -2
- package/dist/ui/sonner.js +1 -1
- 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.d.cts +9 -9
- package/dist/ui/table.d.ts +9 -9
- package/dist/ui/tabs.cjs +1 -1
- package/dist/ui/tabs.d.cts +5 -5
- package/dist/ui/tabs.d.ts +5 -5
- package/dist/ui/tabs.js +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.d.cts +4 -4
- package/dist/ui/toggle-group.d.ts +5 -5
- package/dist/ui/toggle-group.js +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 +1 -1
- package/dist/add-new-Do1zuycK.js +0 -2
- package/dist/add-new-Do1zuycK.js.map +0 -1
- package/dist/add-new-SKtwrbUB.cjs +0 -2
- package/dist/add-new-SKtwrbUB.cjs.map +0 -1
- package/dist/error-dialog-BFrwuKU8.cjs +0 -2
- package/dist/error-dialog-uuG-q2Rc.js +0 -2
- package/dist/form-tabDlutX.js +0 -2
- package/dist/form-wrapper-C9oeenhj.js +0 -2
- package/dist/form-wrapper-SxIzZP7y.cjs +0 -2
- package/dist/paragraph-B4cQhLhW.js +0 -2
- package/dist/paragraph-DcRBcRhQ.cjs +0 -2
- package/dist/refresh-Cuv5ddCh.cjs +0 -2
- package/dist/refresh-Cuv5ddCh.cjs.map +0 -1
- package/dist/refresh-hlMuphaz.js +0 -2
- package/dist/refresh-hlMuphaz.js.map +0 -1
- package/dist/scroll-area-C0KQbcG0.js +0 -2
- package/dist/title-CxIwADiB.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Form as e}from"./form-BURcRgfV.js";import{ErrorDialog as t}from"./error-dialog-HL0trgFF.js";import n from"react";import{AlertCircleIcon as r}from"lucide-react";import{Fragment as i,jsx as a,jsxs as o}from"react/jsx-runtime";import{useForm as s}from"react-hook-form";import{ErrorMessage as c}from"@hookform/error-message";const l=({form:l,isResetAfterSubmit:u=!0,className:d,onSubmit:f,onError:p,onSubcribe:m,children:h})=>{let g=s({...l,criteriaMode:`all`}),{formState:_,reset:v,handleSubmit:y,subscribe:b}=g,{dirtyFields:x}=_,[S,C]=n.useState(!1),w=n.useCallback(e=>{f(e,_,x),u&&v()},[x,_,u,f,v]),T=n.useCallback(e=>{let t=Object.keys(e);t.length!==0&&(p?.(e),C(!0))},[p]);return n.useEffect(()=>{if(!m)return;let e=b({formState:{values:!0},callback:({values:e})=>{m(e)}});return()=>e()},[m,b]),o(e,{...g,children:[a(`form`,{className:d,onSubmit:y(w,T),children:h}),a(t,{open:S,title:`Lỗi nhập dữ liệu`,description:`An unexpected error has occurred. Please check the errors below and try again.`,onOpenChange:C,children:S&&a(i,{children:Object.keys(_.errors).length>0?o(`div`,{className:`flex max-w-100 flex-col gap-2 px-4`,children:[a(`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:`}),a(`div`,{className:`flex flex-col space-y-1`,children:Object.entries(_.errors).map(([e])=>a(c,{errors:_.errors,name:e,render:({messages:e})=>a(i,{children:e?Object.entries(e).map(([e,t])=>o(`div`,{className:`text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal`,children:[a(r,{size:16,className:`text-destructive mt-0.5 min-w-4 flex-0`}),a(`p`,{className:`line-clamp-2 flex-1 text-wrap`,children:t})]},e)):null})},e))})]}):a(`p`,{className:`text-muted-foreground text-sm`,children:`No errors found.`})})})]})};export{l as FormWrapper};
|
|
2
|
+
//# sourceMappingURL=form-wrapper-CRvx6rtV.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-wrapper-
|
|
1
|
+
{"version":3,"file":"form-wrapper-CRvx6rtV.js","names":[],"sources":["../packages/components/forms/form-wrapper.tsx"],"sourcesContent":["import React from 'react'\nimport { type FieldValues, type FormState, type SubmitErrorHandler, type SubmitHandler, useForm, type UseFormProps } from 'react-hook-form'\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] = React.useState<boolean>(false)\n\n const handleFormSubmit = React.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 = React.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 React.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":"wUAmBA,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,EAAM,SAAkB,IAEpD,EAAmB,EAAM,YAC5B,GAAS,CACR,EAAS,EAAM,EAAW,GACtB,GACF,KAGJ,CAAC,EAAa,EAAW,EAAoB,EAAU,IAGnD,EAAkB,EAAM,YAC3B,GAAW,CACV,IAAM,EAAY,OAAO,KAAK,GAC1B,EAAU,SAAW,IACzB,IAAU,GACV,EAAa,MAEf,CAAC,IAcH,OAXA,EAAM,cAAgB,CACpB,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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require(`./chunk-CUT6urMc.cjs`),t=require(`./form-DxHTpatW.cjs`),n=require(`./error-dialog-BUsOIdF7.cjs`),r=e.__toESM(require(`react`)),i=e.__toESM(require(`lucide-react`)),a=e.__toESM(require(`react/jsx-runtime`)),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]=r.default.useState(!1),S=r.default.useCallback(e=>{u(e,h,y),c&&g()},[y,h,c,u,g]),C=r.default.useCallback(e=>{let t=Object.keys(e);t.length!==0&&(d?.(e),x(!0))},[d]);return r.default.useEffect(()=>{if(!f)return;let e=v({formState:{values:!0},callback:({values:e})=>{f(e)}});return()=>e()},[f,v]),(0,a.jsxs)(t.Form,{...m,children:[(0,a.jsx)(`form`,{className:l,onSubmit:_(S,C),children:p}),(0,a.jsx)(n.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,a.jsx)(a.Fragment,{children:Object.keys(h.errors).length>0?(0,a.jsxs)(`div`,{className:`flex max-w-100 flex-col gap-2 px-4`,children:[(0,a.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,a.jsx)(`div`,{className:`flex flex-col space-y-1`,children:Object.entries(h.errors).map(([e])=>(0,a.jsx)(s.ErrorMessage,{errors:h.errors,name:e,render:({messages:e})=>(0,a.jsx)(a.Fragment,{children:e?Object.entries(e).map(([e,t])=>(0,a.jsxs)(`div`,{className:`text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal`,children:[(0,a.jsx)(i.AlertCircleIcon,{size:16,className:`text-destructive mt-0.5 min-w-4 flex-0`}),(0,a.jsx)(`p`,{className:`line-clamp-2 flex-1 text-wrap`,children:t})]},e)):null})},e))})]}):(0,a.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-DlT1h1BU.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-wrapper-
|
|
1
|
+
{"version":3,"file":"form-wrapper-DlT1h1BU.cjs","names":["React","Form","ErrorDialog","ErrorMessage","AlertCircleIcon"],"sources":["../packages/components/forms/form-wrapper.tsx"],"sourcesContent":["import React from 'react'\nimport { type FieldValues, type FormState, type SubmitErrorHandler, type SubmitHandler, useForm, type UseFormProps } from 'react-hook-form'\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] = React.useState<boolean>(false)\n\n const handleFormSubmit = React.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 = React.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 React.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":"uTAmBa,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,GAAgBA,EAAAA,QAAM,SAAkB,IAEpD,EAAmBA,EAAAA,QAAM,YAC5B,GAAS,CACR,EAAS,EAAM,EAAW,GACtB,GACF,KAGJ,CAAC,EAAa,EAAW,EAAoB,EAAU,IAGnD,EAAkBA,EAAAA,QAAM,YAC3B,GAAW,CACV,IAAM,EAAY,OAAO,KAAK,GAC1B,EAAU,SAAW,IACzB,IAAU,GACV,EAAa,MAEf,CAAC,IAcH,OAXA,EAAA,QAAM,cAAgB,CACpB,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,MAACC,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
|
-
"use client";const e=require(`../chunk-CUT6urMc.cjs`),t=require(`../utils-BsjVK5EW.cjs`),n=require(`../button-
|
|
1
|
+
"use client";const e=require(`../chunk-CUT6urMc.cjs`),t=require(`../utils-BsjVK5EW.cjs`),n=require(`../button-Bux-wVsx.cjs`);require(`../dialog-D15fYo-V.cjs`);const r=require(`../command-uFfTLVLB.cjs`);require(`../label-BJkXZ3TJ.cjs`);const i=require(`../form-DxHTpatW.cjs`),a=require(`../popover-CZqrOSLU.cjs`),o=e.__toESM(require(`react`)),s=e.__toESM(require(`lucide-react`)),c=e.__toESM(require(`react/jsx-runtime`)),l=({name:e,label:l=`Combobox`,placeholder:u=`Chọn một mục`,description:d,options:f,onAddNewItem:p})=>(0,c.jsx)(i.FormField,{name:e,render:({field:e})=>(0,c.jsxs)(i.FormItem,{className:`w-full`,children:[(0,c.jsx)(i.FormLabel,{children:l}),(0,c.jsxs)(a.Popover,{modal:!0,children:[(0,c.jsx)(a.PopoverTrigger,{asChild:!0,children:(0,c.jsx)(i.FormControl,{children:(0,c.jsxs)(n.Button,{type:`button`,variant:`outline`,role:`combobox`,color:`muted`,className:t.cn(`flex justify-between rounded-md px-3`,`outline-border-weak font-normal`,`[&_div]:justify-between`,`data-[state=open]:border-primary-strong`,`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,c.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`,children:f?.find(({value:t})=>t===e.value)?.label}):(0,c.jsx)(`span`,{className:`text-text-positive-muted`,children:u}),(0,c.jsx)(s.ChevronDownIcon,{size:16,className:`text-text-positive-weak shrink-0`,"aria-hidden":`true`})]})})}),(0,c.jsx)(a.PopoverContent,{className:`border-input w-full max-w-[var(--radix-popover-trigger-width)] p-0`,children:(0,c.jsxs)(r.Command,{children:[(0,c.jsx)(r.CommandInput,{placeholder:u??`Tìm kiếm`}),(0,c.jsxs)(r.CommandList,{children:[(0,c.jsx)(r.CommandGroup,{className:`max-h-40 overflow-y-auto`,children:f?.map(({value:t,label:n})=>(0,c.jsx)(r.CommandItem,{value:n,onSelect:()=>e.onChange(t),children:n},t))}),p&&(0,c.jsxs)(o.default.Fragment,{children:[(0,c.jsx)(r.CommandSeparator,{}),(0,c.jsx)(r.CommandGroup,{children:(0,c.jsxs)(n.Button,{type:`button`,variant:`ghost`,className:`w-full justify-start font-normal`,children:[(0,c.jsx)(s.PlusIcon,{size:14,className:`-ms-2 opacity-60`,"aria-hidden":`true`}),`Thêm mới`]})})]})]}),(0,c.jsx)(r.CommandEmpty,{children:`Không có kết quả`})]})})]}),!!d&&(0,c.jsx)(i.FormDescription,{children:d})]})});exports.ComboboxField=l;
|
|
2
2
|
//# sourceMappingURL=combobox-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/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_runtime0.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_runtime0 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_runtime0.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{cn as e}from"../utils-D9AH0PUV.js";import{Button as t}from"../button-
|
|
1
|
+
"use client";import{cn as e}from"../utils-D9AH0PUV.js";import{Button as t}from"../button-k365f5HA.js";import"../dialog-CQ7VFVqq.js";import{Command as n,CommandEmpty as r,CommandGroup as i,CommandInput as a,CommandItem as o,CommandList as s,CommandSeparator as c}from"../command-rOYjhGsH.js";import"../label-D6HPmJBN.js";import{FormControl as l,FormDescription as u,FormField as d,FormItem as f,FormLabel as p}from"../form-BURcRgfV.js";import{Popover as m,PopoverContent as h,PopoverTrigger as g}from"../popover-Bm8yrn27.js";import _ from"react";import{ChevronDownIcon as v,PlusIcon as y}from"lucide-react";import{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(d,{name:S,render:({field:d})=>x(f,{className:`w-full`,children:[b(p,{children:C}),x(m,{modal:!0,children:[b(g,{asChild:!0,children:b(l,{children:x(t,{type:`button`,variant:`outline`,role:`combobox`,color:`muted`,className:e(`flex justify-between rounded-md px-3`,`outline-border-weak font-normal`,`[&_div]:justify-between`,`data-[state=open]:border-primary-strong`,`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:[d.value?b(`span`,{className:`flex min-w-0 items-center gap-2`,children:E?.find(({value:e})=>e===d.value)?.label}):b(`span`,{className:`text-text-positive-muted`,children:w}),b(v,{size:16,className:`text-text-positive-weak shrink-0`,"aria-hidden":`true`})]})})}),b(h,{className:`border-input w-full max-w-[var(--radix-popover-trigger-width)] p-0`,children:x(n,{children:[b(a,{placeholder:w??`Tìm kiếm`}),x(s,{children:[b(i,{className:`max-h-40 overflow-y-auto`,children:E?.map(({value:e,label:t})=>b(o,{value:t,onSelect:()=>d.onChange(e),children:t},e))}),D&&x(_.Fragment,{children:[b(c,{}),b(i,{children:x(t,{type:`button`,variant:`ghost`,className:`w-full justify-start font-normal`,children:[b(y,{size:14,className:`-ms-2 opacity-60`,"aria-hidden":`true`}),`Thêm mới`]})})]})]}),b(r,{children:`Không có kết quả`})]})})]}),!!T&&b(u,{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(`../utils-BsjVK5EW.cjs`),n=require(`../button-
|
|
1
|
+
"use client";const e=require(`../chunk-CUT6urMc.cjs`),t=require(`../utils-BsjVK5EW.cjs`),n=require(`../button-Bux-wVsx.cjs`);require(`../label-BJkXZ3TJ.cjs`);const r=require(`../form-DxHTpatW.cjs`),i=require(`../popover-CZqrOSLU.cjs`),a=require(`../calendar-2P8RXz57.cjs`),o=e.__toESM(require(`lucide-react`)),s=e.__toESM(require(`react/jsx-runtime`)),c=e.__toESM(require(`date-fns`)),l=({name:e,label:l=`Date Field`,placeholder:u=`Select a date`,description:d=``,isShowErrorMsg:f=!1})=>(0,s.jsx)(r.FormField,{name:e,render:({field:e})=>(0,s.jsxs)(r.FormItem,{className:`w-full`,children:[(0,s.jsx)(r.FormLabel,{children:l}),(0,s.jsxs)(i.Popover,{modal:!0,children:[(0,s.jsx)(i.PopoverTrigger,{asChild:!0,children:(0,s.jsx)(r.FormControl,{children:(0,s.jsxs)(n.Button,{variant:`outline`,className:t.cn(`w-full pl-3 text-left font-normal`,!e.value&&`text-muted-foreground`),children:[e.value?(0,c.format)(e.value,`PPP`):(0,s.jsxs)(`span`,{children:[` `,u||`Pick a date`]}),(0,s.jsx)(o.CalendarIcon,{className:`ml-auto size-4 opacity-50`})]})})}),(0,s.jsx)(i.PopoverContent,{className:`w-auto p-0`,align:`start`,children:(0,s.jsx)(a.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)(r.FormDescription,{children:d}),f&&(0,s.jsx)(r.FormMessage,{})]})});exports.DateField=l;
|
|
2
2
|
//# sourceMappingURL=date-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/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_runtime0.JSX.Element;
|
|
20
20
|
//#endregion
|
|
21
21
|
export { DateField };
|
|
22
22
|
//# sourceMappingURL=date-field.d.cts.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{cn as e}from"../utils-D9AH0PUV.js";import{Button as t}from"../button-
|
|
1
|
+
"use client";import{cn as e}from"../utils-D9AH0PUV.js";import{Button as t}from"../button-k365f5HA.js";import"../label-D6HPmJBN.js";import{FormControl as n,FormDescription as r,FormField as i,FormItem as a,FormLabel as o,FormMessage as s}from"../form-BURcRgfV.js";import{Popover as c,PopoverContent as l,PopoverTrigger as u}from"../popover-Bm8yrn27.js";import{Calendar as d}from"../calendar-Bk2fba-V.js";import{CalendarIcon as f}from"lucide-react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{format as h}from"date-fns";const g=({name:g,label:_=`Date Field`,placeholder:v=`Select a date`,description:y=``,isShowErrorMsg:b=!1})=>p(i,{name:g,render:({field:i})=>m(a,{className:`w-full`,children:[p(o,{children:_}),m(c,{modal:!0,children:[p(u,{asChild:!0,children:p(n,{children:m(t,{variant:`outline`,className:e(`w-full pl-3 text-left font-normal`,!i.value&&`text-muted-foreground`),children:[i.value?h(i.value,`PPP`):m(`span`,{children:[` `,v||`Pick a date`]}),p(f,{className:`ml-auto size-4 opacity-50`})]})})}),p(l,{className:`w-auto p-0`,align:`start`,children:p(d,{mode:`single`,selected:i.value,onSelect:e=>{i.onChange(e?.toISOString())},captionLayout:`dropdown`,disabled:e=>e<new Date(`2022-01-01`)})})]}),!!y&&p(r,{children:y}),b&&p(s,{})]})});export{g as DateField};
|
|
2
2
|
//# sourceMappingURL=date-field.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../utils-BsjVK5EW.cjs`),require(`../button-
|
|
1
|
+
require(`../utils-BsjVK5EW.cjs`),require(`../button-Bux-wVsx.cjs`),require(`../label-BJkXZ3TJ.cjs`),require(`../form-DxHTpatW.cjs`),require(`../alert-dialog-CDkk0pu6.cjs`),require(`../error-dialog-BUsOIdF7.cjs`);const e=require(`../form-wrapper-DlT1h1BU.cjs`);exports.FormWrapper=e.FormWrapper;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { FieldValues, FormState, SubmitErrorHandler, UseFormProps } from "react-hook-form";
|
|
4
4
|
|
|
@@ -19,7 +19,7 @@ declare const FormWrapper: <TFieldValues extends FieldValues = FieldValues>({
|
|
|
19
19
|
onError,
|
|
20
20
|
onSubcribe,
|
|
21
21
|
children
|
|
22
|
-
}: React.PropsWithChildren<Props<TFieldValues>>) =>
|
|
22
|
+
}: React.PropsWithChildren<Props<TFieldValues>>) => react_jsx_runtime5.JSX.Element;
|
|
23
23
|
//#endregion
|
|
24
24
|
export { FormWrapper };
|
|
25
25
|
//# sourceMappingURL=form-wrapper.d.cts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
3
3
|
import { FieldValues, FormState, SubmitErrorHandler, UseFormProps } from "react-hook-form";
|
|
4
4
|
|
|
5
5
|
//#region packages/components/forms/form-wrapper.d.ts
|
|
@@ -19,7 +19,7 @@ declare const FormWrapper: <TFieldValues extends FieldValues = FieldValues>({
|
|
|
19
19
|
onError,
|
|
20
20
|
onSubcribe,
|
|
21
21
|
children
|
|
22
|
-
}: React.PropsWithChildren<Props<TFieldValues>>) =>
|
|
22
|
+
}: React.PropsWithChildren<Props<TFieldValues>>) => react_jsx_runtime2.JSX.Element;
|
|
23
23
|
//#endregion
|
|
24
24
|
export { FormWrapper };
|
|
25
25
|
//# sourceMappingURL=form-wrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../utils-D9AH0PUV.js";import"../button-
|
|
1
|
+
import"../utils-D9AH0PUV.js";import"../button-k365f5HA.js";import"../label-D6HPmJBN.js";import"../form-BURcRgfV.js";import"../alert-dialog-sZgsVmHQ.js";import"../error-dialog-HL0trgFF.js";import{FormWrapper as e}from"../form-wrapper-CRvx6rtV.js";export{e as FormWrapper};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require(`../chunk-CUT6urMc.cjs`);require(`../utils-BsjVK5EW.cjs`),require(`../button-
|
|
1
|
+
"use client";const e=require(`../chunk-CUT6urMc.cjs`);require(`../utils-BsjVK5EW.cjs`),require(`../button-Bux-wVsx.cjs`),require(`../dialog-D15fYo-V.cjs`),require(`../command-uFfTLVLB.cjs`),require(`../label-BJkXZ3TJ.cjs`);const t=require(`../form-DxHTpatW.cjs`),n=require(`../multi-select-Ccun4tko.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_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.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/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_runtime6.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"../utils-D9AH0PUV.js";import"../button-
|
|
1
|
+
"use client";import"../utils-D9AH0PUV.js";import"../button-k365f5HA.js";import"../dialog-CQ7VFVqq.js";import"../command-rOYjhGsH.js";import"../label-D6HPmJBN.js";import{FormControl as e,FormDescription as t,FormField as n,FormItem as r,FormLabel as i,FormMessage as a}from"../form-BURcRgfV.js";import{MultipleSelector as o}from"../multi-select-orMSloDe.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`),t=require(`../utils-BsjVK5EW.cjs`);require(`../label-
|
|
1
|
+
const e=require(`../chunk-CUT6urMc.cjs`),t=require(`../utils-BsjVK5EW.cjs`);require(`../label-BJkXZ3TJ.cjs`);const n=require(`../form-DxHTpatW.cjs`),r=require(`../input-DahIflvq.cjs`),i=e.__toESM(require(`react`)),a=e.__toESM(require(`react/jsx-runtime`)),o=e.__toESM(require(`react-hook-form`)),s=e=>e?/^-?\d*\.?\d*$/:/^\d*\.?\d*$/,c=e=>Number(e).toLocaleString(),l=({disabled:e=!1,readonly:n=!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=i.default.useRef(null),x=i.default.useRef(null),[S,C]=i.default.useState(d.toString()),w=p?.[1]??l,T=p&&p[0]-p[1],E=i.default.useMemo(()=>s(o),[o]),D=i.default.useCallback(e=>{if(!w&&e.includes(`.`))return!1;let t=e.split(`.`)[1];return!t||t.length<=w},[w]),O=i.default.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=i.default.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=i.default.useCallback(e=>!l&&e.includes(`.`)||e.split(`.`)[1]?.length>l,[l]),j=i.default.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=i.default.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=i.default.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=i.default.useCallback(()=>{n||C(e=>e.replace(/,/g,``))},[n]),F=i.default.useCallback(()=>{n||(v?.(),C(e=>j(e)))},[n,v,j]);return i.default.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]),i.default.useEffect(()=>{if(!b.current||!x.current||!f)return;let e=b.current.offsetWidth;x.current.style.setProperty(`padding-right`,`${(e+8)/16}rem`)},[e,f]),(0,a.jsxs)(`div`,{className:`relative`,children:[(0,a.jsx)(r.Input,{...y,ref:x,value:S||(n?`0`:``),placeholder:m,disabled:e,readOnly:n,className:t.cn(`font-number text-end`,n&&`bg-muted text-muted-foreground`),onChange:N,onFocus:P,onBlur:F}),f&&(0,a.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:t=`Number Field`,placeholder:r=`0`,isShowErrorMsg:i=!1,isShowCount:s=!1,unitText:c=``,description:u=``,onValueChange:d})=>{let f=(0,o.useWatch)({name:e});return(0,a.jsx)(n.FormField,{name:e,render:({field:{onChange:e,...o}})=>(0,a.jsxs)(n.FormItem,{className:`w-full gap-0`,children:[(0,a.jsx)(n.FormLabel,{children:t}),(0,a.jsx)(n.FormControl,{children:(0,a.jsx)(l,{...o,placeholder:r,className:`w-full`,unitText:c,onValueChange:t=>{e(t),d?.(t)}})}),s&&(0,a.jsxs)(`div`,{className:`text-muted-foreground text-end text-xs`,children:[f?.length??0,` characters`]}),!!u&&(0,a.jsx)(n.FormDescription,{children:u}),i&&(0,a.jsx)(n.FormMessage,{})]})})};exports.NumberField=u;
|
|
2
2
|
//# sourceMappingURL=number-field.cjs.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/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_runtime4.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_runtime4 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_runtime4.JSX.Element;
|
|
26
26
|
//#endregion
|
|
27
27
|
export { NumberField };
|
|
28
28
|
//# sourceMappingURL=number-field.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cn as e}from"../utils-D9AH0PUV.js";import"../label-
|
|
1
|
+
import{cn as e}from"../utils-D9AH0PUV.js";import"../label-D6HPmJBN.js";import{FormControl as t,FormDescription as n,FormField as r,FormItem as i,FormLabel as a,FormMessage as o}from"../form-BURcRgfV.js";import{Input as s}from"../input-YG15tKEM.js";import c from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{useWatch as d}from"react-hook-form";const f=e=>e?/^-?\d*\.?\d*$/:/^\d*\.?\d*$/,p=e=>Number(e).toLocaleString(),m=({disabled:t=!1,readonly:n=!1,allowNegative:r=!1,numberAfterDecimalPoint:i=2,roundingRule:a=`none`,value:o=``,unitText:d,decimal:m,placeholder:h,precision:g,onChange:_,onValueChange:v,onBlur:y,...b})=>{let x=c.useRef(null),S=c.useRef(null),[C,w]=c.useState(o.toString()),T=m?.[1]??i,E=m&&m[0]-m[1],D=c.useMemo(()=>f(r),[r]),O=c.useCallback(e=>{if(!T&&e.includes(`.`))return!1;let t=e.split(`.`)[1];return!t||t.length<=T},[T]),k=c.useCallback(e=>{if(!m||e===`-`)return!0;let[t,n=``]=e.split(`.`);return n.length<=m[1]&&(t.startsWith(`-`)?t.length-1:t.length)<=E},[m,E]),A=c.useCallback((e,t)=>{if(a===`none`)return e;let n=Math.pow(10,t),r=e*n;switch(a){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}},[a]),j=c.useCallback(e=>!i&&e.includes(`.`)||e.split(`.`)[1]?.length>i,[i]),M=c.useCallback(e=>{if(e===`0`)return`0`;if(!Number(e))return``;let t=parseFloat(e),n=Math.min(T-1,g||0),r=A(t,n).toString(),[i,a=``]=r.split(`.`),o=p(i);return a?`${o}.${a}`:o},[A,T,g]),N=c.useCallback(e=>{if(!m||e===`-`)return!0;let[t,n=``]=e.split(`.`),r=t.startsWith(`-`)?t.length-1:t.length,i=m[0]-m[1];return n.length<=m[1]&&r<=i},[m]),P=c.useCallback(e=>{_?.(e);let{value:t}=e.target;if(!t){v?.(void 0),w(``);return}let n=t===`0`,i=t===`-`&&r;if(n||i){v?.(0),w(t);return}let a=D.test(t)&&k(t)&&(m||O(t));if(!a)return;let o=parseFloat(t)||0;v?.(o),w(t)},[r,m,O,k,_,v,D]),F=c.useCallback(()=>{n||w(e=>e.replace(/,/g,``))},[n]),I=c.useCallback(()=>{n||(y?.(),w(e=>M(e)))},[n,y,M]);return c.useEffect(()=>{let e=document.activeElement===S.current;if(!o||!D.test(o.toString())||!N(o.toString())||!m&&j(o.toString())){w(``);return}w(t=>t===`-`?`-`:t?e?o.toString():M(o.toString()):``)},[m,M,o,j,N,D]),c.useEffect(()=>{if(!x.current||!S.current||!d)return;let e=x.current.offsetWidth;S.current.style.setProperty(`padding-right`,`${(e+8)/16}rem`)},[t,d]),u(`div`,{className:`relative`,children:[l(s,{...b,ref:S,value:C||(n?`0`:``),placeholder:h,disabled:t,readOnly:n,className:e(`font-number text-end`,n&&`bg-muted text-muted-foreground`),onChange:P,onFocus:F,onBlur:I}),d&&l(`span`,{ref:x,className:`text-muted-foreground pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 text-sm`,children:d})]})},h=({name:e,label:s=`Number Field`,placeholder:c=`0`,isShowErrorMsg:f=!1,isShowCount:p=!1,unitText:h=``,description:g=``,onValueChange:_})=>{let v=d({name:e});return l(r,{name:e,render:({field:{onChange:e,...r}})=>u(i,{className:`w-full gap-0`,children:[l(a,{children:s}),l(t,{children:l(m,{...r,placeholder:c,className:`w-full`,unitText:h,onValueChange:t=>{e(t),_?.(t)}})}),p&&u(`div`,{className:`text-muted-foreground text-end text-xs`,children:[v?.length??0,` characters`]}),!!g&&l(n,{children:g}),f&&l(o,{})]})})};export{h as NumberField};
|
|
2
2
|
//# sourceMappingURL=number-field.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require(`../chunk-CUT6urMc.cjs`),t=require(`../utils-BsjVK5EW.cjs`);require(`../label-
|
|
1
|
+
"use client";const e=require(`../chunk-CUT6urMc.cjs`),t=require(`../utils-BsjVK5EW.cjs`);require(`../label-BJkXZ3TJ.cjs`);const n=require(`../form-DxHTpatW.cjs`),r=require(`../input-DahIflvq.cjs`),i=e.__toESM(require(`react`)),a=e.__toESM(require(`lucide-react`)),o=e.__toESM(require(`react/jsx-runtime`)),s=({className:e,...n})=>{let s=i.default.useId(),[c,l]=i.default.useState(!1),u=i.default.useCallback(()=>l(e=>!e),[]);return(0,o.jsxs)(`div`,{className:`relative`,children:[(0,o.jsx)(r.Input,{...n,id:s,placeholder:`Password`,type:c?`text`:`password`,className:t.cn(`pe-9`,e)}),(0,o.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:u,"aria-label":c?`Hide password`:`Show password`,"aria-pressed":c,"aria-controls":`password`,children:c?(0,o.jsx)(a.EyeOffIcon,{size:16,"aria-hidden":`true`}):(0,o.jsx)(a.EyeIcon,{size:16,"aria-hidden":`true`})})]})},c=({name:e,label:t=`Text Field`,placeholder:r=`Enter text here`,isShowErrorMsg:i=!1,description:a,onValueChange:c})=>(0,o.jsx)(n.FormField,{name:e,render:({field:e})=>(0,o.jsxs)(n.FormItem,{className:`w-full`,children:[(0,o.jsx)(n.FormLabel,{children:t}),(0,o.jsx)(n.FormControl,{children:(0,o.jsx)(s,{placeholder:r,...e,onValueChange:c})}),!!a&&(0,o.jsx)(n.FormDescription,{children:a}),i&&(0,o.jsx)(n.FormMessage,{})]})});exports.PasswordField=c;
|
|
2
2
|
//# sourceMappingURL=password-field.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime19 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_runtime19.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_runtime8 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_runtime8.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{cn as e}from"../utils-D9AH0PUV.js";import"../label-
|
|
1
|
+
"use client";import{cn as e}from"../utils-D9AH0PUV.js";import"../label-D6HPmJBN.js";import{FormControl as t,FormDescription as n,FormField as r,FormItem as i,FormLabel as a,FormMessage as o}from"../form-BURcRgfV.js";import{Input as s}from"../input-YG15tKEM.js";import c from"react";import{EyeIcon as l,EyeOffIcon as u}from"lucide-react";import{jsx as d,jsxs as f}from"react/jsx-runtime";const p=({className:t,...n})=>{let r=c.useId(),[i,a]=c.useState(!1),o=c.useCallback(()=>a(e=>!e),[]);return f(`div`,{className:`relative`,children:[d(s,{...n,id:r,placeholder:`Password`,type:i?`text`:`password`,className:e(`pe-9`,t)}),d(`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:o,"aria-label":i?`Hide password`:`Show password`,"aria-pressed":i,"aria-controls":`password`,children:d(i?u:l,{size:16,"aria-hidden":`true`})})]})},m=({name:e,label:s=`Text Field`,placeholder:c=`Enter text here`,isShowErrorMsg:l=!1,description:u,onValueChange:m})=>d(r,{name:e,render:({field:e})=>f(i,{className:`w-full`,children:[d(a,{children:s}),d(t,{children:d(p,{placeholder:c,...e,onValueChange:m})}),!!u&&d(n,{children:u}),l&&d(o,{})]})});export{m as PasswordField};
|
|
2
2
|
//# sourceMappingURL=password-field.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require(`../chunk-CUT6urMc.cjs`),t=require(`../utils-BsjVK5EW.cjs`);require(`../label-
|
|
1
|
+
"use client";const e=require(`../chunk-CUT6urMc.cjs`),t=require(`../utils-BsjVK5EW.cjs`);require(`../label-BJkXZ3TJ.cjs`);const n=require(`../form-DxHTpatW.cjs`),r=require(`../select-AvmLfchI.cjs`),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)(n.FormField,{name:e,render:({field:e})=>(0,i.jsxs)(n.FormItem,{className:t.cn(`w-full`,f),children:[l&&(0,i.jsx)(n.FormLabel,{children:a}),(0,i.jsxs)(r.Select,{defaultValue:e.value,onValueChange:e.onChange,children:[(0,i.jsx)(n.FormControl,{children:(0,i.jsx)(r.SelectTrigger,{className:`w-full`,children:(0,i.jsx)(r.SelectValue,{placeholder:o})})}),(0,i.jsx)(r.SelectContent,{children:c.map(e=>(0,i.jsx)(r.SelectItem,{disabled:s.includes(e.value),value:e.value,children:e.label},e.value))})]}),!!d&&(0,i.jsx)(n.FormDescription,{children:d}),u&&(0,i.jsx)(n.FormMessage,{})]})});exports.SelectField=a;
|
|
2
2
|
//# sourceMappingURL=select-field.cjs.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/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_runtime7.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_runtime3 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_runtime3.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{cn as e}from"../utils-D9AH0PUV.js";import"../label-
|
|
1
|
+
"use client";import{cn as e}from"../utils-D9AH0PUV.js";import"../label-D6HPmJBN.js";import{FormControl as t,FormDescription as n,FormField as r,FormItem as i,FormLabel as a,FormMessage as o}from"../form-BURcRgfV.js";import{Select as s,SelectContent as c,SelectItem as l,SelectTrigger as u,SelectValue as d}from"../select-CFwOPSRe.js";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(r,{name:m,render:({field:r})=>p(i,{className:e(`w-full`,S),children:[y&&f(a,{children:h}),p(s,{defaultValue:r.value,onValueChange:r.onChange,children:[f(t,{children:f(u,{className:`w-full`,children:f(d,{placeholder:g})})}),f(c,{children:v.map(e=>f(l,{disabled:_.includes(e.value),value:e.value,children:e.label},e.value))})]}),!!x&&f(n,{children:x}),b&&f(o,{})]})});export{m as SelectField};
|
|
2
2
|
//# sourceMappingURL=select-field.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require(`../chunk-CUT6urMc.cjs`),t=require(`../utils-BsjVK5EW.cjs`);require(`../label-
|
|
1
|
+
"use client";const e=require(`../chunk-CUT6urMc.cjs`),t=require(`../utils-BsjVK5EW.cjs`);require(`../label-BJkXZ3TJ.cjs`);const n=require(`../form-DxHTpatW.cjs`),r=require(`../switch-qWUhH4Jx.cjs`),i=e.__toESM(require(`react/jsx-runtime`)),a=({name:e,label:a=`Switch Field`,description:o,isShowErrorMsg:s=!1})=>(0,i.jsx)(n.FormField,{name:e,render:({field:e})=>(0,i.jsxs)(`div`,{className:`spage-y-1`,children:[(0,i.jsxs)(n.FormItem,{className:t.cn(`border-border-weak flex flex-row items-center justify-between rounded-lg border p-3 shadow-xs`),children:[(0,i.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,i.jsx)(n.FormLabel,{className:`cursor-pointer text-sm`,children:a}),o&&(0,i.jsx)(n.FormDescription,{className:`text-xs`,children:o})]}),(0,i.jsx)(n.FormControl,{children:(0,i.jsx)(r.Switch,{checked:e.value,onCheckedChange:e.onChange})})]}),s&&(0,i.jsx)(n.FormMessage,{})]})});exports.SwitchField=a;
|
|
2
2
|
//# sourceMappingURL=switch-field.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime37 from "react/jsx-runtime";
|
|
2
2
|
import { FieldPath, FieldValues } from "react-hook-form";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/forms/switch-field.d.ts
|
|
@@ -13,7 +13,7 @@ declare const SwitchField: <TFieldValues extends FieldValues = FieldValues>({
|
|
|
13
13
|
label,
|
|
14
14
|
description,
|
|
15
15
|
isShowErrorMsg
|
|
16
|
-
}: Props<TFieldValues>) =>
|
|
16
|
+
}: Props<TFieldValues>) => react_jsx_runtime37.JSX.Element;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { SwitchField };
|
|
19
19
|
//# sourceMappingURL=switch-field.d.cts.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/switch-field.d.ts
|
|
@@ -13,7 +13,7 @@ declare const SwitchField: <TFieldValues extends FieldValues = FieldValues>({
|
|
|
13
13
|
label,
|
|
14
14
|
description,
|
|
15
15
|
isShowErrorMsg
|
|
16
|
-
}: Props<TFieldValues>) =>
|
|
16
|
+
}: Props<TFieldValues>) => react_jsx_runtime0.JSX.Element;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { SwitchField };
|
|
19
19
|
//# sourceMappingURL=switch-field.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{cn as e}from"../utils-D9AH0PUV.js";import"../label-
|
|
1
|
+
"use client";import{cn as e}from"../utils-D9AH0PUV.js";import"../label-D6HPmJBN.js";import{FormControl as t,FormDescription as n,FormField as r,FormItem as i,FormLabel as a,FormMessage as o}from"../form-BURcRgfV.js";import{Switch as s}from"../switch-CgOE6qbi.js";import{jsx as c,jsxs as l}from"react/jsx-runtime";const u=({name:u,label:d=`Switch Field`,description:f,isShowErrorMsg:p=!1})=>c(r,{name:u,render:({field:r})=>l(`div`,{className:`spage-y-1`,children:[l(i,{className:e(`border-border-weak flex flex-row items-center justify-between rounded-lg border p-3 shadow-xs`),children:[l(`div`,{className:`space-y-0.5`,children:[c(a,{className:`cursor-pointer text-sm`,children:d}),f&&c(n,{className:`text-xs`,children:f})]}),c(t,{children:c(s,{checked:r.value,onCheckedChange:r.onChange})})]}),p&&c(o,{})]})});export{u as SwitchField};
|
|
2
2
|
//# sourceMappingURL=switch-field.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require(`../chunk-CUT6urMc.cjs`),t=require(`../utils-BsjVK5EW.cjs`)
|
|
1
|
+
"use client";const e=require(`../chunk-CUT6urMc.cjs`),t=require(`../utils-BsjVK5EW.cjs`);require(`../label-BJkXZ3TJ.cjs`);const n=require(`../form-DxHTpatW.cjs`),r=require(`../input-DahIflvq.cjs`),i=require(`../flex-BuUVu_Lf.cjs`),a=e.__toESM(require(`react`)),o=e.__toESM(require(`lucide-react`)),s=e.__toESM(require(`react/jsx-runtime`)),c=e.__toESM(require(`react-hook-form`)),l=({name:e,label:l=`Text Field`,placeholder:u=`Enter text here`,isShowLabel:d=!0,isShowClearButton:f=!1,isShowErrorMsg:p=!1,isShowCount:m=!1,description:h,className:g=``,onValueChange:_})=>{let{resetField:v}=n.useFormField(),y=(0,c.useWatch)({name:e}),b=a.default.useCallback(()=>{v(e)},[v,e]);return(0,s.jsx)(n.FormField,{name:e,render:({field:e})=>(0,s.jsxs)(n.FormItem,{className:t.cn(`w-full gap-0`,m||!!h&&`space-y-1`,g),children:[d&&(0,s.jsx)(n.FormLabel,{children:l}),(0,s.jsxs)(`div`,{className:`relative`,children:[(0,s.jsx)(n.FormControl,{children:(0,s.jsx)(r.Input,{...e,placeholder:u,className:t.cn(`w-full`,f&&`pr-9`),onValueChange:_})}),f&&y&&(0,s.jsx)(`button`,{type:`button`,className:`text-muted-foreground/80 hover:text-accent-foreground focus-visible:ring-border absolute inset-y-0 end-0 flex h-full w-8 cursor-pointer items-center justify-center rounded-e-md transition-[color,box-shadow] outline-none focus:z-10 focus-visible:ring-2`,"aria-label":`Clear input`,onClick:b,children:(0,s.jsx)(o.XIcon,{size:14,"aria-hidden":`true`})})]}),(0,s.jsxs)(i.Flex,{width:`full`,padding:`none`,justify:`end`,children:[p&&(0,s.jsx)(n.FormMessage,{className:`grow`}),m&&(0,s.jsxs)(`div`,{className:`text-muted-foreground text-end text-xs`,children:[y?.length??0,` characters`]})]}),!!h&&(0,s.jsx)(n.FormDescription,{children:h})]})})};exports.TextField=l;
|
|
2
2
|
//# sourceMappingURL=text-field.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime15 from "react/jsx-runtime";
|
|
2
2
|
import { FieldPath, FieldValues } from "react-hook-form";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/forms/text-field.d.ts
|
|
@@ -25,7 +25,7 @@ declare const TextField: <TFieldValues extends FieldValues = FieldValues>({
|
|
|
25
25
|
description,
|
|
26
26
|
className,
|
|
27
27
|
onValueChange
|
|
28
|
-
}: Props<TFieldValues>) =>
|
|
28
|
+
}: Props<TFieldValues>) => react_jsx_runtime15.JSX.Element;
|
|
29
29
|
//#endregion
|
|
30
30
|
export { TextField };
|
|
31
31
|
//# sourceMappingURL=text-field.d.cts.map
|
package/dist/forms/text-field.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{cn as e}from"../utils-D9AH0PUV.js";import
|
|
1
|
+
"use client";import{cn as e}from"../utils-D9AH0PUV.js";import"../label-D6HPmJBN.js";import{FormControl as t,FormDescription as n,FormField as r,FormItem as i,FormLabel as a,FormMessage as o,useFormField as s}from"../form-BURcRgfV.js";import{Input as c}from"../input-YG15tKEM.js";import{Flex as l}from"../flex-uO6z0kNw.js";import u from"react";import{XIcon as d}from"lucide-react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{useWatch as m}from"react-hook-form";const h=({name:h,label:g=`Text Field`,placeholder:_=`Enter text here`,isShowLabel:v=!0,isShowClearButton:y=!1,isShowErrorMsg:b=!1,isShowCount:x=!1,description:S,className:C=``,onValueChange:w})=>{let{resetField:T}=s(),E=m({name:h}),D=u.useCallback(()=>{T(h)},[T,h]);return f(r,{name:h,render:({field:r})=>p(i,{className:e(`w-full gap-0`,x||!!S&&`space-y-1`,C),children:[v&&f(a,{children:g}),p(`div`,{className:`relative`,children:[f(t,{children:f(c,{...r,placeholder:_,className:e(`w-full`,y&&`pr-9`),onValueChange:w})}),y&&E&&f(`button`,{type:`button`,className:`text-muted-foreground/80 hover:text-accent-foreground focus-visible:ring-border absolute inset-y-0 end-0 flex h-full w-8 cursor-pointer items-center justify-center rounded-e-md transition-[color,box-shadow] outline-none focus:z-10 focus-visible:ring-2`,"aria-label":`Clear input`,onClick:D,children:f(d,{size:14,"aria-hidden":`true`})})]}),p(l,{width:`full`,padding:`none`,justify:`end`,children:[b&&f(o,{className:`grow`}),x&&p(`div`,{className:`text-muted-foreground text-end text-xs`,children:[E?.length??0,` characters`]})]}),!!S&&f(n,{children:S})]})})};export{h as TextField};
|
|
2
2
|
//# sourceMappingURL=text-field.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require(`../chunk-CUT6urMc.cjs`);require(`../utils-BsjVK5EW.cjs`),require(`../label-
|
|
1
|
+
"use client";const e=require(`../chunk-CUT6urMc.cjs`);require(`../utils-BsjVK5EW.cjs`),require(`../label-BJkXZ3TJ.cjs`);const t=require(`../form-DxHTpatW.cjs`),n=require(`../textarea-DCzz0uEq.cjs`),r=e.__toESM(require(`react/jsx-runtime`)),i=e.__toESM(require(`react-hook-form`)),a=({name:e,label:a=`Textarea Field`,placeholder:o=`Enter text here`,isShowErrorMsg:s=!1,isShowCount:c=!1,description:l,rows:u=3,onValueChange:d})=>{let f=(0,i.useWatch)({name:e});return(0,r.jsx)(t.FormField,{name:e,render:({field:e})=>(0,r.jsxs)(t.FormItem,{className:`w-full`,children:[(0,r.jsx)(t.FormLabel,{children:a}),(0,r.jsx)(t.FormControl,{children:(0,r.jsx)(n.Textarea,{...e,placeholder:o,className:`w-full`,rows:u,onValueChange:d})}),c&&(0,r.jsxs)(`div`,{className:`text-muted-foreground text-end text-xs`,children:[f?.length??0,` characters`]}),!!l&&(0,r.jsx)(t.FormDescription,{children:l}),s&&(0,r.jsx)(t.FormMessage,{})]})})};exports.TextareaField=a;
|
|
2
2
|
//# sourceMappingURL=textarea-field.cjs.map
|