@egose/shadcn-theme 0.1.10 → 0.1.12
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/LICENSE +201 -0
- package/README.md +88 -29
- package/{chunk-GBNJFKPB.js → chunk-26NBTW3I.js} +3 -3
- package/{chunk-7PX7GVOR.mjs → chunk-2EXZ4JQX.mjs} +2 -2
- package/{chunk-YJR5JBXS.js → chunk-36GT5EGU.js} +3 -3
- package/{chunk-7ZMTJBXT.mjs → chunk-3NMW42UR.mjs} +7 -7
- package/{chunk-AGPEWIPR.mjs → chunk-3R2OBHS6.mjs} +5 -5
- package/{chunk-QCHBJMD6.mjs → chunk-3R7FZDQ7.mjs} +2 -2
- package/{chunk-PS3LNHTA.js → chunk-3RQTEIV5.js} +3 -3
- package/{chunk-E7F5KADG.mjs → chunk-3YFVUGSK.mjs} +2 -2
- package/{chunk-7MDWTJEP.mjs → chunk-42IQSRLZ.mjs} +2 -2
- package/{chunk-GV62APQ6.js → chunk-5CUM73VT.js} +3 -3
- package/{chunk-P4EDRIBH.js → chunk-5LDEF3T6.js} +44 -44
- package/{chunk-HWDU5KVD.mjs → chunk-6M7NWFTI.mjs} +4 -4
- package/{chunk-CNYC22IA.mjs → chunk-6SAR4RAU.mjs} +4 -4
- package/{chunk-XMRJIUYX.mjs → chunk-7DB2YNKV.mjs} +2 -2
- package/{chunk-RPF753T2.mjs → chunk-7S5XDE3W.mjs} +2 -2
- package/{chunk-OMQVDSR6.js → chunk-A4VKE26S.js} +4 -4
- package/{chunk-WK4MG4VT.js → chunk-AH57ACVP.js} +6 -6
- package/{chunk-4BKWF5FK.js → chunk-AIZ3XYAI.js} +6 -6
- package/{chunk-RFORRZRN.js → chunk-AOGFHEQH.js} +11 -11
- package/{chunk-6ECNY4VS.mjs → chunk-ASPR3W6A.mjs} +4 -4
- package/{chunk-OVHPXYDN.mjs → chunk-B6SBEOMV.mjs} +2 -2
- package/{chunk-ZFSZ6K4K.js → chunk-BGITSWS4.js} +1 -1
- package/{chunk-WJBTXKFN.js → chunk-BIO4TVNT.js} +14 -14
- package/{chunk-RJVQU443.mjs → chunk-BKUEN3CP.mjs} +6 -6
- package/{chunk-OUVM5NST.js → chunk-BM53W77T.js} +9 -9
- package/{chunk-JZXOJAMQ.js → chunk-C4JWWUXI.js} +8 -8
- package/{chunk-IYVLRZJ4.js → chunk-C74J4JWA.js} +1 -1
- package/{chunk-OPNHC6JN.mjs → chunk-CFG4GTRV.mjs} +3 -3
- package/{chunk-YQENFZOY.mjs → chunk-CHV7CG5L.mjs} +2 -2
- package/{chunk-UFRPUC7K.js → chunk-CRBQL2FG.js} +3 -3
- package/{chunk-K4JVHEI2.js → chunk-CZZWPS2I.js} +3 -3
- package/{chunk-LAIO3QZX.js → chunk-DD3MCW6L.js} +17 -17
- package/{chunk-WXEEDLLR.js → chunk-DNOZXQ2U.js} +15 -15
- package/{chunk-BJK4J4VY.js → chunk-DYYTK4BP.js} +7 -7
- package/{chunk-N7JSYNXM.js → chunk-FUFUQWRV.js} +1 -1
- package/{chunk-LPDYWZN6.js → chunk-GOATL3D5.js} +14 -14
- package/{chunk-VBPJD7U3.js → chunk-HCWYPASJ.js} +13 -13
- package/{chunk-SX4LQFOF.mjs → chunk-HD7GX5UE.mjs} +1 -1
- package/{chunk-6POWZMND.js → chunk-HDO7OG7I.js} +3 -3
- package/{chunk-AQIBLBXW.js → chunk-I4ICCNHG.js} +9 -9
- package/{chunk-KB6BX6LA.js → chunk-IEPLSUBR.js} +5 -5
- package/{chunk-NMJ6372G.js → chunk-IOCZ25V7.js} +11 -11
- package/{chunk-FOEQYO2Q.js → chunk-JXITZDN4.js} +15 -15
- package/{chunk-6CRGZEQF.js → chunk-JYRR3NKH.js} +9 -9
- package/{chunk-Z342XYFY.js → chunk-KDDWHY5M.js} +6 -6
- package/{chunk-KGUUDFJE.mjs → chunk-KKCJ2GMO.mjs} +1 -1
- package/{chunk-4IDPSNL3.mjs → chunk-KS7PUPPU.mjs} +9 -9
- package/{chunk-RNKMPQDZ.mjs → chunk-L7EN73HA.mjs} +4 -4
- package/{chunk-NCJI2DCV.mjs → chunk-LBOUUQFM.mjs} +3 -3
- package/{chunk-RIBB6GXJ.mjs → chunk-MBDPHX4P.mjs} +3 -3
- package/{chunk-77MASFCZ.mjs → chunk-MLXTZKBJ.mjs} +1 -1
- package/{chunk-4ETXRZKO.js → chunk-MMD72AEX.js} +8 -8
- package/{chunk-O6PHWGJH.mjs → chunk-MP7OH5ZP.mjs} +2 -2
- package/{chunk-HTEQHRTK.mjs → chunk-MSZ2AHQM.mjs} +2 -2
- package/{chunk-CSL3CTEN.mjs → chunk-N3WWOWZ4.mjs} +2 -2
- package/{chunk-PSPAJNNB.js → chunk-NBQEF4JD.js} +1 -1
- package/{chunk-QMLV5G5Z.js → chunk-NDH24NNQ.js} +37 -37
- package/{chunk-P4DW3EEW.mjs → chunk-NPEOZHKQ.mjs} +4 -4
- package/{chunk-GUB2Y4JK.mjs → chunk-NQQR2NDC.mjs} +3 -3
- package/{chunk-ZEZK2FJ4.mjs → chunk-O6E6RGZT.mjs} +1 -1
- package/{chunk-QF6PFV6M.mjs → chunk-OXUVPYJE.mjs} +2 -2
- package/{chunk-CKGMFUU2.js → chunk-OZAVO5UA.js} +3 -3
- package/{chunk-US2CUADK.mjs → chunk-OZF3JOG4.mjs} +4 -4
- package/{chunk-ICOZ5BK7.mjs → chunk-PBCJ476S.mjs} +3 -3
- package/{chunk-OXCN3BD6.mjs → chunk-PODBONNQ.mjs} +2 -2
- package/{chunk-5CBMRDT7.mjs → chunk-PW4ITUWI.mjs} +3 -3
- package/{chunk-F2QWMBUB.mjs → chunk-Q23ZKF2E.mjs} +2 -2
- package/{chunk-K23YFVYE.mjs → chunk-QFLEJVD3.mjs} +4 -4
- package/{chunk-XVWILFYQ.mjs → chunk-RG3G5IZC.mjs} +2 -2
- package/{chunk-PDB2VCWX.mjs → chunk-RKVMGHH3.mjs} +1 -1
- package/{chunk-WKQDHQAS.js → chunk-RV4AOZUL.js} +10 -10
- package/{chunk-7BYWDRRI.mjs → chunk-S2LLOGBR.mjs} +3 -3
- package/{chunk-VHYQNTH7.mjs → chunk-S7HB64F7.mjs} +4 -4
- package/{chunk-TTCGK36S.js → chunk-SOJSGQJO.js} +8 -8
- package/{chunk-YEGS4ETW.js → chunk-SSBVBEDI.js} +12 -12
- package/{chunk-FD7CNCJW.mjs → chunk-SVZMGPZC.mjs} +4 -4
- package/{chunk-VYXQVM7A.js → chunk-TGQA25KR.js} +6 -6
- package/{chunk-3HZTA2ZQ.js → chunk-UHYOQN4B.js} +11 -11
- package/{chunk-K3LYDDTD.js → chunk-VHXALM6O.js} +5 -5
- package/{chunk-ZFBUIBJH.mjs → chunk-VQWCEF3I.mjs} +4 -4
- package/{chunk-4SYFVOM2.js → chunk-VRY6WSXJ.js} +1 -1
- package/{chunk-2YMMYND2.js → chunk-VVU3Q7KV.js} +3 -3
- package/chunk-VYBFV2QD.js +31 -0
- package/{chunk-QHCOMBHI.js → chunk-W4ZJYYQP.js} +6 -6
- package/{chunk-3JPKE36M.mjs → chunk-W7CX2O2V.mjs} +8 -8
- package/{chunk-NMYVYLKF.js → chunk-W7PK2KN7.js} +3 -3
- package/{chunk-UQW3H2JS.js → chunk-WEZTFUOR.js} +7 -7
- package/chunk-WJKG5MUH.mjs +30 -0
- package/{chunk-X3V6YE47.mjs → chunk-WR7C2Q2O.mjs} +1 -1
- package/{chunk-G6WKPZTL.js → chunk-X3FLPO26.js} +10 -10
- package/{chunk-YDRPNCWF.mjs → chunk-XH7WQWOD.mjs} +5 -5
- package/{chunk-A4FV6TTM.js → chunk-XR7BY66N.js} +1 -1
- package/{chunk-UKPBHVOT.js → chunk-XWASPFJ7.js} +11 -11
- package/{chunk-7MDE2NEO.mjs → chunk-YAFFRILU.mjs} +2 -2
- package/{chunk-MM5OJOOR.mjs → chunk-YHL7Q5J3.mjs} +2 -2
- package/{chunk-RJG7QLDD.js → chunk-YMBEAV7N.js} +3 -3
- package/{chunk-BMAIJZN6.js → chunk-ZE53QYI6.js} +3 -3
- package/{chunk-3GHC4JQU.mjs → chunk-ZJRJN2UJ.mjs} +2 -2
- package/{chunk-WIISPZZE.mjs → chunk-ZLGQUL4Y.mjs} +2 -2
- package/{chunk-BEPAUXCN.mjs → chunk-ZSHUAH66.mjs} +4 -4
- package/components/form/checkbox.js +5 -5
- package/components/form/checkbox.mjs +4 -4
- package/components/form/date-picker.js +9 -9
- package/components/form/date-picker.mjs +8 -8
- package/components/form/date-range-picker.js +13 -13
- package/components/form/date-range-picker.mjs +7 -7
- package/components/form/error.js +3 -3
- package/components/form/error.mjs +2 -2
- package/components/form/hook-checkbox.d.mts +7 -5
- package/components/form/hook-checkbox.d.ts +7 -5
- package/components/form/hook-checkbox.js +21 -13
- package/components/form/hook-checkbox.js.map +1 -1
- package/components/form/hook-checkbox.mjs +16 -8
- package/components/form/hook-checkbox.mjs.map +1 -1
- package/components/form/hook-date-picker.js +12 -12
- package/components/form/hook-date-picker.mjs +9 -9
- package/components/form/hook-multi-select.js +17 -17
- package/components/form/hook-multi-select.mjs +14 -14
- package/components/form/hook-native-select.d.mts +7 -4
- package/components/form/hook-native-select.d.ts +7 -4
- package/components/form/hook-native-select.js +22 -15
- package/components/form/hook-native-select.js.map +1 -1
- package/components/form/hook-native-select.mjs +17 -10
- package/components/form/hook-native-select.mjs.map +1 -1
- package/components/form/hook-searchable-select.js +15 -15
- package/components/form/hook-searchable-select.mjs +12 -12
- package/components/form/hook-select.js +8 -8
- package/components/form/hook-select.mjs +5 -5
- package/components/form/hook-tag-picker.js +9 -9
- package/components/form/hook-tag-picker.mjs +6 -6
- package/components/form/hook-text-input.d.mts +7 -4
- package/components/form/hook-text-input.d.ts +7 -4
- package/components/form/hook-text-input.js +36 -16
- package/components/form/hook-text-input.js.map +1 -1
- package/components/form/hook-text-input.mjs +31 -11
- package/components/form/hook-text-input.mjs.map +1 -1
- package/components/form/hook-textarea.d.mts +7 -4
- package/components/form/hook-textarea.d.ts +7 -4
- package/components/form/hook-textarea.js +30 -16
- package/components/form/hook-textarea.js.map +1 -1
- package/components/form/hook-textarea.mjs +25 -11
- package/components/form/hook-textarea.mjs.map +1 -1
- package/components/form/hook-time-input.d.mts +7 -5
- package/components/form/hook-time-input.d.ts +7 -5
- package/components/form/hook-time-input.js +36 -15
- package/components/form/hook-time-input.js.map +1 -1
- package/components/form/hook-time-input.mjs +31 -10
- package/components/form/hook-time-input.mjs.map +1 -1
- package/components/form/multi-select.js +14 -14
- package/components/form/multi-select.mjs +13 -13
- package/components/form/native-select.js +4 -4
- package/components/form/native-select.mjs +3 -3
- package/components/form/searchable-select.js +12 -12
- package/components/form/searchable-select.mjs +11 -11
- package/components/form/select.js +5 -5
- package/components/form/select.mjs +4 -4
- package/components/form/tag-picker.js +6 -6
- package/components/form/tag-picker.mjs +5 -5
- package/components/form/text-input.d.mts +12 -0
- package/components/form/text-input.d.ts +12 -0
- package/components/form/text-input.js +5 -5
- package/components/form/text-input.mjs +4 -4
- package/components/form/textarea.js +5 -5
- package/components/form/textarea.mjs +4 -4
- package/components/form/time-input.js +7 -7
- package/components/form/time-input.mjs +6 -6
- package/components/form/types.d.mts +18 -2
- package/components/form/types.d.ts +18 -2
- package/components/form/types.js +12 -1
- package/components/form/types.js.map +1 -1
- package/components/form/types.mjs +11 -0
- package/components/ui/accordion.js +5 -5
- package/components/ui/accordion.mjs +1 -1
- package/components/ui/alert-dialog.js +12 -12
- package/components/ui/alert-dialog.mjs +3 -3
- package/components/ui/alert.d.mts +1 -1
- package/components/ui/alert.d.ts +1 -1
- package/components/ui/alert.js +3 -3
- package/components/ui/alert.mjs +2 -2
- package/components/ui/avatar.js +3 -3
- package/components/ui/avatar.mjs +2 -2
- package/components/ui/badge.js +3 -3
- package/components/ui/badge.mjs +2 -2
- package/components/ui/basic-alert.js +3 -3
- package/components/ui/basic-alert.mjs +2 -2
- package/components/ui/breadcrumb.js +3 -3
- package/components/ui/breadcrumb.mjs +2 -2
- package/components/ui/button-group.js +6 -6
- package/components/ui/button-group.mjs +2 -2
- package/components/ui/button.d.mts +23 -0
- package/components/ui/button.d.ts +23 -0
- package/components/ui/button.js +4 -4
- package/components/ui/button.mjs +3 -3
- package/components/ui/calendar.js +5 -5
- package/components/ui/calendar.mjs +4 -4
- package/components/ui/card.js +8 -8
- package/components/ui/card.mjs +1 -1
- package/components/ui/carousel.js +10 -10
- package/components/ui/carousel.mjs +3 -3
- package/components/ui/checkbox.js +3 -3
- package/components/ui/checkbox.mjs +2 -2
- package/components/ui/combobox.js +22 -22
- package/components/ui/combobox.mjs +6 -6
- package/components/ui/command.js +9 -9
- package/components/ui/command.mjs +8 -8
- package/components/ui/context-menu.js +11 -11
- package/components/ui/context-menu.mjs +1 -1
- package/components/ui/copy-button.js +8 -8
- package/components/ui/copy-button.mjs +3 -3
- package/components/ui/dialog.js +5 -5
- package/components/ui/dialog.mjs +4 -4
- package/components/ui/drawer.js +7 -7
- package/components/ui/drawer.mjs +1 -1
- package/components/ui/dropdown-menu.js +3 -3
- package/components/ui/dropdown-menu.mjs +2 -2
- package/components/ui/empty.js +7 -7
- package/components/ui/empty.mjs +1 -1
- package/components/ui/extension/file-input.js +5 -5
- package/components/ui/extension/file-input.mjs +4 -4
- package/components/ui/field.js +15 -15
- package/components/ui/field.mjs +3 -3
- package/components/ui/hover-card.js +2 -2
- package/components/ui/hover-card.mjs +1 -1
- package/components/ui/input-group.js +7 -7
- package/components/ui/input-group.mjs +6 -6
- package/components/ui/input-otp.js +5 -5
- package/components/ui/input-otp.mjs +1 -1
- package/components/ui/input.js +3 -3
- package/components/ui/input.mjs +2 -2
- package/components/ui/item.js +12 -12
- package/components/ui/item.mjs +2 -2
- package/components/ui/kbd.js +3 -3
- package/components/ui/kbd.mjs +1 -1
- package/components/ui/label.js +3 -3
- package/components/ui/label.mjs +2 -2
- package/components/ui/menubar.js +12 -12
- package/components/ui/menubar.mjs +1 -1
- package/components/ui/multi-select.d.mts +1 -1
- package/components/ui/multi-select.d.ts +1 -1
- package/components/ui/multi-select.js +11 -11
- package/components/ui/multi-select.mjs +10 -10
- package/components/ui/native-select.js +3 -3
- package/components/ui/native-select.mjs +1 -1
- package/components/ui/navigation-menu.js +10 -10
- package/components/ui/navigation-menu.mjs +1 -1
- package/components/ui/pagination.js +9 -9
- package/components/ui/pagination.mjs +3 -3
- package/components/ui/popover.js +3 -3
- package/components/ui/popover.mjs +2 -2
- package/components/ui/progress.js +2 -2
- package/components/ui/progress.mjs +1 -1
- package/components/ui/radio-group.js +3 -3
- package/components/ui/radio-group.mjs +1 -1
- package/components/ui/resizable.js +3 -3
- package/components/ui/resizable.mjs +1 -1
- package/components/ui/scroll-area.js +3 -3
- package/components/ui/scroll-area.mjs +1 -1
- package/components/ui/select.js +3 -3
- package/components/ui/select.mjs +2 -2
- package/components/ui/separator.js +3 -3
- package/components/ui/separator.mjs +2 -2
- package/components/ui/sheet.js +5 -5
- package/components/ui/sheet.mjs +4 -4
- package/components/ui/sidebar.js +11 -11
- package/components/ui/sidebar.mjs +10 -10
- package/components/ui/skeleton.js +3 -3
- package/components/ui/skeleton.mjs +2 -2
- package/components/ui/slider.js +2 -2
- package/components/ui/slider.mjs +1 -1
- package/components/ui/spinner.js +3 -3
- package/components/ui/spinner.mjs +2 -2
- package/components/ui/switch.js +2 -2
- package/components/ui/switch.mjs +1 -1
- package/components/ui/table.js +9 -9
- package/components/ui/table.mjs +1 -1
- package/components/ui/tabs.js +5 -5
- package/components/ui/tabs.mjs +1 -1
- package/components/ui/tag-picker.js +4 -4
- package/components/ui/tag-picker.mjs +3 -3
- package/components/ui/textarea.js +3 -3
- package/components/ui/textarea.mjs +2 -2
- package/components/ui/toggle-group.js +5 -5
- package/components/ui/toggle-group.mjs +2 -2
- package/components/ui/toggle.js +3 -3
- package/components/ui/toggle.mjs +2 -2
- package/components/ui/tooltip.js +3 -3
- package/components/ui/tooltip.mjs +2 -2
- package/components/widgets/dialog-manager/context.d.mts +26 -0
- package/components/widgets/dialog-manager/context.d.ts +26 -0
- package/components/widgets/dialog-manager/context.js +2 -2
- package/components/widgets/dialog-manager/context.mjs +1 -1
- package/components/widgets/dialog-manager/index.js +3 -3
- package/components/widgets/dialog-manager/index.mjs +2 -2
- package/components/widgets/dialog-manager/provider.d.mts +13 -0
- package/components/widgets/dialog-manager/provider.d.ts +13 -0
- package/components/widgets/dialog-manager/provider.js +3 -3
- package/components/widgets/dialog-manager/provider.mjs +2 -2
- package/components/widgets/dialog-manager/types.d.mts +10 -0
- package/components/widgets/dialog-manager/types.d.ts +10 -0
- package/hooks/use-clipboard.d.mts +12 -0
- package/hooks/use-clipboard.d.ts +12 -0
- package/hooks/use-clipboard.js +2 -2
- package/hooks/use-clipboard.mjs +1 -1
- package/hooks/use-mobile.d.mts +5 -0
- package/hooks/use-mobile.d.ts +5 -0
- package/hooks/use-mobile.js +2 -2
- package/hooks/use-mobile.mjs +1 -1
- package/layouts/sidebar1/app-sidebar.d.mts +12 -0
- package/layouts/sidebar1/app-sidebar.d.ts +12 -0
- package/layouts/sidebar1/app-sidebar.js +17 -17
- package/layouts/sidebar1/app-sidebar.mjs +16 -16
- package/layouts/sidebar1/context-switcher.js +13 -13
- package/layouts/sidebar1/context-switcher.mjs +12 -12
- package/layouts/sidebar1/index.d.mts +22 -0
- package/layouts/sidebar1/index.d.ts +22 -0
- package/layouts/sidebar1/index.js +23 -23
- package/layouts/sidebar1/index.js.map +1 -1
- package/layouts/sidebar1/index.mjs +17 -17
- package/layouts/sidebar1/index.mjs.map +1 -1
- package/layouts/sidebar1/nav-menus.js +12 -12
- package/layouts/sidebar1/nav-menus.mjs +11 -11
- package/layouts/sidebar1/nav-user.d.mts +9 -0
- package/layouts/sidebar1/nav-user.d.ts +9 -0
- package/layouts/sidebar1/nav-user.js +14 -14
- package/layouts/sidebar1/nav-user.mjs +13 -13
- package/layouts/simple/index.d.mts +23 -0
- package/layouts/simple/index.d.ts +23 -0
- package/layouts/simple/index.js +17 -17
- package/layouts/simple/index.js.map +1 -1
- package/layouts/simple/index.mjs +6 -6
- package/layouts/simple/index.mjs.map +1 -1
- package/layouts/simple/mobile-menu.js +3 -3
- package/layouts/simple/mobile-menu.mjs +2 -2
- package/layouts/simple/types.d.mts +11 -0
- package/layouts/simple/types.d.ts +11 -0
- package/layouts/simple/user-menu.js +4 -4
- package/layouts/simple/user-menu.mjs +3 -3
- package/llms.txt +102 -0
- package/package.json +96 -16
- package/utils/date.d.mts +9 -0
- package/utils/date.d.ts +9 -0
- package/utils/date.js +2 -2
- package/utils/date.mjs +1 -1
- package/utils/time.d.mts +12 -0
- package/utils/time.d.ts +12 -0
- package/utils/time.js +2 -2
- package/utils/time.mjs +1 -1
- package/utils/ui.d.mts +8 -0
- package/utils/ui.d.ts +8 -0
- package/utils/ui.js +2 -2
- package/utils/ui.mjs +1 -1
- package/chunk-2NMEKWO5.js.map +0 -1
- package/chunk-2YMMYND2.js.map +0 -1
- package/chunk-3GHC4JQU.mjs.map +0 -1
- package/chunk-3HZTA2ZQ.js.map +0 -1
- package/chunk-3JPKE36M.mjs.map +0 -1
- package/chunk-4BKWF5FK.js.map +0 -1
- package/chunk-4ETXRZKO.js.map +0 -1
- package/chunk-4IDPSNL3.mjs.map +0 -1
- package/chunk-4SYFVOM2.js.map +0 -1
- package/chunk-5CBMRDT7.mjs.map +0 -1
- package/chunk-5SLUBHNN.js.map +0 -1
- package/chunk-5TXFHYQ5.js.map +0 -1
- package/chunk-6CRGZEQF.js.map +0 -1
- package/chunk-6ECNY4VS.mjs.map +0 -1
- package/chunk-6POWZMND.js.map +0 -1
- package/chunk-6T6UTNWD.mjs.map +0 -1
- package/chunk-77MASFCZ.mjs.map +0 -1
- package/chunk-7BYWDRRI.mjs.map +0 -1
- package/chunk-7GZ7NWTV.js.map +0 -1
- package/chunk-7MDE2NEO.mjs.map +0 -1
- package/chunk-7MDWTJEP.mjs.map +0 -1
- package/chunk-7PX7GVOR.mjs.map +0 -1
- package/chunk-7ZMTJBXT.mjs.map +0 -1
- package/chunk-A4FV6TTM.js.map +0 -1
- package/chunk-AGPEWIPR.mjs.map +0 -1
- package/chunk-AQIBLBXW.js.map +0 -1
- package/chunk-B2Z7BNYW.mjs.map +0 -1
- package/chunk-BEPAUXCN.mjs.map +0 -1
- package/chunk-BJK4J4VY.js.map +0 -1
- package/chunk-BMAIJZN6.js.map +0 -1
- package/chunk-CKGMFUU2.js.map +0 -1
- package/chunk-CNYC22IA.mjs.map +0 -1
- package/chunk-CSL3CTEN.mjs.map +0 -1
- package/chunk-E7F5KADG.mjs.map +0 -1
- package/chunk-F2QWMBUB.mjs.map +0 -1
- package/chunk-FD7CNCJW.mjs.map +0 -1
- package/chunk-FOEQYO2Q.js.map +0 -1
- package/chunk-G6WKPZTL.js.map +0 -1
- package/chunk-GBNJFKPB.js.map +0 -1
- package/chunk-GUB2Y4JK.mjs.map +0 -1
- package/chunk-GV62APQ6.js.map +0 -1
- package/chunk-HTEQHRTK.mjs.map +0 -1
- package/chunk-HWDU5KVD.mjs.map +0 -1
- package/chunk-ICOZ5BK7.mjs.map +0 -1
- package/chunk-IYVLRZJ4.js.map +0 -1
- package/chunk-JZXOJAMQ.js.map +0 -1
- package/chunk-K23YFVYE.mjs.map +0 -1
- package/chunk-K3LYDDTD.js.map +0 -1
- package/chunk-K4JVHEI2.js.map +0 -1
- package/chunk-KB6BX6LA.js.map +0 -1
- package/chunk-KGUUDFJE.mjs.map +0 -1
- package/chunk-LAIO3QZX.js.map +0 -1
- package/chunk-LPDYWZN6.js.map +0 -1
- package/chunk-LVXIGNFJ.mjs.map +0 -1
- package/chunk-M6UKU56L.mjs.map +0 -1
- package/chunk-MM5OJOOR.mjs.map +0 -1
- package/chunk-N7JSYNXM.js.map +0 -1
- package/chunk-NCJI2DCV.mjs.map +0 -1
- package/chunk-NMJ6372G.js.map +0 -1
- package/chunk-NMYVYLKF.js.map +0 -1
- package/chunk-O6PHWGJH.mjs.map +0 -1
- package/chunk-OMQVDSR6.js.map +0 -1
- package/chunk-OPNHC6JN.mjs.map +0 -1
- package/chunk-OUVM5NST.js.map +0 -1
- package/chunk-OVHPXYDN.mjs.map +0 -1
- package/chunk-OXCN3BD6.mjs.map +0 -1
- package/chunk-P4DW3EEW.mjs.map +0 -1
- package/chunk-P4EDRIBH.js.map +0 -1
- package/chunk-PDB2VCWX.mjs.map +0 -1
- package/chunk-PS3LNHTA.js.map +0 -1
- package/chunk-PSPAJNNB.js.map +0 -1
- package/chunk-QCHBJMD6.mjs.map +0 -1
- package/chunk-QF6PFV6M.mjs.map +0 -1
- package/chunk-QHCOMBHI.js.map +0 -1
- package/chunk-QMLV5G5Z.js.map +0 -1
- package/chunk-RFORRZRN.js.map +0 -1
- package/chunk-RIBB6GXJ.mjs.map +0 -1
- package/chunk-RJG7QLDD.js.map +0 -1
- package/chunk-RJVQU443.mjs.map +0 -1
- package/chunk-RNKMPQDZ.mjs.map +0 -1
- package/chunk-RPF753T2.mjs.map +0 -1
- package/chunk-SC6IX6NJ.js.map +0 -1
- package/chunk-SX4LQFOF.mjs.map +0 -1
- package/chunk-TTCGK36S.js.map +0 -1
- package/chunk-UFRPUC7K.js.map +0 -1
- package/chunk-UKPBHVOT.js.map +0 -1
- package/chunk-UQW3H2JS.js.map +0 -1
- package/chunk-US2CUADK.mjs.map +0 -1
- package/chunk-VBPJD7U3.js.map +0 -1
- package/chunk-VHYQNTH7.mjs.map +0 -1
- package/chunk-VYXQVM7A.js.map +0 -1
- package/chunk-WIISPZZE.mjs.map +0 -1
- package/chunk-WJBTXKFN.js.map +0 -1
- package/chunk-WK4MG4VT.js.map +0 -1
- package/chunk-WKQDHQAS.js.map +0 -1
- package/chunk-WXEEDLLR.js.map +0 -1
- package/chunk-X3V6YE47.mjs.map +0 -1
- package/chunk-XMRJIUYX.mjs.map +0 -1
- package/chunk-XVWILFYQ.mjs.map +0 -1
- package/chunk-YDRPNCWF.mjs.map +0 -1
- package/chunk-YEGS4ETW.js.map +0 -1
- package/chunk-YJR5JBXS.js.map +0 -1
- package/chunk-YOSPWY5K.mjs.map +0 -1
- package/chunk-YQENFZOY.mjs.map +0 -1
- package/chunk-Z342XYFY.js.map +0 -1
- package/chunk-ZEZK2FJ4.mjs.map +0 -1
- package/chunk-ZFBUIBJH.mjs.map +0 -1
- package/chunk-ZFSZ6K4K.js.map +0 -1
|
@@ -2,15 +2,19 @@
|
|
|
2
2
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var _chunk6POWZMNDjs = require('../../chunk-6POWZMND.js');
|
|
6
5
|
|
|
6
|
+
var _chunkVYBFV2QDjs = require('../../chunk-VYBFV2QD.js');
|
|
7
7
|
|
|
8
|
-
var _chunkTTCGK36Sjs = require('../../chunk-TTCGK36S.js');
|
|
9
|
-
require('../../chunk-NMYVYLKF.js');
|
|
10
|
-
require('../../chunk-CKGMFUU2.js');
|
|
11
8
|
|
|
9
|
+
var _chunkHDO7OG7Ijs = require('../../chunk-HDO7OG7I.js');
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
|
|
12
|
+
var _chunkSOJSGQJOjs = require('../../chunk-SOJSGQJO.js');
|
|
13
|
+
require('../../chunk-W7PK2KN7.js');
|
|
14
|
+
require('../../chunk-OZAVO5UA.js');
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
var _chunkNBQEF4JDjs = require('../../chunk-NBQEF4JD.js');
|
|
14
18
|
|
|
15
19
|
|
|
16
20
|
|
|
@@ -27,6 +31,7 @@ function HookFormCheckbox(_a) {
|
|
|
27
31
|
name,
|
|
28
32
|
label,
|
|
29
33
|
rules,
|
|
34
|
+
required,
|
|
30
35
|
error,
|
|
31
36
|
disabled,
|
|
32
37
|
classNames
|
|
@@ -35,6 +40,7 @@ function HookFormCheckbox(_a) {
|
|
|
35
40
|
"name",
|
|
36
41
|
"label",
|
|
37
42
|
"rules",
|
|
43
|
+
"required",
|
|
38
44
|
"error",
|
|
39
45
|
"disabled",
|
|
40
46
|
"classNames"
|
|
@@ -48,33 +54,35 @@ function HookFormCheckbox(_a) {
|
|
|
48
54
|
const fieldError = _get3.default.call(void 0, errors, name);
|
|
49
55
|
const errorMessage = error != null ? error : fieldError == null ? void 0 : fieldError.message;
|
|
50
56
|
const showError = !!fieldError && !disabled;
|
|
51
|
-
|
|
57
|
+
const mergedRules = _chunkVYBFV2QDjs.mergeHookFormRules.call(void 0, rules, { required });
|
|
58
|
+
return /* @__PURE__ */ _react2.default.createElement("div", { className: _chunkNBQEF4JDjs.cn.call(void 0, "$hook-form-checkbox", classNames == null ? void 0 : classNames.wrapper) }, /* @__PURE__ */ _react2.default.createElement(
|
|
52
59
|
_reacthookform.Controller,
|
|
53
60
|
{
|
|
54
61
|
name,
|
|
55
62
|
control,
|
|
56
|
-
rules,
|
|
63
|
+
rules: mergedRules,
|
|
57
64
|
render: ({ field: { value, onChange } }) => /* @__PURE__ */ _react2.default.createElement(
|
|
58
|
-
|
|
59
|
-
_chunk2NMEKWO5js.__spreadValues.call(void 0, {
|
|
65
|
+
_chunkSOJSGQJOjs.FormCheckbox,
|
|
66
|
+
_chunk2NMEKWO5js.__spreadProps.call(void 0, _chunk2NMEKWO5js.__spreadValues.call(void 0, {}, rest), {
|
|
60
67
|
id,
|
|
61
68
|
name,
|
|
62
69
|
label,
|
|
70
|
+
required: _chunkVYBFV2QDjs.isValidationRuleEnabled.call(void 0, mergedRules == null ? void 0 : mergedRules.required),
|
|
63
71
|
disabled,
|
|
64
72
|
checked: value,
|
|
65
73
|
onCheckedChange: onChange,
|
|
66
74
|
classNames: _chunk2NMEKWO5js.__spreadProps.call(void 0, _chunk2NMEKWO5js.__spreadValues.call(void 0, {}, classNames), {
|
|
67
|
-
label:
|
|
75
|
+
label: _chunkNBQEF4JDjs.cn.call(void 0, classNames == null ? void 0 : classNames.label, {
|
|
68
76
|
"text-danger": showError
|
|
69
77
|
}),
|
|
70
|
-
checkbox:
|
|
78
|
+
checkbox: _chunkNBQEF4JDjs.cn.call(void 0, classNames == null ? void 0 : classNames.checkbox, {
|
|
71
79
|
"ring-danger text-danger": showError
|
|
72
80
|
})
|
|
73
81
|
})
|
|
74
|
-
}
|
|
82
|
+
})
|
|
75
83
|
)
|
|
76
84
|
}
|
|
77
|
-
), showError && /* @__PURE__ */ _react2.default.createElement(
|
|
85
|
+
), showError && /* @__PURE__ */ _react2.default.createElement(_chunkHDO7OG7Ijs.FormError, { field: name, className: "mt-1", message: errorMessage }));
|
|
78
86
|
}
|
|
79
87
|
|
|
80
88
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/jahn/projects/shadcn-theme/packages/react/dist/components/form/hook-checkbox.js","../../../components/form/hook-checkbox.tsx"],"names":[],"mappings":"AAAA,qLAAY;AACZ;AACE;AACF,0DAAgC;AAChC;AACE;AACF,0DAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC;AACE;AACF,0DAAgC;AAChC;AACE;AACA;AACA;AACF,0DAAgC;AAChC;AACA;
|
|
1
|
+
{"version":3,"sources":["/home/jahn/projects/shadcn-theme/packages/react/dist/components/form/hook-checkbox.js","../../../components/form/hook-checkbox.tsx"],"names":[],"mappings":"AAAA,qLAAY;AACZ;AACE;AACA;AACF,0DAAgC;AAChC;AACE;AACF,0DAAgC;AAChC;AACE;AACF,0DAAgC;AAChC,mCAAgC;AAChC,mCAAgC;AAChC;AACE;AACF,0DAAgC;AAChC;AACE;AACA;AACA;AACF,0DAAgC;AAChC;AACA;ACrBA,4EAAkB;AAClB,gFAAiB;AACjB,gDAA8D;AAmBvD,SAAS,gBAAA,CAAwC,EAAA,EAU3B;AAV2B,EAAA,IAAA,GAAA,EAAA,EAAA,EACtD;AAAA,IAAA,EAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,IACA;AAAA,EA9BF,EAAA,EAsBwD,EAAA,EASnD,KAAA,EAAA,wCAAA,EATmD,EASnD;AAAA,IARH,IAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;AAAA,IACA,OAAA;AAAA,IACA,UAAA;AAAA,IACA,OAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,EAAA,CAAA,CAAA;AAGA,EAAA,MAAM,QAAA,EAAU,2CAAA,CAAkB;AAClC,EAAA,GAAA,CAAI,CAAC,OAAA,EAAS,OAAO,IAAA;AAErB,EAAA,MAAM;AAAA,IACJ,OAAA;AAAA,IACA,SAAA,EAAW,EAAE,OAAO;AAAA,EACtB,EAAA,EAAI,OAAA;AAEJ,EAAA,MAAM,WAAA,EAAa,2BAAA,MAAK,EAAQ,IAAI,CAAA;AACpC,EAAA,MAAM,aAAA,EAAe,MAAA,GAAA,KAAA,EAAA,MAAA,EAAU,WAAA,GAAA,KAAA,EAAA,KAAA,EAAA,EAAA,UAAA,CAAY,OAAA;AAC3C,EAAA,MAAM,UAAA,EAAY,CAAC,CAAC,WAAA,GAAc,CAAC,QAAA;AACnC,EAAA,MAAM,YAAA,EAAc,iDAAA,KAAmB,EAAO,EAAE,SAAS,CAAC,CAAA;AAE1D,EAAA,uBACE,eAAA,CAAA,aAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,iCAAA,qBAAG,EAAuB,WAAA,GAAA,KAAA,EAAA,KAAA,EAAA,EAAA,UAAA,CAAY,OAAO,EAAA,CAAA,kBAC3D,eAAA,CAAA,aAAA;AAAA,IAAC,yBAAA;AAAA,IAAA;AAAA,MACC,IAAA;AAAA,MACA,OAAA;AAAA,MACA,KAAA,EAAO,WAAA;AAAA,MACP,MAAA,EAAQ,CAAC,EAAE,KAAA,EAAO,EAAE,KAAA,EAAO,SAAS,EAAE,CAAA,EAAA,mBACpC,eAAA,CAAA,aAAA;AAAA,QAAC,6BAAA;AAAA,QAAA,4CAAA,6CAAA,CAAA,CAAA,EACK,IAAA,CAAA,EADL;AAAA,UAEC,EAAA;AAAA,UACA,IAAA;AAAA,UACA,KAAA;AAAA,UACA,QAAA,EAAU,sDAAA,YAAwB,GAAA,KAAA,EAAA,KAAA,EAAA,EAAA,WAAA,CAAa,QAAQ,CAAA;AAAA,UACvD,QAAA;AAAA,UACA,OAAA,EAAS,KAAA;AAAA,UACT,eAAA,EAAiB,QAAA;AAAA,UACjB,UAAA,EAAY,4CAAA,6CAAA,CAAA,CAAA,EACP,UAAA,CAAA,EADO;AAAA,YAEV,KAAA,EAAO,iCAAA,WAAG,GAAA,KAAA,EAAA,KAAA,EAAA,EAAA,UAAA,CAAY,KAAA,EAAO;AAAA,cAC3B,aAAA,EAAe;AAAA,YACjB,CAAC,CAAA;AAAA,YACD,QAAA,EAAU,iCAAA,WAAG,GAAA,KAAA,EAAA,KAAA,EAAA,EAAA,UAAA,CAAY,QAAA,EAAU;AAAA,cACjC,yBAAA,EAA2B;AAAA,YAC7B,CAAC;AAAA,UACH,CAAA;AAAA,QAAA,CAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAEJ,CAAA,EACC,UAAA,mBAAa,eAAA,CAAA,aAAA,CAAC,0BAAA,EAAA,EAAU,KAAA,EAAO,IAAA,EAAM,SAAA,EAAU,MAAA,EAAO,OAAA,EAAS,aAAA,CAAc,CAChF,CAAA;AAEJ;ADQA;AACE;AACF,4CAAC","file":"/home/jahn/projects/shadcn-theme/packages/react/dist/components/form/hook-checkbox.js","sourcesContent":[null,"\"use client\";\nimport React from 'react';\nimport _get from 'lodash-es/get';\nimport { Controller, FieldValues, Path, useFormContext } from 'react-hook-form';\nimport { cn } from '../../utils/ui';\nimport { FormError } from './error';\nimport { FormCheckbox } from './checkbox';\nimport type { FormCheckboxProps } from './checkbox';\nimport { isValidationRuleEnabled, mergeHookFormRules } from './types';\nimport type { HookFormRules, HookFormValidationAttributes } from './types';\n\ntype HookFormCheckboxValidationAttributes = Pick<HookFormValidationAttributes, 'required'>;\n\ntype HookFormCheckboxProps<T extends FieldValues> = Omit<\n FormCheckboxProps,\n 'name' | 'checked' | 'onCheckedChange' | keyof HookFormCheckboxValidationAttributes\n> & {\n name: Path<T>;\n rules?: HookFormRules<T>;\n error?: string;\n} & HookFormCheckboxValidationAttributes;\n\nexport function HookFormCheckbox<T extends FieldValues>({\n id,\n name,\n label,\n rules,\n required,\n error,\n disabled,\n classNames,\n ...rest\n}: HookFormCheckboxProps<T>) {\n const methods = useFormContext<T>();\n if (!methods) return null;\n\n const {\n control,\n formState: { errors },\n } = methods;\n\n const fieldError = _get(errors, name);\n const errorMessage = error ?? (fieldError?.message as string);\n const showError = !!fieldError && !disabled;\n const mergedRules = mergeHookFormRules(rules, { required });\n\n return (\n <div className={cn('$hook-form-checkbox', classNames?.wrapper)}>\n <Controller\n name={name}\n control={control}\n rules={mergedRules}\n render={({ field: { value, onChange } }) => (\n <FormCheckbox\n {...rest}\n id={id}\n name={name}\n label={label}\n required={isValidationRuleEnabled(mergedRules?.required)}\n disabled={disabled}\n checked={value}\n onCheckedChange={onChange}\n classNames={{\n ...classNames,\n label: cn(classNames?.label, {\n 'text-danger': showError,\n }),\n checkbox: cn(classNames?.checkbox, {\n 'ring-danger text-danger': showError,\n }),\n }}\n />\n )}\n />\n {showError && <FormError field={name} className=\"mt-1\" message={errorMessage} />}\n </div>\n );\n}\n"]}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import {
|
|
3
|
+
isValidationRuleEnabled,
|
|
4
|
+
mergeHookFormRules
|
|
5
|
+
} from "../../chunk-WJKG5MUH.mjs";
|
|
2
6
|
import {
|
|
3
7
|
FormError
|
|
4
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-42IQSRLZ.mjs";
|
|
5
9
|
import {
|
|
6
10
|
FormCheckbox
|
|
7
|
-
} from "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
11
|
+
} from "../../chunk-ASPR3W6A.mjs";
|
|
12
|
+
import "../../chunk-3R7FZDQ7.mjs";
|
|
13
|
+
import "../../chunk-YHL7Q5J3.mjs";
|
|
10
14
|
import {
|
|
11
15
|
cn
|
|
12
|
-
} from "../../chunk-
|
|
16
|
+
} from "../../chunk-KKCJ2GMO.mjs";
|
|
13
17
|
import {
|
|
14
18
|
__objRest,
|
|
15
19
|
__spreadProps,
|
|
@@ -26,6 +30,7 @@ function HookFormCheckbox(_a) {
|
|
|
26
30
|
name,
|
|
27
31
|
label,
|
|
28
32
|
rules,
|
|
33
|
+
required,
|
|
29
34
|
error,
|
|
30
35
|
disabled,
|
|
31
36
|
classNames
|
|
@@ -34,6 +39,7 @@ function HookFormCheckbox(_a) {
|
|
|
34
39
|
"name",
|
|
35
40
|
"label",
|
|
36
41
|
"rules",
|
|
42
|
+
"required",
|
|
37
43
|
"error",
|
|
38
44
|
"disabled",
|
|
39
45
|
"classNames"
|
|
@@ -47,18 +53,20 @@ function HookFormCheckbox(_a) {
|
|
|
47
53
|
const fieldError = _get(errors, name);
|
|
48
54
|
const errorMessage = error != null ? error : fieldError == null ? void 0 : fieldError.message;
|
|
49
55
|
const showError = !!fieldError && !disabled;
|
|
56
|
+
const mergedRules = mergeHookFormRules(rules, { required });
|
|
50
57
|
return /* @__PURE__ */ React.createElement("div", { className: cn("$hook-form-checkbox", classNames == null ? void 0 : classNames.wrapper) }, /* @__PURE__ */ React.createElement(
|
|
51
58
|
Controller,
|
|
52
59
|
{
|
|
53
60
|
name,
|
|
54
61
|
control,
|
|
55
|
-
rules,
|
|
62
|
+
rules: mergedRules,
|
|
56
63
|
render: ({ field: { value, onChange } }) => /* @__PURE__ */ React.createElement(
|
|
57
64
|
FormCheckbox,
|
|
58
|
-
__spreadValues({
|
|
65
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
59
66
|
id,
|
|
60
67
|
name,
|
|
61
68
|
label,
|
|
69
|
+
required: isValidationRuleEnabled(mergedRules == null ? void 0 : mergedRules.required),
|
|
62
70
|
disabled,
|
|
63
71
|
checked: value,
|
|
64
72
|
onCheckedChange: onChange,
|
|
@@ -70,7 +78,7 @@ function HookFormCheckbox(_a) {
|
|
|
70
78
|
"ring-danger text-danger": showError
|
|
71
79
|
})
|
|
72
80
|
})
|
|
73
|
-
}
|
|
81
|
+
})
|
|
74
82
|
)
|
|
75
83
|
}
|
|
76
84
|
), showError && /* @__PURE__ */ React.createElement(FormError, { field: name, className: "mt-1", message: errorMessage }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../components/form/hook-checkbox.tsx"],"sourcesContent":["\"use client\";\nimport React from 'react';\nimport _get from 'lodash-es/get';\nimport { Controller, FieldValues,
|
|
1
|
+
{"version":3,"sources":["../../../components/form/hook-checkbox.tsx"],"sourcesContent":["\"use client\";\nimport React from 'react';\nimport _get from 'lodash-es/get';\nimport { Controller, FieldValues, Path, useFormContext } from 'react-hook-form';\nimport { cn } from '../../utils/ui';\nimport { FormError } from './error';\nimport { FormCheckbox } from './checkbox';\nimport type { FormCheckboxProps } from './checkbox';\nimport { isValidationRuleEnabled, mergeHookFormRules } from './types';\nimport type { HookFormRules, HookFormValidationAttributes } from './types';\n\ntype HookFormCheckboxValidationAttributes = Pick<HookFormValidationAttributes, 'required'>;\n\ntype HookFormCheckboxProps<T extends FieldValues> = Omit<\n FormCheckboxProps,\n 'name' | 'checked' | 'onCheckedChange' | keyof HookFormCheckboxValidationAttributes\n> & {\n name: Path<T>;\n rules?: HookFormRules<T>;\n error?: string;\n} & HookFormCheckboxValidationAttributes;\n\nexport function HookFormCheckbox<T extends FieldValues>({\n id,\n name,\n label,\n rules,\n required,\n error,\n disabled,\n classNames,\n ...rest\n}: HookFormCheckboxProps<T>) {\n const methods = useFormContext<T>();\n if (!methods) return null;\n\n const {\n control,\n formState: { errors },\n } = methods;\n\n const fieldError = _get(errors, name);\n const errorMessage = error ?? (fieldError?.message as string);\n const showError = !!fieldError && !disabled;\n const mergedRules = mergeHookFormRules(rules, { required });\n\n return (\n <div className={cn('$hook-form-checkbox', classNames?.wrapper)}>\n <Controller\n name={name}\n control={control}\n rules={mergedRules}\n render={({ field: { value, onChange } }) => (\n <FormCheckbox\n {...rest}\n id={id}\n name={name}\n label={label}\n required={isValidationRuleEnabled(mergedRules?.required)}\n disabled={disabled}\n checked={value}\n onCheckedChange={onChange}\n classNames={{\n ...classNames,\n label: cn(classNames?.label, {\n 'text-danger': showError,\n }),\n checkbox: cn(classNames?.checkbox, {\n 'ring-danger text-danger': showError,\n }),\n }}\n />\n )}\n />\n {showError && <FormError field={name} className=\"mt-1\" message={errorMessage} />}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,SAAS,YAA+B,sBAAsB;AAmBvD,SAAS,iBAAwC,IAU3B;AAV2B,eACtD;AAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EA9BF,IAsBwD,IASnD,iBATmD,IASnD;AAAA,IARH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,QAAM,UAAU,eAAkB;AAClC,MAAI,CAAC,QAAS,QAAO;AAErB,QAAM;AAAA,IACJ;AAAA,IACA,WAAW,EAAE,OAAO;AAAA,EACtB,IAAI;AAEJ,QAAM,aAAa,KAAK,QAAQ,IAAI;AACpC,QAAM,eAAe,wBAAU,yCAAY;AAC3C,QAAM,YAAY,CAAC,CAAC,cAAc,CAAC;AACnC,QAAM,cAAc,mBAAmB,OAAO,EAAE,SAAS,CAAC;AAE1D,SACE,oCAAC,SAAI,WAAW,GAAG,uBAAuB,yCAAY,OAAO,KAC3D;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,OAAO;AAAA,MACP,QAAQ,CAAC,EAAE,OAAO,EAAE,OAAO,SAAS,EAAE,MACpC;AAAA,QAAC;AAAA,yCACK,OADL;AAAA,UAEC;AAAA,UACA;AAAA,UACA;AAAA,UACA,UAAU,wBAAwB,2CAAa,QAAQ;AAAA,UACvD;AAAA,UACA,SAAS;AAAA,UACT,iBAAiB;AAAA,UACjB,YAAY,iCACP,aADO;AAAA,YAEV,OAAO,GAAG,yCAAY,OAAO;AAAA,cAC3B,eAAe;AAAA,YACjB,CAAC;AAAA,YACD,UAAU,GAAG,yCAAY,UAAU;AAAA,cACjC,2BAA2B;AAAA,YAC7B,CAAC;AAAA,UACH;AAAA;AAAA,MACF;AAAA;AAAA,EAEJ,GACC,aAAa,oCAAC,aAAU,OAAO,MAAM,WAAU,QAAO,SAAS,cAAc,CAChF;AAEJ;","names":[]}
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkHDO7OG7Ijs = require('../../chunk-HDO7OG7I.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
require('../../chunk-
|
|
10
|
-
require('../../chunk-
|
|
11
|
-
require('../../chunk-
|
|
12
|
-
require('../../chunk-
|
|
13
|
-
require('../../chunk-
|
|
14
|
-
require('../../chunk-
|
|
8
|
+
var _chunkBIO4TVNTjs = require('../../chunk-BIO4TVNT.js');
|
|
9
|
+
require('../../chunk-NDH24NNQ.js');
|
|
10
|
+
require('../../chunk-W4ZJYYQP.js');
|
|
11
|
+
require('../../chunk-IEPLSUBR.js');
|
|
12
|
+
require('../../chunk-5CUM73VT.js');
|
|
13
|
+
require('../../chunk-C74J4JWA.js');
|
|
14
|
+
require('../../chunk-OZAVO5UA.js');
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkNBQEF4JDjs = require('../../chunk-NBQEF4JD.js');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
@@ -44,7 +44,7 @@ function HookFormDatePicker(_a) {
|
|
|
44
44
|
]);
|
|
45
45
|
const { control } = _reacthookform.useFormContext.call(void 0, );
|
|
46
46
|
const _a2 = classNames != null ? classNames : {}, { wrapper } = _a2, restClassnames = _chunk2NMEKWO5js.__objRest.call(void 0, _a2, ["wrapper"]);
|
|
47
|
-
return /* @__PURE__ */ _react2.default.createElement("div", { className:
|
|
47
|
+
return /* @__PURE__ */ _react2.default.createElement("div", { className: _chunkNBQEF4JDjs.cn.call(void 0, "$hook-date-picker", wrapper) }, /* @__PURE__ */ _react2.default.createElement(
|
|
48
48
|
_reacthookform.Controller,
|
|
49
49
|
{
|
|
50
50
|
control,
|
|
@@ -52,7 +52,7 @@ function HookFormDatePicker(_a) {
|
|
|
52
52
|
rules,
|
|
53
53
|
render: ({ field: { onChange, onBlur, value } }) => {
|
|
54
54
|
return /* @__PURE__ */ _react2.default.createElement(
|
|
55
|
-
|
|
55
|
+
_chunkBIO4TVNTjs.FormDatePicker,
|
|
56
56
|
_chunk2NMEKWO5js.__spreadProps.call(void 0, _chunk2NMEKWO5js.__spreadValues.call(void 0, {
|
|
57
57
|
id,
|
|
58
58
|
name,
|
|
@@ -66,7 +66,7 @@ function HookFormDatePicker(_a) {
|
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
), /* @__PURE__ */ _react2.default.createElement(
|
|
69
|
+
), /* @__PURE__ */ _react2.default.createElement(_chunkHDO7OG7Ijs.FormError, { field: name, className: "mt-1", message: error }));
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
FormError
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-42IQSRLZ.mjs";
|
|
5
5
|
import {
|
|
6
6
|
FormDatePicker
|
|
7
|
-
} from "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
11
|
-
import "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
7
|
+
} from "../../chunk-3NMW42UR.mjs";
|
|
8
|
+
import "../../chunk-OZF3JOG4.mjs";
|
|
9
|
+
import "../../chunk-N3WWOWZ4.mjs";
|
|
10
|
+
import "../../chunk-S2LLOGBR.mjs";
|
|
11
|
+
import "../../chunk-ZJRJN2UJ.mjs";
|
|
12
|
+
import "../../chunk-HD7GX5UE.mjs";
|
|
13
|
+
import "../../chunk-YHL7Q5J3.mjs";
|
|
14
14
|
import {
|
|
15
15
|
cn
|
|
16
|
-
} from "../../chunk-
|
|
16
|
+
} from "../../chunk-KKCJ2GMO.mjs";
|
|
17
17
|
import {
|
|
18
18
|
__objRest,
|
|
19
19
|
__spreadProps,
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('../../chunk-
|
|
7
|
-
require('../../chunk-
|
|
8
|
-
require('../../chunk-
|
|
9
|
-
require('../../chunk-
|
|
10
|
-
require('../../chunk-
|
|
11
|
-
require('../../chunk-
|
|
12
|
-
require('../../chunk-
|
|
5
|
+
var _chunkSSBVBEDIjs = require('../../chunk-SSBVBEDI.js');
|
|
6
|
+
require('../../chunk-DNOZXQ2U.js');
|
|
7
|
+
require('../../chunk-DD3MCW6L.js');
|
|
8
|
+
require('../../chunk-GOATL3D5.js');
|
|
9
|
+
require('../../chunk-AOGFHEQH.js');
|
|
10
|
+
require('../../chunk-YMBEAV7N.js');
|
|
11
|
+
require('../../chunk-CRBQL2FG.js');
|
|
12
|
+
require('../../chunk-VVU3Q7KV.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
16
|
-
require('../../chunk-
|
|
17
|
-
require('../../chunk-
|
|
18
|
-
require('../../chunk-
|
|
19
|
-
require('../../chunk-
|
|
15
|
+
var _chunkHDO7OG7Ijs = require('../../chunk-HDO7OG7I.js');
|
|
16
|
+
require('../../chunk-W4ZJYYQP.js');
|
|
17
|
+
require('../../chunk-IEPLSUBR.js');
|
|
18
|
+
require('../../chunk-5CUM73VT.js');
|
|
19
|
+
require('../../chunk-OZAVO5UA.js');
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _chunkNBQEF4JDjs = require('../../chunk-NBQEF4JD.js');
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
@@ -48,7 +48,7 @@ function HookFormMultiSelect(_a) {
|
|
|
48
48
|
]);
|
|
49
49
|
const { control } = _reacthookform.useFormContext.call(void 0, );
|
|
50
50
|
const _a2 = classNames != null ? classNames : {}, { wrapper } = _a2, restClassnames = _chunk2NMEKWO5js.__objRest.call(void 0, _a2, ["wrapper"]);
|
|
51
|
-
return /* @__PURE__ */ _react2.default.createElement("div", { className:
|
|
51
|
+
return /* @__PURE__ */ _react2.default.createElement("div", { className: _chunkNBQEF4JDjs.cn.call(void 0, "$hook-multi-select", wrapper) }, /* @__PURE__ */ _react2.default.createElement(
|
|
52
52
|
_reacthookform.Controller,
|
|
53
53
|
{
|
|
54
54
|
control,
|
|
@@ -56,7 +56,7 @@ function HookFormMultiSelect(_a) {
|
|
|
56
56
|
rules,
|
|
57
57
|
render: ({ field: { onChange, value } }) => {
|
|
58
58
|
return /* @__PURE__ */ _react2.default.createElement(
|
|
59
|
-
|
|
59
|
+
_chunkSSBVBEDIjs.FormMultiSelect,
|
|
60
60
|
_chunk2NMEKWO5js.__spreadValues.call(void 0, {
|
|
61
61
|
id,
|
|
62
62
|
name,
|
|
@@ -69,7 +69,7 @@ function HookFormMultiSelect(_a) {
|
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
), /* @__PURE__ */ _react2.default.createElement(
|
|
72
|
+
), /* @__PURE__ */ _react2.default.createElement(_chunkHDO7OG7Ijs.FormError, { field: name, className: "mt-1", message: error }));
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
FormMultiSelect
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
11
|
-
import "../../chunk-
|
|
4
|
+
} from "../../chunk-3R2OBHS6.mjs";
|
|
5
|
+
import "../../chunk-L7EN73HA.mjs";
|
|
6
|
+
import "../../chunk-VQWCEF3I.mjs";
|
|
7
|
+
import "../../chunk-XH7WQWOD.mjs";
|
|
8
|
+
import "../../chunk-CFG4GTRV.mjs";
|
|
9
|
+
import "../../chunk-CHV7CG5L.mjs";
|
|
10
|
+
import "../../chunk-OXUVPYJE.mjs";
|
|
11
|
+
import "../../chunk-ZLGQUL4Y.mjs";
|
|
12
12
|
import {
|
|
13
13
|
FormError
|
|
14
|
-
} from "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
16
|
-
import "../../chunk-
|
|
17
|
-
import "../../chunk-
|
|
18
|
-
import "../../chunk-
|
|
14
|
+
} from "../../chunk-42IQSRLZ.mjs";
|
|
15
|
+
import "../../chunk-N3WWOWZ4.mjs";
|
|
16
|
+
import "../../chunk-S2LLOGBR.mjs";
|
|
17
|
+
import "../../chunk-ZJRJN2UJ.mjs";
|
|
18
|
+
import "../../chunk-YHL7Q5J3.mjs";
|
|
19
19
|
import {
|
|
20
20
|
cn
|
|
21
|
-
} from "../../chunk-
|
|
21
|
+
} from "../../chunk-KKCJ2GMO.mjs";
|
|
22
22
|
import {
|
|
23
23
|
__objRest,
|
|
24
24
|
__spreadValues
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
|
-
import { FieldValues, Path
|
|
2
|
+
import { FieldValues, Path } from 'react-hook-form';
|
|
3
3
|
import { FormNativeSelectProps } from './native-select.mjs';
|
|
4
|
+
import { HookFormValidationAttributes, HookFormRules } from './types.mjs';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
type HookFormNativeSelectValidationAttributes = Pick<HookFormValidationAttributes, 'required'>;
|
|
7
|
+
type HookFormNativeSelectProps<T extends FieldValues> = Omit<FormNativeSelectProps, 'name' | 'selectProps' | keyof HookFormNativeSelectValidationAttributes> & {
|
|
6
8
|
name: Path<T>;
|
|
7
|
-
rules?:
|
|
9
|
+
rules?: HookFormRules<T>;
|
|
8
10
|
error?: string;
|
|
9
|
-
}
|
|
11
|
+
} & HookFormNativeSelectValidationAttributes;
|
|
12
|
+
declare function HookFormNativeSelect<T extends FieldValues>({ id, name, rules, label, error, classNames, disabled, required, ...rest }: HookFormNativeSelectProps<T>): React__default.JSX.Element | null;
|
|
10
13
|
|
|
11
14
|
export { HookFormNativeSelect };
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
|
-
import { FieldValues, Path
|
|
2
|
+
import { FieldValues, Path } from 'react-hook-form';
|
|
3
3
|
import { FormNativeSelectProps } from './native-select.js';
|
|
4
|
+
import { HookFormValidationAttributes, HookFormRules } from './types.js';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
type HookFormNativeSelectValidationAttributes = Pick<HookFormValidationAttributes, 'required'>;
|
|
7
|
+
type HookFormNativeSelectProps<T extends FieldValues> = Omit<FormNativeSelectProps, 'name' | 'selectProps' | keyof HookFormNativeSelectValidationAttributes> & {
|
|
6
8
|
name: Path<T>;
|
|
7
|
-
rules?:
|
|
9
|
+
rules?: HookFormRules<T>;
|
|
8
10
|
error?: string;
|
|
9
|
-
}
|
|
11
|
+
} & HookFormNativeSelectValidationAttributes;
|
|
12
|
+
declare function HookFormNativeSelect<T extends FieldValues>({ id, name, rules, label, error, classNames, disabled, required, ...rest }: HookFormNativeSelectProps<T>): React__default.JSX.Element | null;
|
|
10
13
|
|
|
11
14
|
export { HookFormNativeSelect };
|
|
@@ -2,14 +2,18 @@
|
|
|
2
2
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkVHXALM6Ojs = require('../../chunk-VHXALM6O.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _chunk6POWZMNDjs = require('../../chunk-6POWZMND.js');
|
|
9
|
-
require('../../chunk-CKGMFUU2.js');
|
|
10
8
|
|
|
9
|
+
var _chunkVYBFV2QDjs = require('../../chunk-VYBFV2QD.js');
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
|
|
12
|
+
var _chunkHDO7OG7Ijs = require('../../chunk-HDO7OG7I.js');
|
|
13
|
+
require('../../chunk-OZAVO5UA.js');
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
var _chunkNBQEF4JDjs = require('../../chunk-NBQEF4JD.js');
|
|
13
17
|
|
|
14
18
|
|
|
15
19
|
|
|
@@ -28,7 +32,8 @@ function HookFormNativeSelect(_a) {
|
|
|
28
32
|
label,
|
|
29
33
|
error,
|
|
30
34
|
classNames,
|
|
31
|
-
disabled
|
|
35
|
+
disabled,
|
|
36
|
+
required
|
|
32
37
|
} = _b, rest = _chunk2NMEKWO5js.__objRest.call(void 0, _b, [
|
|
33
38
|
"id",
|
|
34
39
|
"name",
|
|
@@ -36,7 +41,8 @@ function HookFormNativeSelect(_a) {
|
|
|
36
41
|
"label",
|
|
37
42
|
"error",
|
|
38
43
|
"classNames",
|
|
39
|
-
"disabled"
|
|
44
|
+
"disabled",
|
|
45
|
+
"required"
|
|
40
46
|
]);
|
|
41
47
|
const methods = _reacthookform.useFormContext.call(void 0, );
|
|
42
48
|
if (!methods) return null;
|
|
@@ -47,25 +53,26 @@ function HookFormNativeSelect(_a) {
|
|
|
47
53
|
const fieldError = _get3.default.call(void 0, errors, name);
|
|
48
54
|
const errorMessage = error != null ? error : fieldError && String(fieldError == null ? void 0 : fieldError.message);
|
|
49
55
|
const showError = !!fieldError && !disabled;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
const mergedRules = _chunkVYBFV2QDjs.mergeHookFormRules.call(void 0, rules, { required });
|
|
57
|
+
return /* @__PURE__ */ _react2.default.createElement("div", { className: _chunkNBQEF4JDjs.cn.call(void 0, "$hook-form-native-select", classNames == null ? void 0 : classNames.wrapper) }, /* @__PURE__ */ _react2.default.createElement(
|
|
58
|
+
_chunkVHXALM6Ojs.FormNativeSelect,
|
|
59
|
+
_chunk2NMEKWO5js.__spreadProps.call(void 0, _chunk2NMEKWO5js.__spreadValues.call(void 0, {}, rest), {
|
|
53
60
|
id,
|
|
54
61
|
name,
|
|
55
62
|
label,
|
|
56
|
-
disabled
|
|
57
|
-
|
|
63
|
+
disabled,
|
|
64
|
+
required: _chunkVYBFV2QDjs.isValidationRuleEnabled.call(void 0, mergedRules == null ? void 0 : mergedRules.required),
|
|
58
65
|
classNames: {
|
|
59
|
-
label:
|
|
66
|
+
label: _chunkNBQEF4JDjs.cn.call(void 0, classNames == null ? void 0 : classNames.label, {
|
|
60
67
|
"text-danger": showError
|
|
61
68
|
}),
|
|
62
|
-
input:
|
|
69
|
+
input: _chunkNBQEF4JDjs.cn.call(void 0, classNames == null ? void 0 : classNames.input, {
|
|
63
70
|
"ring-danger text-danger": showError
|
|
64
71
|
})
|
|
65
72
|
},
|
|
66
|
-
selectProps: register(name,
|
|
73
|
+
selectProps: register(name, mergedRules)
|
|
67
74
|
})
|
|
68
|
-
), showError && /* @__PURE__ */ _react2.default.createElement(
|
|
75
|
+
), showError && /* @__PURE__ */ _react2.default.createElement(_chunkHDO7OG7Ijs.FormError, { field: name, className: "mt-1", message: errorMessage }));
|
|
69
76
|
}
|
|
70
77
|
|
|
71
78
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/jahn/projects/shadcn-theme/packages/react/dist/components/form/hook-native-select.js","../../../components/form/hook-native-select.tsx"],"names":[],"mappings":"AAAA,qLAAY;AACZ;AACE;AACF,0DAAgC;AAChC;AACE;AACF,0DAAgC;AAChC,mCAAgC;AAChC;AACE;AACF,0DAAgC;AAChC;AACE;AACA;AACA;AACF,0DAAgC;AAChC;AACA;
|
|
1
|
+
{"version":3,"sources":["/home/jahn/projects/shadcn-theme/packages/react/dist/components/form/hook-native-select.js","../../../components/form/hook-native-select.tsx"],"names":[],"mappings":"AAAA,qLAAY;AACZ;AACE;AACF,0DAAgC;AAChC;AACE;AACA;AACF,0DAAgC;AAChC;AACE;AACF,0DAAgC;AAChC,mCAAgC;AAChC;AACE;AACF,0DAAgC;AAChC;AACE;AACA;AACA;AACF,0DAAgC;AAChC;AACA;ACpBA,4EAAkB;AAClB,gFAAiB;AACjB,gDAAkD;AAmB3C,SAAS,oBAAA,CAA4C,EAAA,EAU3B;AAV2B,EAAA,IAAA,GAAA,EAAA,EAAA,EAC1D;AAAA,IAAA,EAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACA,KAAA;AAAA,IACA,KAAA;AAAA,IACA,UAAA;AAAA,IACA,QAAA;AAAA,IACA;AAAA,EA9BF,EAAA,EAsB4D,EAAA,EASvD,KAAA,EAAA,wCAAA,EATuD,EASvD;AAAA,IARH,IAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;AAAA,IACA,OAAA;AAAA,IACA,OAAA;AAAA,IACA,YAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,EAAA,CAAA,CAAA;AAGA,EAAA,MAAM,QAAA,EAAU,2CAAA,CAAkB;AAClC,EAAA,GAAA,CAAI,CAAC,OAAA,EAAS,OAAO,IAAA;AAErB,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,SAAA,EAAW,EAAE,OAAO;AAAA,EACtB,EAAA,EAAI,OAAA;AAEJ,EAAA,MAAM,WAAA,EAAa,2BAAA,MAAK,EAAQ,IAAI,CAAA;AACpC,EAAA,MAAM,aAAA,EAAe,MAAA,GAAA,KAAA,EAAA,MAAA,EAAU,WAAA,GAAc,MAAA,CAAO,WAAA,GAAA,KAAA,EAAA,KAAA,EAAA,EAAA,UAAA,CAAY,OAAO,CAAA;AACvE,EAAA,MAAM,UAAA,EAAY,CAAC,CAAC,WAAA,GAAc,CAAC,QAAA;AACnC,EAAA,MAAM,YAAA,EAAc,iDAAA,KAAmB,EAAO,EAAE,SAAS,CAAC,CAAA;AAE1D,EAAA,uBACE,eAAA,CAAA,aAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,iCAAA,0BAAG,EAA4B,WAAA,GAAA,KAAA,EAAA,KAAA,EAAA,EAAA,UAAA,CAAY,OAAO,EAAA,CAAA,kBAChE,eAAA,CAAA,aAAA;AAAA,IAAC,iCAAA;AAAA,IAAA,4CAAA,6CAAA,CAAA,CAAA,EACK,IAAA,CAAA,EADL;AAAA,MAEC,EAAA;AAAA,MACA,IAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA,EAAU,sDAAA,YAAwB,GAAA,KAAA,EAAA,KAAA,EAAA,EAAA,WAAA,CAAa,QAAQ,CAAA;AAAA,MACvD,UAAA,EAAY;AAAA,QACV,KAAA,EAAO,iCAAA,WAAG,GAAA,KAAA,EAAA,KAAA,EAAA,EAAA,UAAA,CAAY,KAAA,EAAO;AAAA,UAC3B,aAAA,EAAe;AAAA,QACjB,CAAC,CAAA;AAAA,QACD,KAAA,EAAO,iCAAA,WAAG,GAAA,KAAA,EAAA,KAAA,EAAA,EAAA,UAAA,CAAY,KAAA,EAAO;AAAA,UAC3B,yBAAA,EAA2B;AAAA,QAC7B,CAAC;AAAA,MACH,CAAA;AAAA,MACA,WAAA,EAAa,QAAA,CAAS,IAAA,EAAM,WAAW;AAAA,IAAA,CAAA;AAAA,EACzC,CAAA,EACC,UAAA,mBAAa,eAAA,CAAA,aAAA,CAAC,0BAAA,EAAA,EAAU,KAAA,EAAO,IAAA,EAAM,SAAA,EAAU,MAAA,EAAO,OAAA,EAAS,aAAA,CAAc,CAChF,CAAA;AAEJ;ADOA;AACE;AACF,oDAAC","file":"/home/jahn/projects/shadcn-theme/packages/react/dist/components/form/hook-native-select.js","sourcesContent":[null,"\"use client\";\nimport React from 'react';\nimport _get from 'lodash-es/get';\nimport { FieldValues, Path, useFormContext } from 'react-hook-form';\nimport { cn } from '../../utils/ui';\nimport { FormError } from './error';\nimport { FormNativeSelect } from './native-select';\nimport type { FormNativeSelectProps } from './native-select';\nimport { isValidationRuleEnabled, mergeHookFormRules } from './types';\nimport type { HookFormRules, HookFormValidationAttributes } from './types';\n\ntype HookFormNativeSelectValidationAttributes = Pick<HookFormValidationAttributes, 'required'>;\n\ntype HookFormNativeSelectProps<T extends FieldValues> = Omit<\n FormNativeSelectProps,\n 'name' | 'selectProps' | keyof HookFormNativeSelectValidationAttributes\n> & {\n name: Path<T>;\n rules?: HookFormRules<T>;\n error?: string;\n} & HookFormNativeSelectValidationAttributes;\n\nexport function HookFormNativeSelect<T extends FieldValues>({\n id,\n name,\n rules,\n label,\n error,\n classNames,\n disabled,\n required,\n ...rest\n}: HookFormNativeSelectProps<T>) {\n const methods = useFormContext<T>();\n if (!methods) return null;\n\n const {\n register,\n formState: { errors },\n } = methods;\n\n const fieldError = _get(errors, name);\n const errorMessage = error ?? (fieldError && String(fieldError?.message));\n const showError = !!fieldError && !disabled;\n const mergedRules = mergeHookFormRules(rules, { required });\n\n return (\n <div className={cn('$hook-form-native-select', classNames?.wrapper)}>\n <FormNativeSelect\n {...rest}\n id={id}\n name={name}\n label={label}\n disabled={disabled}\n required={isValidationRuleEnabled(mergedRules?.required)}\n classNames={{\n label: cn(classNames?.label, {\n 'text-danger': showError,\n }),\n input: cn(classNames?.input, {\n 'ring-danger text-danger': showError,\n }),\n }}\n selectProps={register(name, mergedRules)}\n />\n {showError && <FormError field={name} className=\"mt-1\" message={errorMessage} />}\n </div>\n );\n}\n"]}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
FormNativeSelect
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-NQQR2NDC.mjs";
|
|
5
|
+
import {
|
|
6
|
+
isValidationRuleEnabled,
|
|
7
|
+
mergeHookFormRules
|
|
8
|
+
} from "../../chunk-WJKG5MUH.mjs";
|
|
5
9
|
import {
|
|
6
10
|
FormError
|
|
7
|
-
} from "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
11
|
+
} from "../../chunk-42IQSRLZ.mjs";
|
|
12
|
+
import "../../chunk-YHL7Q5J3.mjs";
|
|
9
13
|
import {
|
|
10
14
|
cn
|
|
11
|
-
} from "../../chunk-
|
|
15
|
+
} from "../../chunk-KKCJ2GMO.mjs";
|
|
12
16
|
import {
|
|
13
17
|
__objRest,
|
|
14
18
|
__spreadProps,
|
|
@@ -27,7 +31,8 @@ function HookFormNativeSelect(_a) {
|
|
|
27
31
|
label,
|
|
28
32
|
error,
|
|
29
33
|
classNames,
|
|
30
|
-
disabled
|
|
34
|
+
disabled,
|
|
35
|
+
required
|
|
31
36
|
} = _b, rest = __objRest(_b, [
|
|
32
37
|
"id",
|
|
33
38
|
"name",
|
|
@@ -35,7 +40,8 @@ function HookFormNativeSelect(_a) {
|
|
|
35
40
|
"label",
|
|
36
41
|
"error",
|
|
37
42
|
"classNames",
|
|
38
|
-
"disabled"
|
|
43
|
+
"disabled",
|
|
44
|
+
"required"
|
|
39
45
|
]);
|
|
40
46
|
const methods = useFormContext();
|
|
41
47
|
if (!methods) return null;
|
|
@@ -46,14 +52,15 @@ function HookFormNativeSelect(_a) {
|
|
|
46
52
|
const fieldError = _get(errors, name);
|
|
47
53
|
const errorMessage = error != null ? error : fieldError && String(fieldError == null ? void 0 : fieldError.message);
|
|
48
54
|
const showError = !!fieldError && !disabled;
|
|
55
|
+
const mergedRules = mergeHookFormRules(rules, { required });
|
|
49
56
|
return /* @__PURE__ */ React.createElement("div", { className: cn("$hook-form-native-select", classNames == null ? void 0 : classNames.wrapper) }, /* @__PURE__ */ React.createElement(
|
|
50
57
|
FormNativeSelect,
|
|
51
|
-
__spreadProps(__spreadValues({
|
|
58
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
52
59
|
id,
|
|
53
60
|
name,
|
|
54
61
|
label,
|
|
55
|
-
disabled
|
|
56
|
-
|
|
62
|
+
disabled,
|
|
63
|
+
required: isValidationRuleEnabled(mergedRules == null ? void 0 : mergedRules.required),
|
|
57
64
|
classNames: {
|
|
58
65
|
label: cn(classNames == null ? void 0 : classNames.label, {
|
|
59
66
|
"text-danger": showError
|
|
@@ -62,7 +69,7 @@ function HookFormNativeSelect(_a) {
|
|
|
62
69
|
"ring-danger text-danger": showError
|
|
63
70
|
})
|
|
64
71
|
},
|
|
65
|
-
selectProps: register(name,
|
|
72
|
+
selectProps: register(name, mergedRules)
|
|
66
73
|
})
|
|
67
74
|
), showError && /* @__PURE__ */ React.createElement(FormError, { field: name, className: "mt-1", message: errorMessage }));
|
|
68
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../components/form/hook-native-select.tsx"],"sourcesContent":["\"use client\";\nimport React from 'react';\nimport _get from 'lodash-es/get';\nimport { FieldValues,
|
|
1
|
+
{"version":3,"sources":["../../../components/form/hook-native-select.tsx"],"sourcesContent":["\"use client\";\nimport React from 'react';\nimport _get from 'lodash-es/get';\nimport { FieldValues, Path, useFormContext } from 'react-hook-form';\nimport { cn } from '../../utils/ui';\nimport { FormError } from './error';\nimport { FormNativeSelect } from './native-select';\nimport type { FormNativeSelectProps } from './native-select';\nimport { isValidationRuleEnabled, mergeHookFormRules } from './types';\nimport type { HookFormRules, HookFormValidationAttributes } from './types';\n\ntype HookFormNativeSelectValidationAttributes = Pick<HookFormValidationAttributes, 'required'>;\n\ntype HookFormNativeSelectProps<T extends FieldValues> = Omit<\n FormNativeSelectProps,\n 'name' | 'selectProps' | keyof HookFormNativeSelectValidationAttributes\n> & {\n name: Path<T>;\n rules?: HookFormRules<T>;\n error?: string;\n} & HookFormNativeSelectValidationAttributes;\n\nexport function HookFormNativeSelect<T extends FieldValues>({\n id,\n name,\n rules,\n label,\n error,\n classNames,\n disabled,\n required,\n ...rest\n}: HookFormNativeSelectProps<T>) {\n const methods = useFormContext<T>();\n if (!methods) return null;\n\n const {\n register,\n formState: { errors },\n } = methods;\n\n const fieldError = _get(errors, name);\n const errorMessage = error ?? (fieldError && String(fieldError?.message));\n const showError = !!fieldError && !disabled;\n const mergedRules = mergeHookFormRules(rules, { required });\n\n return (\n <div className={cn('$hook-form-native-select', classNames?.wrapper)}>\n <FormNativeSelect\n {...rest}\n id={id}\n name={name}\n label={label}\n disabled={disabled}\n required={isValidationRuleEnabled(mergedRules?.required)}\n classNames={{\n label: cn(classNames?.label, {\n 'text-danger': showError,\n }),\n input: cn(classNames?.input, {\n 'ring-danger text-danger': showError,\n }),\n }}\n selectProps={register(name, mergedRules)}\n />\n {showError && <FormError field={name} className=\"mt-1\" message={errorMessage} />}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,SAA4B,sBAAsB;AAmB3C,SAAS,qBAA4C,IAU3B;AAV2B,eAC1D;AAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EA9BF,IAsB4D,IASvD,iBATuD,IASvD;AAAA,IARH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,QAAM,UAAU,eAAkB;AAClC,MAAI,CAAC,QAAS,QAAO;AAErB,QAAM;AAAA,IACJ;AAAA,IACA,WAAW,EAAE,OAAO;AAAA,EACtB,IAAI;AAEJ,QAAM,aAAa,KAAK,QAAQ,IAAI;AACpC,QAAM,eAAe,wBAAU,cAAc,OAAO,yCAAY,OAAO;AACvE,QAAM,YAAY,CAAC,CAAC,cAAc,CAAC;AACnC,QAAM,cAAc,mBAAmB,OAAO,EAAE,SAAS,CAAC;AAE1D,SACE,oCAAC,SAAI,WAAW,GAAG,4BAA4B,yCAAY,OAAO,KAChE;AAAA,IAAC;AAAA,qCACK,OADL;AAAA,MAEC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU,wBAAwB,2CAAa,QAAQ;AAAA,MACvD,YAAY;AAAA,QACV,OAAO,GAAG,yCAAY,OAAO;AAAA,UAC3B,eAAe;AAAA,QACjB,CAAC;AAAA,QACD,OAAO,GAAG,yCAAY,OAAO;AAAA,UAC3B,2BAA2B;AAAA,QAC7B,CAAC;AAAA,MACH;AAAA,MACA,aAAa,SAAS,MAAM,WAAW;AAAA;AAAA,EACzC,GACC,aAAa,oCAAC,aAAU,OAAO,MAAM,WAAU,QAAO,SAAS,cAAc,CAChF;AAEJ;","names":[]}
|