@customafk/lunas-ui 0.2.83 → 0.2.85
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/LoginPage-DGgThT3s.mjs +2 -0
- package/dist/LoginPage-DGgThT3s.mjs.map +1 -0
- package/dist/LoginPage-DPUdRD0r.cjs +2 -0
- package/dist/LoginPage-DPUdRD0r.cjs.map +1 -0
- package/dist/action-submit-B2qFdfi6.cjs +2 -0
- package/dist/{action-submit-B9vHpLoN.cjs.map → action-submit-B2qFdfi6.cjs.map} +1 -1
- package/dist/action-submit-DyNvI-F2.mjs +2 -0
- package/dist/{action-submit-BQdkz4mS.mjs.map → action-submit-DyNvI-F2.mjs.map} +1 -1
- package/dist/actions-form-CB0lZlE6.mjs +2 -0
- package/dist/{actions-form-D4n1W3-X.mjs.map → actions-form-CB0lZlE6.mjs.map} +1 -1
- package/dist/actions-form-DnlpVrgF.cjs +2 -0
- package/dist/{actions-form-DF2eYxGQ.cjs.map → actions-form-DnlpVrgF.cjs.map} +1 -1
- package/dist/checkbox-field-CFPHAcwN.cjs +2 -0
- package/dist/{checkbox-field-ldZRSCca.cjs.map → checkbox-field-CFPHAcwN.cjs.map} +1 -1
- package/dist/checkbox-field-DodKeFS_.mjs +2 -0
- package/dist/{checkbox-field-BRGTLOjq.mjs.map → checkbox-field-DodKeFS_.mjs.map} +1 -1
- package/dist/{cms-layout-BGsf1E4E.cjs → cms-layout-DYEmSqzx.cjs} +2 -2
- package/dist/{cms-layout-BGsf1E4E.cjs.map → cms-layout-DYEmSqzx.cjs.map} +1 -1
- package/dist/combobox-field-D7cZ8fhZ.cjs +2 -0
- package/dist/{combobox-field-ZYr7636s.cjs.map → combobox-field-D7cZ8fhZ.cjs.map} +1 -1
- package/dist/combobox-field-ebIvbhJn.mjs +2 -0
- package/dist/{combobox-field-CvkdZkQE.mjs.map → combobox-field-ebIvbhJn.mjs.map} +1 -1
- package/dist/data-display/country.cjs +1 -1
- package/dist/date-field-CNkxebta.mjs +2 -0
- package/dist/{date-field-DGMTG_hu.mjs.map → date-field-CNkxebta.mjs.map} +1 -1
- package/dist/date-field-Dm367ro9.cjs +2 -0
- package/dist/{date-field-1Hmcv8Zp.cjs.map → date-field-Dm367ro9.cjs.map} +1 -1
- package/dist/dialog-form-D9Bifsx6.cjs +2 -0
- package/dist/{dialog-form-C1qpltYx.cjs.map → dialog-form-D9Bifsx6.cjs.map} +1 -1
- package/dist/dialog-form-zK6Gk9Gk.mjs +2 -0
- package/dist/{dialog-form-BRSZpRTC.mjs.map → dialog-form-zK6Gk9Gk.mjs.map} +1 -1
- package/dist/{dist-DzA--RwW.cjs → dist-CIdWHwhj.cjs} +2 -2
- package/dist/{dist-DzA--RwW.cjs.map → dist-CIdWHwhj.cjs.map} +1 -1
- package/dist/email-field-BVl7u9pR.mjs +2 -0
- package/dist/{email-field-C2Lvl_rQ.mjs.map → email-field-BVl7u9pR.mjs.map} +1 -1
- package/dist/email-field-CqXXRG3w.cjs +2 -0
- package/dist/{email-field-D3nSkHj2.cjs.map → email-field-CqXXRG3w.cjs.map} +1 -1
- package/dist/features/tables/index.d.cts +1 -1
- package/dist/features/tables/index.d.mts +1 -1
- package/dist/features/tanstack-form/index.cjs +1 -1
- package/dist/features/tanstack-form/index.d.cts +1 -1
- package/dist/features/tanstack-form/index.d.mts +1 -1
- package/dist/features/tanstack-form/index.mjs +1 -1
- package/dist/features/text-editor/index.cjs +1 -1
- package/dist/features/text-editor/index.d.cts +1 -1
- package/dist/features/text-editor/index.d.mts +1 -1
- package/dist/features/text-editor/index.mjs +1 -1
- package/dist/{flex-C63_IqSY.d.cts → flex-D6RCsrv1.d.cts} +2 -2
- package/dist/{flex-C63_IqSY.d.mts → flex-D6RCsrv1.d.mts} +2 -2
- package/dist/group-field-8nINgAeO.mjs +2 -0
- package/dist/{group-field-gejvx_Td.mjs.map → group-field-8nINgAeO.mjs.map} +1 -1
- package/dist/group-field-DfGPDLyp.cjs +2 -0
- package/dist/{group-field-sVykO2JZ.cjs.map → group-field-DfGPDLyp.cjs.map} +1 -1
- package/dist/{index-DvC1inRy.d.cts → index-0HuXxgjQ.d.cts} +13 -10
- package/dist/index-6_zytlWu.d.cts +70 -0
- package/dist/index-6_zytlWu.d.mts +70 -0
- package/dist/{index-CrkOhm--.d.mts → index-BCBEYTyA.d.mts} +5 -5
- package/dist/{index--wNkNzCB.d.cts → index-CQPyC0Q2.d.cts} +5 -5
- package/dist/{index-DvC1inRy.d.mts → index-CZ_2KVir.d.mts} +13 -10
- package/dist/{index-DRAyYm8g.d.mts → index-CvFEJoon.d.cts} +12 -3
- package/dist/{index-DRAyYm8g.d.cts → index-CvFEJoon.d.mts} +12 -3
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +1 -1
- package/dist/layouts/cms-layout/index.cjs +1 -1
- package/dist/layouts/flex.d.cts +1 -1
- package/dist/layouts/flex.d.mts +1 -1
- package/dist/layouts/payment-layout/index.cjs +1 -1
- package/dist/number-field-BjGl_IiN.cjs +2 -0
- package/dist/{number-field-CWDYA3La.cjs.map → number-field-BjGl_IiN.cjs.map} +1 -1
- package/dist/number-field-CVemIwIg.mjs +2 -0
- package/dist/{number-field-CR5PLX6H.mjs.map → number-field-CVemIwIg.mjs.map} +1 -1
- package/dist/pages/LoginPage/index.cjs +1 -0
- package/dist/pages/LoginPage/index.d.cts +2 -0
- package/dist/pages/LoginPage/index.d.mts +2 -0
- package/dist/pages/LoginPage/index.mjs +1 -0
- package/dist/password-field-Be0Ltlxh.cjs +2 -0
- package/dist/{password-field-BHRhVyZ0.cjs.map → password-field-Be0Ltlxh.cjs.map} +1 -1
- package/dist/password-field-BxYaT8lO.mjs +2 -0
- package/dist/{password-field-B2_kzss6.mjs.map → password-field-BxYaT8lO.mjs.map} +1 -1
- package/dist/{payment-layout-BZtIcu-3.cjs → payment-layout-C38xIc2X.cjs} +2 -2
- package/dist/{payment-layout-BZtIcu-3.cjs.map → payment-layout-C38xIc2X.cjs.map} +1 -1
- package/dist/popover-form-Ba_Nw79b.cjs +2 -0
- package/dist/{popover-form-Ch_iMMSm.cjs.map → popover-form-Ba_Nw79b.cjs.map} +1 -1
- package/dist/popover-form-C9mNInr2.mjs +2 -0
- package/dist/{popover-form-CeRVpy1B.mjs.map → popover-form-C9mNInr2.mjs.map} +1 -1
- package/dist/radio-group-field-BCJWamjd.cjs +2 -0
- package/dist/{radio-group-field-BFhBfzoT.cjs.map → radio-group-field-BCJWamjd.cjs.map} +1 -1
- package/dist/radio-group-field-DYqU_6hW.mjs +2 -0
- package/dist/{radio-group-field-Iwo2Q2Ig.mjs.map → radio-group-field-DYqU_6hW.mjs.map} +1 -1
- package/dist/{resizable-CNqPu4Ck.d.cts → resizable-DTnfCua-.d.cts} +2 -2
- package/dist/{resizable-CNqPu4Ck.d.mts → resizable-DTnfCua-.d.mts} +2 -2
- package/dist/rolldown-runtime-DWNI8pZO.cjs +1 -0
- package/dist/select-field-D7Ny2Qne.mjs +2 -0
- package/dist/{select-field-NJgDDCO2.mjs.map → select-field-D7Ny2Qne.mjs.map} +1 -1
- package/dist/select-field-UWnBMAzL.cjs +2 -0
- package/dist/{select-field-CvDBZQTl.cjs.map → select-field-UWnBMAzL.cjs.map} +1 -1
- package/dist/simple-array-field-BSMxRilE.cjs +2 -0
- package/dist/{simple-array-field-aGXkDZXD.cjs.map → simple-array-field-BSMxRilE.cjs.map} +1 -1
- package/dist/simple-array-field-DJXa_vST.mjs +2 -0
- package/dist/{simple-array-field-BwNCeUnn.mjs.map → simple-array-field-DJXa_vST.mjs.map} +1 -1
- package/dist/simple-boolean-field-CVNT8NBk.mjs +2 -0
- package/dist/{simple-boolean-field-t_XDXqYs.mjs.map → simple-boolean-field-CVNT8NBk.mjs.map} +1 -1
- package/dist/simple-boolean-field-CxAyVQ1w.cjs +2 -0
- package/dist/{simple-boolean-field-BeVkn3c4.cjs.map → simple-boolean-field-CxAyVQ1w.cjs.map} +1 -1
- package/dist/simple-combobox-field-BP4IeDkA.cjs +2 -0
- package/dist/{simple-combobox-field-U0ZAl7VQ.cjs.map → simple-combobox-field-BP4IeDkA.cjs.map} +1 -1
- package/dist/simple-combobox-field-BnAUDfQU.mjs +2 -0
- package/dist/{simple-combobox-field-HCB4A33-.mjs.map → simple-combobox-field-BnAUDfQU.mjs.map} +1 -1
- package/dist/simple-date-field-DIa6UBF2.mjs +2 -0
- package/dist/{simple-date-field-Dj4bJoji.mjs.map → simple-date-field-DIa6UBF2.mjs.map} +1 -1
- package/dist/simple-date-field-NSawlSff.cjs +2 -0
- package/dist/{simple-date-field-DtxEpEZj.cjs.map → simple-date-field-NSawlSff.cjs.map} +1 -1
- package/dist/simple-email-field-2Abh3qZw.cjs +2 -0
- package/dist/{simple-email-field-DK9I_Tc_.cjs.map → simple-email-field-2Abh3qZw.cjs.map} +1 -1
- package/dist/simple-email-field-CKDQgzh5.mjs +2 -0
- package/dist/{simple-email-field-BDyhkmHV.mjs.map → simple-email-field-CKDQgzh5.mjs.map} +1 -1
- package/dist/simple-number-field-BjEYE54F.cjs +2 -0
- package/dist/{simple-number-field-BspqWU-3.cjs.map → simple-number-field-BjEYE54F.cjs.map} +1 -1
- package/dist/simple-number-field-SDbxL6L7.mjs +2 -0
- package/dist/{simple-number-field-hneXMhfJ.mjs.map → simple-number-field-SDbxL6L7.mjs.map} +1 -1
- package/dist/simple-password-field-Cjp6yzWd.cjs +2 -0
- package/dist/{simple-password-field-BEEcleom.cjs.map → simple-password-field-Cjp6yzWd.cjs.map} +1 -1
- package/dist/simple-password-field-Cnj-hf5g.mjs +2 -0
- package/dist/{simple-password-field-vsLRHDk4.mjs.map → simple-password-field-Cnj-hf5g.mjs.map} +1 -1
- package/dist/simple-radio-group-field-4-eWSXY7.mjs +2 -0
- package/dist/{simple-radio-group-field-BURm_BSA.mjs.map → simple-radio-group-field-4-eWSXY7.mjs.map} +1 -1
- package/dist/simple-radio-group-field-CuA0Q-XI.cjs +2 -0
- package/dist/{simple-radio-group-field-Wm8xB0fN.cjs.map → simple-radio-group-field-CuA0Q-XI.cjs.map} +1 -1
- package/dist/simple-select-field-C0ecQx68.mjs +2 -0
- package/dist/{simple-select-field-8cY51U4d.mjs.map → simple-select-field-C0ecQx68.mjs.map} +1 -1
- package/dist/simple-select-field-CXYJcRY2.cjs +2 -0
- package/dist/{simple-select-field-QQ65caBf.cjs.map → simple-select-field-CXYJcRY2.cjs.map} +1 -1
- package/dist/simple-text-field-DJl5SIGn.mjs +2 -0
- package/dist/{simple-text-field-DK72_OA_.mjs.map → simple-text-field-DJl5SIGn.mjs.map} +1 -1
- package/dist/simple-text-field-DPXqNCXh.cjs +2 -0
- package/dist/{simple-text-field-BHkCPiE5.cjs.map → simple-text-field-DPXqNCXh.cjs.map} +1 -1
- package/dist/simple-textarea-field-BcHdUMTK.mjs +2 -0
- package/dist/{simple-textarea-field-B72nNQHv.mjs.map → simple-textarea-field-BcHdUMTK.mjs.map} +1 -1
- package/dist/simple-textarea-field-ZpXPwYz-.cjs +2 -0
- package/dist/{simple-textarea-field-Bu5h7sfH.cjs.map → simple-textarea-field-ZpXPwYz-.cjs.map} +1 -1
- package/dist/switch-field-CCDuDdpf.cjs +2 -0
- package/dist/{switch-field-eLVlQZSI.cjs.map → switch-field-CCDuDdpf.cjs.map} +1 -1
- package/dist/switch-field-DBGFsmEZ.mjs +2 -0
- package/dist/{switch-field-DoPUWb9d.mjs.map → switch-field-DBGFsmEZ.mjs.map} +1 -1
- package/dist/tanstack-form-BhKAn9I0.mjs +2 -0
- package/dist/tanstack-form-BhKAn9I0.mjs.map +1 -0
- package/dist/tanstack-form-DCB2addt.cjs +2 -0
- package/dist/tanstack-form-DCB2addt.cjs.map +1 -0
- package/dist/text-editor-DWZf3yrW.cjs +2 -0
- package/dist/text-editor-DWZf3yrW.cjs.map +1 -0
- package/dist/text-editor-XBOAwJk-.mjs +2 -0
- package/dist/text-editor-XBOAwJk-.mjs.map +1 -0
- package/dist/text-field-Bx_vnc4O.mjs +2 -0
- package/dist/{text-field-Bm-k6Jr7.mjs.map → text-field-Bx_vnc4O.mjs.map} +1 -1
- package/dist/text-field-DMZZ6CND.cjs +2 -0
- package/dist/{text-field-DT50dOVI.cjs.map → text-field-DMZZ6CND.cjs.map} +1 -1
- package/dist/textarea-field-BmImMdg-.cjs +2 -0
- package/dist/{textarea-field-BhqX29CS.cjs.map → textarea-field-BmImMdg-.cjs.map} +1 -1
- package/dist/textarea-field-Cim3l0y8.mjs +2 -0
- package/dist/{textarea-field-DNLyrRH7.mjs.map → textarea-field-Cim3l0y8.mjs.map} +1 -1
- package/dist/title-field-2dABwspv.mjs +2 -0
- package/dist/{title-field-oAqHRw59.mjs.map → title-field-2dABwspv.mjs.map} +1 -1
- package/dist/title-field-CFnSgTGH.cjs +2 -0
- package/dist/{title-field-B2hM3S_S.cjs.map → title-field-CFnSgTGH.cjs.map} +1 -1
- package/dist/ui/breadcrumb.cjs +1 -1
- package/dist/ui/button-group.cjs +1 -1
- package/dist/ui/button.cjs +1 -1
- package/dist/ui/carousel.cjs +1 -1
- package/dist/ui/dropdown-menu.cjs +1 -1
- package/dist/ui/dropdown-menu.cjs.map +1 -1
- package/dist/ui/dropdown-menu.mjs +1 -1
- package/dist/ui/dropdown-menu.mjs.map +1 -1
- package/dist/ui/file-uploader.cjs +1 -1
- package/dist/ui/item.cjs +1 -1
- package/dist/ui/resizable.cjs +1 -1
- package/dist/ui/resizable.d.cts +1 -1
- package/dist/ui/resizable.d.mts +1 -1
- package/package.json +9 -4
- package/styles/text-editor.css +205 -38
- package/dist/LoginPage-DDljzV6A.d.cts +0 -43
- package/dist/LoginPage-DDljzV6A.d.mts +0 -43
- package/dist/action-submit-B9vHpLoN.cjs +0 -2
- package/dist/action-submit-BQdkz4mS.mjs +0 -2
- package/dist/actions-form-D4n1W3-X.mjs +0 -2
- package/dist/actions-form-DF2eYxGQ.cjs +0 -2
- package/dist/checkbox-field-BRGTLOjq.mjs +0 -2
- package/dist/checkbox-field-ldZRSCca.cjs +0 -2
- package/dist/combobox-field-CvkdZkQE.mjs +0 -2
- package/dist/combobox-field-ZYr7636s.cjs +0 -2
- package/dist/date-field-1Hmcv8Zp.cjs +0 -2
- package/dist/date-field-DGMTG_hu.mjs +0 -2
- package/dist/dialog-form-BRSZpRTC.mjs +0 -2
- package/dist/dialog-form-C1qpltYx.cjs +0 -2
- package/dist/email-field-C2Lvl_rQ.mjs +0 -2
- package/dist/email-field-D3nSkHj2.cjs +0 -2
- package/dist/field-BSLi-P0Q.cjs +0 -2
- package/dist/field-BSLi-P0Q.cjs.map +0 -1
- package/dist/field-V2DoD8qL.mjs +0 -2
- package/dist/field-V2DoD8qL.mjs.map +0 -1
- package/dist/group-field-gejvx_Td.mjs +0 -2
- package/dist/group-field-sVykO2JZ.cjs +0 -2
- package/dist/number-field-CR5PLX6H.mjs +0 -2
- package/dist/number-field-CWDYA3La.cjs +0 -2
- package/dist/pages/LoginPage.cjs +0 -2
- package/dist/pages/LoginPage.cjs.map +0 -1
- package/dist/pages/LoginPage.d.cts +0 -2
- package/dist/pages/LoginPage.d.mts +0 -2
- package/dist/pages/LoginPage.mjs +0 -2
- package/dist/pages/LoginPage.mjs.map +0 -1
- package/dist/password-field-B2_kzss6.mjs +0 -2
- package/dist/password-field-BHRhVyZ0.cjs +0 -2
- package/dist/popover-form-CeRVpy1B.mjs +0 -2
- package/dist/popover-form-Ch_iMMSm.cjs +0 -2
- package/dist/radio-group-field-BFhBfzoT.cjs +0 -2
- package/dist/radio-group-field-Iwo2Q2Ig.mjs +0 -2
- package/dist/rolldown-runtime-CMqjfN_6.cjs +0 -1
- package/dist/select-field-CvDBZQTl.cjs +0 -2
- package/dist/select-field-NJgDDCO2.mjs +0 -2
- package/dist/simple-array-field-BwNCeUnn.mjs +0 -2
- package/dist/simple-array-field-aGXkDZXD.cjs +0 -2
- package/dist/simple-boolean-field-BeVkn3c4.cjs +0 -2
- package/dist/simple-boolean-field-t_XDXqYs.mjs +0 -2
- package/dist/simple-combobox-field-HCB4A33-.mjs +0 -2
- package/dist/simple-combobox-field-U0ZAl7VQ.cjs +0 -2
- package/dist/simple-date-field-Dj4bJoji.mjs +0 -2
- package/dist/simple-date-field-DtxEpEZj.cjs +0 -2
- package/dist/simple-email-field-BDyhkmHV.mjs +0 -2
- package/dist/simple-email-field-DK9I_Tc_.cjs +0 -2
- package/dist/simple-number-field-BspqWU-3.cjs +0 -2
- package/dist/simple-number-field-hneXMhfJ.mjs +0 -2
- package/dist/simple-password-field-BEEcleom.cjs +0 -2
- package/dist/simple-password-field-vsLRHDk4.mjs +0 -2
- package/dist/simple-radio-group-field-BURm_BSA.mjs +0 -2
- package/dist/simple-radio-group-field-Wm8xB0fN.cjs +0 -2
- package/dist/simple-select-field-8cY51U4d.mjs +0 -2
- package/dist/simple-select-field-QQ65caBf.cjs +0 -2
- package/dist/simple-text-field-BHkCPiE5.cjs +0 -2
- package/dist/simple-text-field-DK72_OA_.mjs +0 -2
- package/dist/simple-textarea-field-B72nNQHv.mjs +0 -2
- package/dist/simple-textarea-field-Bu5h7sfH.cjs +0 -2
- package/dist/switch-field-DoPUWb9d.mjs +0 -2
- package/dist/switch-field-eLVlQZSI.cjs +0 -2
- package/dist/tanstack-form-C0ab8EEl.cjs +0 -2
- package/dist/tanstack-form-C0ab8EEl.cjs.map +0 -1
- package/dist/tanstack-form-fkaBh9RO.mjs +0 -2
- package/dist/tanstack-form-fkaBh9RO.mjs.map +0 -1
- package/dist/text-editor-BtfyZSgR.cjs +0 -2
- package/dist/text-editor-BtfyZSgR.cjs.map +0 -1
- package/dist/text-editor-CtR27_PR.mjs +0 -2
- package/dist/text-editor-CtR27_PR.mjs.map +0 -1
- package/dist/text-editor-field-B6HEsAHt.mjs +0 -2
- package/dist/text-editor-field-B6HEsAHt.mjs.map +0 -1
- package/dist/text-editor-field-DcEUC0iH.cjs +0 -2
- package/dist/text-editor-field-DcEUC0iH.cjs.map +0 -1
- package/dist/text-field-Bm-k6Jr7.mjs +0 -2
- package/dist/text-field-DT50dOVI.cjs +0 -2
- package/dist/textarea-field-BhqX29CS.cjs +0 -2
- package/dist/textarea-field-DNLyrRH7.mjs +0 -2
- package/dist/title-field-B2hM3S_S.cjs +0 -2
- package/dist/title-field-oAqHRw59.mjs +0 -2
package/dist/field-V2DoD8qL.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Tooltip as e,TooltipContent as t,TooltipTrigger as n}from"./ui/tooltip.mjs";import{Separator as r}from"./ui/separator.mjs";import{HelpCircleIcon as i,InfoIcon as a}from"lucide-react";import{memo as o,useMemo as s}from"react";import{cn as c}from"@customafk/react-toolkit/utils";import{cva as l}from"class-variance-authority";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{Label as f}from"radix-ui";function p({className:e,children:t,...n}){return d(f.Root,{"data-slot":`label`,className:c(`text-text-positive`,`flex w-full items-center justify-between`,`select-none font-medium text-sm/6 leading-none`,`group-data-[disabled=true]:pointer-events-none`,`group-data-[disabled=true]:opacity-50`,`peer-disabled:cursor-not-allowed`,`peer-disabled:opacity-50`,`aria-required:*:data-[slot=required-indicator]:inline-block`,e),...n,children:[u(`span`,{className:`flex items-center gap-1`,children:t}),u(`span`,{"data-slot":`required-indicator`,className:`hidden shrink-0 rounded-lg bg-danger-strong px-1.5 py-1 font-semibold text-[11px] leading-none text-white`,children:`Bắt buộc`})]})}const m=l(`group/field flex w-full gap-2 data-[invalid=true]:text-danger *:data-[slot=field-content]:gap-0`,{variants:{orientation:{vertical:[`flex-col *:w-full [&>.sr-only]:w-auto`],horizontal:[`flex-row items-center gap-4`,`*:data-[slot=field-content]:basis-1/2`,`*:data-[slot=field-content-main]:flex-1`,`*:data-[slot=field-label]:flex-auto`,`has-[>[data-slot=field-content]]:items-start`,`has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`],responsive:[`flex-col *:w-full [&>.sr-only]:w-auto`,`@md/field-group:flex-row`,`@md/field-group:items-center`,`@md/field-group:gap-4`,`@md/field-group:*:w-auto`,`@md/field-group:*:data-[slot=field-content]:basis-1/2`,`@md/field-group:*:data-[slot=field-content-main]:basis-1/2`,`@md/field-group:*:data-[slot=field-label]:flex-auto`,`@md/field-group:has-[>[data-slot=field-content]]:items-start`,`@md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`]}},defaultVariants:{orientation:`vertical`}}),h=o(({className:e,...t})=>u(`fieldset`,{"data-slot":`field-set`,className:c(`flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t}));h.displayName=`FieldSet`;const g=o(({className:e,variant:t=`legend`,...n})=>u(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:c(`mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,e),...n}));g.displayName=`FieldLegend`;const _=o(({className:e,...t})=>u(`div`,{"data-slot":`field-group`,className:c(`group/field-group @container/field-group`,`flex flex-col gap-7 pt-4`,`data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,e),...t}));_.displayName=`FieldGroup`;const v=o(({className:e,orientation:t=`vertical`,...n})=>u(`div`,{"data-slot":`field`,"data-orientation":t,className:c(m({orientation:t}),e),...n}));v.displayName=`Field`;const y=o(({className:e,...t})=>u(`div`,{"data-slot":`field-content`,className:c(`group/field-content flex flex-col gap-1.5 leading-snug`,e),...t}));y.displayName=`FieldContent`;const b=o(({className:e,...t})=>u(`div`,{"data-slot":`field-content-main`,className:c(`relative`,e),...t}));b.displayName=`FieldContentMain`;const x=o(({className:e,...t})=>u(p,{"data-slot":`field-label`,className:c(`group/field-label peer/field-label min-h-6 gap-1 font-medium leading-snug`,`has-[>[data-slot=field]]:w-full`,`has-[>[data-slot=field]]:flex-col`,`has-[>[data-slot=field]]:rounded-md`,`has-[>[data-slot=field]]:border`,`has-[>[data-slot=field]]:border-border`,`has-data-[state=checked]:border-primary`,`*:data-[slot=field]:p-4 group-data-[disabled=true]/field:opacity-50`,e),...t}));x.displayName=`FieldLabel`;const S=o(({className:e,...t})=>u(`div`,{"data-slot":`field-label`,className:c(`flex w-fit items-center gap-2 font-medium text-sm leading-snug group-data-[disabled=true]/field:opacity-50`,e),...t}));S.displayName=`FieldTitle`;const C=o(({className:e,...t})=>u(`p`,{"data-slot":`field-description`,className:c(`nth-last-2:-mt-1 font-normal text-text-positive-weak text-xs leading-normal last:mt-0 [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4 [[data-variant=legend]+&]:-mt-1.5`,e),...t}));C.displayName=`FieldDescription`;const w=o(({isShow:e=!0,className:t,children:n,...r})=>e===!1?null:d(`div`,{"data-slot":`field-note`,className:c(`flex items-start gap-1.5 rounded border border-primary-muted/60 bg-primary-bg-subtle/80 px-2.5 py-2 text-text-positive-weak text-xs mt-1`,t),...r,children:[u(a,{size:12,className:`mt-0.5 shrink-0 text-primary/70`}),u(`span`,{children:n})]}));w.displayName=`FieldNote`;const T=o(({tooltip:r})=>d(e,{children:[u(n,{asChild:!0,children:d(`button`,{type:`button`,tabIndex:-1,className:`inline-flex cursor-default items-center text-text-positive-weak/70 hover:text-text-positive focus:outline-none`,children:[u(i,{size:13,"aria-hidden":`true`}),u(`span`,{className:`sr-only`,children:`Thêm thông tin`})]})}),u(t,{side:`top`,className:`max-w-xs text-balance`,children:r})]}));T.displayName=`FieldTooltip`;const E=o(({children:e,className:t,...n})=>d(`div`,{"data-slot":`field-separator`,"data-content":!!e,className:c(`relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2`,t),...n,children:[u(r,{className:`absolute inset-0 top-1/2`}),e&&u(`span`,{className:`relative mx-auto block w-fit bg-background px-2 text-text-positive-weak`,"data-slot":`field-separator-content`,children:e})]}));E.displayName=`FieldSeparator`;const D=o(({className:e,children:t,errors:n,requiredMessage:r=`Trường này là bắt buộc`,...i})=>{let a=s(()=>{let e=e=>e.code===`invalid_type`?r:e.message;return t||(n?n?.length===1&&n[0]?.message?u(`div`,{className:`flex flex-row items-center justify-start gap-x-0.5`,children:u(`p`,{children:e(n[0])})}):u(`ul`,{className:`flex list-none flex-col`,children:n.map(t=>typeof t==`string`?u(`li`,{children:t},t):t?.message?u(`li`,{children:e(t)},t.code??t.message):null)}):null)},[t,n,r]);return a?u(`div`,{role:`alert`,"data-slot":`field-error`,className:c(`w-full font-medium text-danger-strong text-xs`,e),...i,children:a}):null});D.displayName=`FieldError`;export{v as Field,y as FieldContent,b as FieldContentMain,C as FieldDescription,D as FieldError,_ as FieldGroup,x as FieldLabel,g as FieldLegend,w as FieldNote,E as FieldSeparator,S as FieldTitle,T as FieldTooltip};
|
|
2
|
-
//# sourceMappingURL=field-V2DoD8qL.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"field-V2DoD8qL.mjs","names":["Label","LabelPrimitive","Label","Tooltip","Separator"],"sources":["../packages/components/features/tanstack-form/components/ui/label.tsx","../packages/components/features/tanstack-form/components/ui/field.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Label as LabelPrimitive } from 'radix-ui';\n\n/**\n * Form field label that automatically renders a \"Required\" badge when the field is marked aria-required.\n *\n * @example\n * import { Label } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <Label htmlFor=\"email\">Email address</Label>\n */\nfunction Label({ className, children, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {\n return (\n <LabelPrimitive.Root\n data-slot=\"label\"\n className={cn(\n 'text-text-positive',\n 'flex w-full items-center justify-between',\n 'select-none font-medium text-sm/6 leading-none',\n 'group-data-[disabled=true]:pointer-events-none',\n 'group-data-[disabled=true]:opacity-50',\n 'peer-disabled:cursor-not-allowed',\n 'peer-disabled:opacity-50',\n 'aria-required:*:data-[slot=required-indicator]:inline-block',\n className\n )}\n {...props}\n >\n <span className=\"flex items-center gap-1\">{children}</span>\n <span\n data-slot=\"required-indicator\"\n className=\"hidden shrink-0 rounded-lg bg-danger-strong px-1.5 py-1 font-semibold text-[11px] leading-none text-white\"\n >\n Bắt buộc\n </span>\n </LabelPrimitive.Root>\n );\n}\n\nexport { Label };\n","'use client';\n\nimport { memo, useMemo } from 'react';\n\nimport { HelpCircleIcon, InfoIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Separator } from '@/components/ui/separator';\nimport { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Label } from './label';\n\nconst fieldVariants = cva('group/field flex w-full gap-2 data-[invalid=true]:text-danger *:data-[slot=field-content]:gap-0', {\n variants: {\n orientation: {\n vertical: ['flex-col *:w-full [&>.sr-only]:w-auto'],\n horizontal: [\n 'flex-row items-center gap-4',\n '*:data-[slot=field-content]:basis-1/2',\n '*:data-[slot=field-content-main]:flex-1',\n '*:data-[slot=field-label]:flex-auto',\n 'has-[>[data-slot=field-content]]:items-start',\n 'has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n ],\n responsive: [\n 'flex-col *:w-full [&>.sr-only]:w-auto',\n '@md/field-group:flex-row',\n '@md/field-group:items-center',\n '@md/field-group:gap-4',\n '@md/field-group:*:w-auto',\n '@md/field-group:*:data-[slot=field-content]:basis-1/2',\n '@md/field-group:*:data-[slot=field-content-main]:basis-1/2',\n '@md/field-group:*:data-[slot=field-label]:flex-auto',\n '@md/field-group:has-[>[data-slot=field-content]]:items-start',\n '@md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n ],\n },\n },\n defaultVariants: {\n orientation: 'vertical',\n },\n});\n\n/**\n * Outermost `<fieldset>` wrapper that stacks multiple `Field` rows with consistent vertical spacing.\n *\n * @example\n * import { FieldSet } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <FieldSet>\n * <Field><FieldLabel>Name</FieldLabel><FieldContent><input /></FieldContent></Field>\n * </FieldSet>\n */\nconst FieldSet = memo(({ className, ...props }: React.ComponentProps<'fieldset'>) => {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn('flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3', className)}\n {...props}\n />\n );\n});\nFieldSet.displayName = 'FieldSet';\n\n/**\n * Props for {@link FieldLegend}.\n */\ntype FieldLegendProps = React.ComponentProps<'legend'> & {\n /**\n * Visual weight of the legend text.\n * - `'legend'` — larger base-size text (section heading).\n * - `'label'` — smaller label-size text (matches field label weight).\n * @default 'legend'\n */\n variant?: 'legend' | 'label';\n};\n\n/**\n * `<legend>` element for a `<fieldset>`, styled as either a section heading or a compact label.\n *\n * @example\n * import { FieldSet, FieldLegend } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <FieldSet>\n * <FieldLegend variant=\"legend\">Personal details</FieldLegend>\n * </FieldSet>\n */\nconst FieldLegend = memo(({ className, variant = 'legend', ...props }: FieldLegendProps) => {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn('mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base', className)}\n {...props}\n />\n );\n});\nFieldLegend.displayName = 'FieldLegend';\n\n/**\n * Container `<div>` that groups a set of `Field` rows with container-query support for responsive layouts.\n *\n * @example\n * import { FieldGroup } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <FieldGroup>\n * <Field>…</Field>\n * <Field>…</Field>\n * </FieldGroup>\n */\nconst FieldGroup = memo(({ className, ...props }: React.ComponentProps<'div'>) => {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n 'group/field-group @container/field-group',\n 'flex flex-col gap-7 pt-4',\n 'data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4',\n className\n )}\n {...props}\n />\n );\n});\nFieldGroup.displayName = 'FieldGroup';\n\n/**\n * Single form field row that arranges label, input, and meta elements with configurable orientation.\n *\n * @example\n * import { Field } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <Field orientation=\"horizontal\">\n * <FieldLabel htmlFor=\"username\">Username</FieldLabel>\n * <FieldContent><input id=\"username\" /></FieldContent>\n * </Field>\n */\nconst Field = memo(({ className, orientation = 'vertical', ...props }: React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>) => {\n return <div data-slot=\"field\" data-orientation={orientation} className={cn(fieldVariants({ orientation }), className)} {...props} />;\n});\nField.displayName = 'Field';\n\n/**\n * Flex column wrapper that houses the primary input control together with description and error slots.\n *\n * @example\n * import { FieldContent } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <FieldContent>\n * <input type=\"text\" />\n * <FieldDescription>Enter your full name.</FieldDescription>\n * </FieldContent>\n */\nconst FieldContent = memo(({ className, ...props }: React.ComponentProps<'div'>) => {\n return <div data-slot=\"field-content\" className={cn('group/field-content flex flex-col gap-1.5 leading-snug', className)} {...props} />;\n});\nFieldContent.displayName = 'FieldContent';\n\n/**\n * Positioned wrapper for the main input element that enables absolutely-placed adornments (icons, spinners).\n *\n * @example\n * import { FieldContentMain } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <FieldContentMain>\n * <input type=\"text\" className=\"pr-8\" />\n * <SearchIcon className=\"absolute right-2 top-2\" />\n * </FieldContentMain>\n */\nconst FieldContentMain = memo(({ className, ...props }: React.ComponentProps<'div'>) => {\n return <div data-slot=\"field-content-main\" className={cn('relative', className)} {...props} />;\n});\nFieldContentMain.displayName = 'FieldContentMain';\n\n/**\n * Styled `<label>` element for a `Field`, extending the base `Label` with field-group-aware spacing and border states.\n *\n * @example\n * import { FieldLabel } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <FieldLabel htmlFor=\"email\" aria-required>Email</FieldLabel>\n */\nconst FieldLabel = memo(({ className, ...props }: React.ComponentProps<typeof Label>) => {\n return (\n <Label\n data-slot=\"field-label\"\n className={cn(\n 'group/field-label peer/field-label min-h-6 gap-1 font-medium leading-snug',\n 'has-[>[data-slot=field]]:w-full',\n 'has-[>[data-slot=field]]:flex-col',\n 'has-[>[data-slot=field]]:rounded-md',\n 'has-[>[data-slot=field]]:border',\n 'has-[>[data-slot=field]]:border-border',\n 'has-data-[state=checked]:border-primary',\n '*:data-[slot=field]:p-4 group-data-[disabled=true]/field:opacity-50',\n className\n )}\n {...props}\n />\n );\n});\nFieldLabel.displayName = 'FieldLabel';\n\n/**\n * Inline title element (non-`<label>`) for fields whose label cannot be a native `<label>`, such as custom checkbox groups.\n *\n * @example\n * import { FieldTitle } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <FieldTitle>Notification preferences</FieldTitle>\n */\nconst FieldTitle = memo(({ className, ...props }: React.ComponentProps<'div'>) => {\n return (\n <div\n data-slot=\"field-label\"\n className={cn('flex w-fit items-center gap-2 font-medium text-sm leading-snug group-data-[disabled=true]/field:opacity-50', className)}\n {...props}\n />\n );\n});\nFieldTitle.displayName = 'FieldTitle';\n\n/**\n * Supplementary hint text rendered below the input to guide the user, with support for inline anchor links.\n *\n * @example\n * import { FieldDescription } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <FieldDescription>Must be at least 8 characters.</FieldDescription>\n */\nconst FieldDescription = memo(({ className, ...props }: React.ComponentProps<'p'>) => {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n // biome-ignore lint/security/noSecrets: true\n 'nth-last-2:-mt-1 font-normal text-text-positive-weak text-xs leading-normal last:mt-0 [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4 [[data-variant=legend]+&]:-mt-1.5',\n className\n )}\n {...props}\n />\n );\n});\nFieldDescription.displayName = 'FieldDescription';\n\n/**\n * Props for {@link FieldNote}.\n */\ntype FieldNoteProps = React.ComponentProps<'div'> & {\n /**\n * When `false` the note is not rendered at all; useful for conditional display without wrapper conditionals.\n * @default true\n */\n isShow?: boolean;\n};\n\n/**\n * Highlighted informational callout box with an info icon, shown below a field to surface contextual guidance.\n *\n * @example\n * import { FieldNote } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <FieldNote isShow={isDraftMode}>Changes are saved automatically in draft mode.</FieldNote>\n */\nconst FieldNote = memo(({ isShow = true, className, children, ...props }: FieldNoteProps) => {\n if (isShow === false) return null;\n return (\n <div\n data-slot=\"field-note\"\n className={cn(\n 'flex items-start gap-1.5 rounded border border-primary-muted/60 bg-primary-bg-subtle/80 px-2.5 py-2 text-text-positive-weak text-xs mt-1',\n className\n )}\n {...props}\n >\n <InfoIcon size={12} className=\"mt-0.5 shrink-0 text-primary/70\" />\n <span>{children}</span>\n </div>\n );\n});\nFieldNote.displayName = 'FieldNote';\n\n/**\n * Props for {@link FieldTooltip}.\n */\ntype FieldTooltipProps = {\n /** Text content displayed inside the tooltip when the help icon is hovered or focused. */\n tooltip: string;\n};\n\n/**\n * Small help-circle icon button that reveals a tooltip with additional field context on hover or focus.\n *\n * @example\n * import { FieldTooltip } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <FieldLabel>\n * Password <FieldTooltip tooltip=\"Use at least one uppercase letter and one number.\" />\n * </FieldLabel>\n */\nconst FieldTooltip = memo(({ tooltip }: FieldTooltipProps) => {\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n tabIndex={-1}\n className=\"inline-flex cursor-default items-center text-text-positive-weak/70 hover:text-text-positive focus:outline-none\"\n >\n <HelpCircleIcon size={13} aria-hidden=\"true\" />\n <span className=\"sr-only\">Thêm thông tin</span>\n </button>\n </TooltipTrigger>\n <TooltipContent side=\"top\" className=\"max-w-xs text-balance\">\n {tooltip}\n </TooltipContent>\n </Tooltip>\n );\n});\nFieldTooltip.displayName = 'FieldTooltip';\n\n/**\n * Visual divider row that optionally displays a centered text label, used to separate logical sections within a `FieldGroup`.\n *\n * @example\n * import { FieldSeparator } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <FieldSeparator>or</FieldSeparator>\n */\nconst FieldSeparator = memo(({ children, className, ...props }: React.PropsWithChildren<React.ComponentProps<'div'>>) => {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn('relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2', className)}\n {...props}\n >\n <Separator className=\"absolute inset-0 top-1/2\" />\n {children && (\n <span className=\"relative mx-auto block w-fit bg-background px-2 text-text-positive-weak\" data-slot=\"field-separator-content\">\n {children}\n </span>\n )}\n </div>\n );\n});\nFieldSeparator.displayName = 'FieldSeparator';\n\n/**\n * Props for {@link FieldError}.\n */\ntype FieldErrorProps = React.ComponentProps<'div'> & {\n errors?: Array<{ code?: string; message?: string } | undefined>;\n requiredMessage?: string;\n};\n\nconst FieldError = memo(({ className, children, errors, requiredMessage = 'Trường này là bắt buộc', ...props }: FieldErrorProps) => {\n const content = useMemo(() => {\n const resolve = (error: { code?: string; message?: string }) => (error.code === 'invalid_type' ? requiredMessage : error.message);\n\n if (children) {\n return children;\n }\n\n if (!errors) {\n return null;\n }\n\n if (errors?.length === 1 && errors[0]?.message) {\n return (\n <div className=\"flex flex-row items-center justify-start gap-x-0.5\">\n <p>{resolve(errors[0])}</p>\n </div>\n );\n }\n\n return (\n <ul className=\"flex list-none flex-col\">\n {errors.map(error => {\n if (typeof error === 'string') return <li key={error}>{error}</li>;\n if (!error?.message) return null;\n return <li key={error.code ?? error.message}>{resolve(error)}</li>;\n })}\n </ul>\n );\n }, [children, errors, requiredMessage]);\n\n if (!content) {\n return null;\n }\n\n return (\n <div role=\"alert\" data-slot=\"field-error\" className={cn('w-full font-medium text-danger-strong text-xs', className)} {...props}>\n {content}\n </div>\n );\n});\nFieldError.displayName = 'FieldError';\n\nexport {\n Field,\n FieldLabel,\n FieldDescription,\n FieldNote,\n FieldError,\n FieldGroup,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldContent,\n FieldContentMain,\n FieldTitle,\n FieldTooltip,\n};\n"],"mappings":"8ZAcA,SAASA,EAAM,CAAE,YAAW,WAAU,GAAG,GAA2D,CAClG,OACE,EAACC,EAAe,KAAhB,CACE,YAAU,QACV,UAAW,EACT,qBACA,2CACA,iDACA,iDACA,wCACA,mCACA,2BACA,8DACA,CACF,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@
|
|
|
1
|
-
import{Field as e,FieldContent as t,FieldContentMain as n,FieldDescription as r,FieldGroup as i,FieldLabel as a,FieldNote as o,FieldSeparator as s}from"./field-V2DoD8qL.mjs";import{jsx as c,jsxs as l}from"react/jsx-runtime";const u=({label:u,description:d,helperText:f,orientation:p=`responsive`,children:m})=>l(i,{className:`gap-y-4 px-4`,children:[l(e,{orientation:p,children:[l(t,{children:[c(a,{children:u}),c(r,{children:d})]}),l(n,{children:[m,c(o,{isShow:!!f,children:f})]})]}),c(s,{})]});export{u as TanStackFieldGroup};
|
|
2
|
-
//# sourceMappingURL=group-field-gejvx_Td.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("./field-BSLi-P0Q.cjs");let t=require("react/jsx-runtime");const n=({label:n,description:r,helperText:i,orientation:a=`responsive`,children:o})=>(0,t.jsxs)(e.FieldGroup,{className:`gap-y-4 px-4`,children:[(0,t.jsxs)(e.Field,{orientation:a,children:[(0,t.jsxs)(e.FieldContent,{children:[(0,t.jsx)(e.FieldLabel,{children:n}),(0,t.jsx)(e.FieldDescription,{children:r})]}),(0,t.jsxs)(e.FieldContentMain,{children:[o,(0,t.jsx)(e.FieldNote,{isShow:!!i,children:i})]})]}),(0,t.jsx)(e.FieldSeparator,{})]});exports.TanStackFieldGroup=n;
|
|
2
|
-
//# sourceMappingURL=group-field-sVykO2JZ.cjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{G as e}from"./tanstack-form-fkaBh9RO.mjs";import{Field as t,FieldContent as n,FieldContentMain as r,FieldDescription as i,FieldError as a,FieldGroup as o,FieldLabel as s,FieldNote as c,FieldSeparator as l,FieldTooltip as u}from"./field-V2DoD8qL.mjs";import{t as d}from"./number-input-CJcEV9Cg.mjs";import{BanIcon as f,Loader2Icon as p}from"lucide-react";import{memo as m,useCallback as h,useId as g}from"react";import{cn as _}from"@customafk/react-toolkit/utils";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{useStore as b}from"@tanstack/react-form";const x=m(({label:m,description:x,placeholder:S,tooltip:C,helperText:w,orientation:T=`responsive`,showErrorMessage:E=!0,rounding:D,decimalPlaces:O,precision:k,unit:A,required:j=!1,disabled:M=!1,allowNegative:N})=>{let P=g(),F=g(),I=e(),L=b(I.form.store,({isSubmitting:e})=>e),R=M||L,z=I.state.meta.isDirty||I.state.meta.isTouched,B=z&&!I.state.meta.isValid,V=j&&I.state.value===null,H=!!I.state.meta.errors.length,U=h(e=>{R||I.handleChange(e)},[R,I.handleChange]);return y(o,{className:`gap-y-4 px-4`,children:[y(t,{orientation:T,"data-invalid":B,children:[y(n,{children:[y(s,{htmlFor:P,"aria-required":V,children:[m,C&&v(u,{tooltip:C})]}),v(i,{children:x})]}),y(r,{children:[y(`div`,{className:`relative w-full`,children:[v(d,{id:P,value:I.state.value,"aria-invalid":B,"aria-describedby":F,placeholder:S,disabled:R,roundingRule:D,numberAfterDecimalPoint:O,precision:k,unitText:A,allowNegative:N,className:_(R&&`pointer-events-none opacity-60`),onBlur:I.handleBlur,onValueChange:U}),L&&v(`div`,{className:`pointer-events-none absolute inset-s-2 inset-y-0 top-2.5 [&>svg]:size-3.5`,children:v(p,{className:`animate-spin text-primary-strong`})}),!L&&z&&E&&H&&v(`div`,{className:`pointer-events-none absolute inset-s-2 inset-y-0 top-2.75 text-danger-strong [&>svg]:size-3.5`,children:v(f,{})}),v(`div`,{className:`mt-1 flex w-full items-start justify-between gap-x-2`,children:z&&E?v(a,{id:F,className:`flex-1`,errors:I.state.meta.errors}):v(`div`,{})})]}),v(c,{isShow:!!w,children:w})]})]}),v(l,{})]})});x.displayName=`NumberField`;export{x as NumberField};
|
|
2
|
-
//# sourceMappingURL=number-field-CR5PLX6H.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("./tanstack-form-C0ab8EEl.cjs"),t=require("./field-BSLi-P0Q.cjs"),n=require("./number-input-CAr3JaA-.cjs");let r=require("lucide-react"),i=require("react"),a=require("@customafk/react-toolkit/utils"),o=require("react/jsx-runtime"),s=require("@tanstack/react-form");const c=(0,i.memo)(({label:c,description:l,placeholder:u,tooltip:d,helperText:f,orientation:p=`responsive`,showErrorMessage:m=!0,rounding:h,decimalPlaces:g,precision:_,unit:v,required:y=!1,disabled:b=!1,allowNegative:x})=>{let S=(0,i.useId)(),C=(0,i.useId)(),w=e.G(),T=(0,s.useStore)(w.form.store,({isSubmitting:e})=>e),E=b||T,D=w.state.meta.isDirty||w.state.meta.isTouched,O=D&&!w.state.meta.isValid,k=y&&w.state.value===null,A=!!w.state.meta.errors.length,j=(0,i.useCallback)(e=>{E||w.handleChange(e)},[E,w.handleChange]);return(0,o.jsxs)(t.FieldGroup,{className:`gap-y-4 px-4`,children:[(0,o.jsxs)(t.Field,{orientation:p,"data-invalid":O,children:[(0,o.jsxs)(t.FieldContent,{children:[(0,o.jsxs)(t.FieldLabel,{htmlFor:S,"aria-required":k,children:[c,d&&(0,o.jsx)(t.FieldTooltip,{tooltip:d})]}),(0,o.jsx)(t.FieldDescription,{children:l})]}),(0,o.jsxs)(t.FieldContentMain,{children:[(0,o.jsxs)(`div`,{className:`relative w-full`,children:[(0,o.jsx)(n.t,{id:S,value:w.state.value,"aria-invalid":O,"aria-describedby":C,placeholder:u,disabled:E,roundingRule:h,numberAfterDecimalPoint:g,precision:_,unitText:v,allowNegative:x,className:(0,a.cn)(E&&`pointer-events-none opacity-60`),onBlur:w.handleBlur,onValueChange:j}),T&&(0,o.jsx)(`div`,{className:`pointer-events-none absolute inset-s-2 inset-y-0 top-2.5 [&>svg]:size-3.5`,children:(0,o.jsx)(r.Loader2Icon,{className:`animate-spin text-primary-strong`})}),!T&&D&&m&&A&&(0,o.jsx)(`div`,{className:`pointer-events-none absolute inset-s-2 inset-y-0 top-2.75 text-danger-strong [&>svg]:size-3.5`,children:(0,o.jsx)(r.BanIcon,{})}),(0,o.jsx)(`div`,{className:`mt-1 flex w-full items-start justify-between gap-x-2`,children:D&&m?(0,o.jsx)(t.FieldError,{id:C,className:`flex-1`,errors:w.state.meta.errors}):(0,o.jsx)(`div`,{})})]}),(0,o.jsx)(t.FieldNote,{isShow:!!f,children:f})]})]}),(0,o.jsx)(t.FieldSeparator,{})]})});c.displayName=`NumberField`,exports.NumberField=c;
|
|
2
|
-
//# sourceMappingURL=number-field-CWDYA3La.cjs.map
|
package/dist/pages/LoginPage.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../ui/button.cjs"),t=require("../features/logo/index.cjs"),n=require("../ui/dialog.cjs"),r=require("../ui/input.cjs"),i=require("../alert-D31c6DLq.cjs"),a=require("../ui/label.cjs");let o=require("lucide-react"),s=require("react"),c=require("react/jsx-runtime"),l=require("zod/v4");const u=l.z.object({email:l.z.string().min(1,`Vui lòng nhập email`).email(`Email không hợp lệ`),password:l.z.string().min(1,`Vui lòng nhập mật khẩu`)}),d=({open:l,onOpenChange:d,onLogin:f,onForgotPassword:p,onRegister:m,isLoading:h=!1,errorMessage:g,title:_=`Đăng nhập`,subtitle:v=`Nhập thông tin để tiếp tục`})=>{let y=(0,s.useId)(),b=(0,s.useId)(),[x,S]=(0,s.useState)(``),[C,w]=(0,s.useState)(``),[T,E]=(0,s.useState)(!1),[D,O]=(0,s.useState)({});return(0,c.jsx)(n.Dialog,{open:l,onOpenChange:d,children:(0,c.jsxs)(n.DialogContent,{className:`max-sm:data-[state=open]:slide-in-from-bottom max-sm:data-[state=open]:zoom-in-100 max-sm:data-[state=closed]:slide-out-to-bottom max-sm:data-[state=closed]:zoom-out-100 max-sm:top-auto max-sm:right-0 max-sm:bottom-0 max-sm:left-0 max-sm:max-w-full max-sm:translate-x-0 max-sm:translate-y-0 max-sm:rounded-b-none sm:max-w-sm`,children:[(0,c.jsxs)(n.DialogHeader,{children:[(0,c.jsx)(t.LunasLogo,{variant:`horizontal`,size:`sm`,className:`mx-auto`}),(0,c.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,c.jsx)(n.DialogTitle,{children:_}),(0,c.jsx)(n.DialogDescription,{children:v})]})]}),(0,c.jsxs)(`form`,{onSubmit:async e=>{e.preventDefault();let t=u.safeParse({email:x,password:C});if(!t.success){let e=t.error.flatten().fieldErrors;O({email:e.email?.[0],password:e.password?.[0]});return}O({}),await f(x,C)},noValidate:!0,className:`flex flex-col gap-4`,children:[g&&(0,c.jsx)(i.t,{variant:`destructive`,children:(0,c.jsx)(i.n,{children:g})}),(0,c.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,c.jsx)(a.Label,{htmlFor:y,children:`Email`}),(0,c.jsx)(r.Input,{id:y,type:`email`,autoComplete:`email`,placeholder:`you@example.com`,value:x,onChange:e=>S(e.target.value),"aria-invalid":!!D.email,disabled:h}),D.email&&(0,c.jsx)(`p`,{className:`text-destructive text-xs`,children:D.email})]}),(0,c.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,c.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,c.jsx)(a.Label,{htmlFor:b,children:`Mật khẩu`}),p&&(0,c.jsx)(e.Button,{type:`button`,variant:`link`,size:`sm`,className:`h-auto p-0 text-xs`,onClick:p,children:`Quên mật khẩu?`})]}),(0,c.jsxs)(`div`,{className:`relative`,children:[(0,c.jsx)(r.Input,{id:b,type:T?`text`:`password`,autoComplete:`current-password`,placeholder:`••••••••`,value:C,onChange:e=>w(e.target.value),"aria-invalid":!!D.password,disabled:h,className:`pr-10`}),(0,c.jsx)(`button`,{type:`button`,className:`absolute inset-y-0 right-0 flex items-center px-3 text-muted-foreground hover:text-foreground`,onMouseDown:e=>{e.preventDefault(),E(e=>!e)},"aria-label":T?`Ẩn mật khẩu`:`Hiện mật khẩu`,children:T?(0,c.jsx)(o.EyeOff,{size:16}):(0,c.jsx)(o.Eye,{size:16})})]}),D.password&&(0,c.jsx)(`p`,{className:`text-destructive text-xs`,children:D.password})]}),(0,c.jsx)(e.Button,{type:`submit`,isLoading:h,className:`w-full`,children:`Đăng nhập`}),(0,c.jsx)(e.Button,{type:`button`,variant:`outline`,className:`w-full`,disabled:h,onClick:()=>d(!1),children:`Đóng hộp thoại`})]}),m&&(0,c.jsxs)(`div`,{className:`flex justify-center gap-1 text-muted-foreground text-sm`,children:[(0,c.jsx)(`span`,{children:`Chưa có tài khoản?`}),(0,c.jsx)(e.Button,{variant:`link`,size:`sm`,className:`h-auto p-0`,onClick:m,children:`Đăng ký`})]})]})})};exports.LoginPage=d;
|
|
2
|
-
//# sourceMappingURL=LoginPage.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LoginPage.cjs","names":["z","Dialog","DialogContent","DialogHeader","LunasLogo","DialogTitle","DialogDescription","Alert","AlertDescription","Label","Input","Button","EyeOff","Eye"],"sources":["../../packages/components/pages/LoginPage.tsx"],"sourcesContent":["'use client';\n\nimport { useId, useState } from 'react';\n\nimport { Eye, EyeOff } from 'lucide-react';\nimport { z } from 'zod/v4';\n\nimport { Alert, AlertDescription } from '../ui/alert';\nimport { Button } from '../ui/button';\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '../ui/dialog';\nimport { LunasLogo } from '../features/logo';\nimport { Input } from '../ui/input';\nimport { Label } from '../ui/label';\n\nexport interface LoginPageProps {\n /** Controls whether the dialog is open */\n open: boolean;\n /** Called when the dialog open state changes */\n onOpenChange: (open: boolean) => void;\n /** Called when the user submits login credentials */\n onLogin: (email: string, password: string) => Promise<void> | void;\n /** Called when the \"Quên mật khẩu?\" link is clicked */\n onForgotPassword?: () => void;\n /** Called when the \"Đăng ký\" link is clicked */\n onRegister?: () => void;\n /** Disables the form and shows a spinner on the submit button */\n isLoading?: boolean;\n /** Server-side error message rendered in a destructive Alert */\n errorMessage?: string;\n /** Dialog heading. Default: \"Đăng nhập\" */\n title?: string;\n /** Dialog subheading. Default: \"Nhập thông tin để tiếp tục\" */\n subtitle?: string;\n}\n\nconst loginSchema = z.object({\n email: z.string().min(1, 'Vui lòng nhập email').email('Email không hợp lệ'),\n password: z.string().min(1, 'Vui lòng nhập mật khẩu'),\n});\n\n/**\n * Modal login dialog for the client authentication flow.\n *\n * @example\n * ```tsx\n * import { LoginPage } from '@customafk/lunas-ui/pages/LoginPage';\n *\n * <LoginPage\n * open={open}\n * onOpenChange={setOpen}\n * onLogin={async (email, password) => {\n * await authService.login(email, password);\n * setOpen(false);\n * }}\n * onRegister={() => { setOpen(false); setRegisterOpen(true); }}\n * />\n * ```\n */\nexport const LoginPage = ({\n open,\n onOpenChange,\n onLogin,\n onForgotPassword,\n onRegister,\n isLoading = false,\n errorMessage,\n title = 'Đăng nhập',\n subtitle = 'Nhập thông tin để tiếp tục',\n}: LoginPageProps) => {\n const emailId = useId();\n const passwordId = useId();\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const [showPassword, setShowPassword] = useState(false);\n const [fieldErrors, setFieldErrors] = useState<{ email?: string; password?: string }>({});\n\n const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n const result = loginSchema.safeParse({ email, password });\n if (!result.success) {\n const errors = result.error.flatten().fieldErrors;\n setFieldErrors({ email: errors.email?.[0], password: errors.password?.[0] });\n return;\n }\n setFieldErrors({});\n await onLogin(email, password);\n };\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className=\"max-sm:data-[state=open]:slide-in-from-bottom max-sm:data-[state=open]:zoom-in-100 max-sm:data-[state=closed]:slide-out-to-bottom max-sm:data-[state=closed]:zoom-out-100 max-sm:top-auto max-sm:right-0 max-sm:bottom-0 max-sm:left-0 max-sm:max-w-full max-sm:translate-x-0 max-sm:translate-y-0 max-sm:rounded-b-none sm:max-w-sm\">\n <DialogHeader>\n <LunasLogo variant=\"horizontal\" size=\"sm\" className=\"mx-auto\" />\n <div className=\"flex flex-col gap-0.5\">\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{subtitle}</DialogDescription>\n </div>\n </DialogHeader>\n\n <form onSubmit={handleSubmit} noValidate className=\"flex flex-col gap-4\">\n {errorMessage && (\n <Alert variant=\"destructive\">\n <AlertDescription>{errorMessage}</AlertDescription>\n </Alert>\n )}\n\n <div className=\"flex flex-col gap-1.5\">\n <Label htmlFor={emailId}>Email</Label>\n <Input\n id={emailId}\n type=\"email\"\n autoComplete=\"email\"\n placeholder=\"you@example.com\"\n value={email}\n onChange={e => setEmail(e.target.value)}\n aria-invalid={!!fieldErrors.email}\n disabled={isLoading}\n />\n {fieldErrors.email && <p className=\"text-destructive text-xs\">{fieldErrors.email}</p>}\n </div>\n\n <div className=\"flex flex-col gap-1.5\">\n <div className=\"flex items-center justify-between\">\n <Label htmlFor={passwordId}>Mật khẩu</Label>\n {onForgotPassword && (\n <Button type=\"button\" variant=\"link\" size=\"sm\" className=\"h-auto p-0 text-xs\" onClick={onForgotPassword}>\n Quên mật khẩu?\n </Button>\n )}\n </div>\n <div className=\"relative\">\n <Input\n id={passwordId}\n type={showPassword ? 'text' : 'password'}\n autoComplete=\"current-password\"\n placeholder=\"••••••••\"\n value={password}\n onChange={e => setPassword(e.target.value)}\n aria-invalid={!!fieldErrors.password}\n disabled={isLoading}\n className=\"pr-10\"\n />\n <button\n type=\"button\"\n className=\"absolute inset-y-0 right-0 flex items-center px-3 text-muted-foreground hover:text-foreground\"\n onMouseDown={e => {\n e.preventDefault();\n setShowPassword(v => !v);\n }}\n aria-label={showPassword ? 'Ẩn mật khẩu' : 'Hiện mật khẩu'}\n >\n {showPassword ? <EyeOff size={16} /> : <Eye size={16} />}\n </button>\n </div>\n {fieldErrors.password && <p className=\"text-destructive text-xs\">{fieldErrors.password}</p>}\n </div>\n\n <Button type=\"submit\" isLoading={isLoading} className=\"w-full\">\n Đăng nhập\n </Button>\n <Button type=\"button\" variant=\"outline\" className=\"w-full\" disabled={isLoading} onClick={() => onOpenChange(false)}>\n Đóng hộp thoại\n </Button>\n </form>\n\n {onRegister && (\n <div className=\"flex justify-center gap-1 text-muted-foreground text-sm\">\n <span>Chưa có tài khoản?</span>\n <Button variant=\"link\" size=\"sm\" className=\"h-auto p-0\" onClick={onRegister}>\n Đăng ký\n </Button>\n </div>\n )}\n </DialogContent>\n </Dialog>\n );\n};\n"],"mappings":"2XAmCA,MAAM,EAAcA,EAAAA,EAAE,OAAO,CAC3B,MAAOA,EAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,EAAG,qBAAqB,CAAC,CAAC,MAAM,oBAAoB,EAC1E,SAAUA,EAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,EAAG,wBAAwB,CACtD,CAAC,EAoBY,GAAa,CACxB,OACA,eACA,UACA,mBACA,aACA,YAAY,GACZ,eACA,QAAQ,YACR,WAAW,gCACS,CACpB,IAAM,GAAA,EAAA,EAAA,MAAA,CAAgB,EAChB,GAAA,EAAA,EAAA,MAAA,CAAmB,EACnB,CAAC,EAAO,IAAA,EAAA,EAAA,SAAA,CAAqB,EAAE,EAC/B,CAAC,EAAU,IAAA,EAAA,EAAA,SAAA,CAAwB,EAAE,EACrC,CAAC,EAAc,IAAA,EAAA,EAAA,SAAA,CAA4B,EAAK,EAChD,CAAC,EAAa,IAAA,EAAA,EAAA,SAAA,CAAkE,CAAC,CAAC,EAcxF,OACE,EAAA,EAAA,IAAA,CAACC,EAAAA,OAAD,CAAc,OAAoB,eAChC,UAAA,EAAA,EAAA,KAAA,CAACC,EAAAA,cAAD,CAAe,UAAU,uUAAzB,SAAA,EACE,EAAA,EAAA,KAAA,CAACC,EAAAA,aAAD,CAAA,SAAA,EACE,EAAA,EAAA,IAAA,CAACC,EAAAA,UAAD,CAAW,QAAQ,aAAa,KAAK,KAAK,UAAU,SAAW,CAAA,GAC/D,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,wBAAf,SAAA,EACE,EAAA,EAAA,IAAA,CAACC,EAAAA,YAAD,CAAA,SAAc,CAAmB,CAAA,GACjC,EAAA,EAAA,IAAA,CAACC,EAAAA,kBAAD,CAAA,SAAoB,CAA4B,CA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A,IAAA,CAACA,EAAAA,OAAD,CAAQ,QAAQ,OAAO,KAAK,KAAK,UAAU,aAAa,QAAS,EAAY,SAAA,SAErE,CAAA,CACL,GAEM,GACT,CAAA,CAEZ"}
|
package/dist/pages/LoginPage.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";import{Button as e}from"../ui/button.mjs";import{LunasLogo as t}from"../features/logo/index.mjs";import{Dialog as n,DialogContent as r,DialogDescription as i,DialogHeader as a,DialogTitle as o}from"../ui/dialog.mjs";import{Input as s}from"../ui/input.mjs";import{n as c,t as l}from"../alert-OD1KJTEV.mjs";import{Label as u}from"../ui/label.mjs";import{Eye as d,EyeOff as f}from"lucide-react";import{useId as p,useState as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{z as _}from"zod/v4";const v=_.object({email:_.string().min(1,`Vui lòng nhập email`).email(`Email không hợp lệ`),password:_.string().min(1,`Vui lòng nhập mật khẩu`)}),y=({open:_,onOpenChange:y,onLogin:b,onForgotPassword:x,onRegister:S,isLoading:C=!1,errorMessage:w,title:T=`Đăng nhập`,subtitle:E=`Nhập thông tin để tiếp tục`})=>{let D=p(),O=p(),[k,A]=m(``),[j,M]=m(``),[N,P]=m(!1),[F,I]=m({});return h(n,{open:_,onOpenChange:y,children:g(r,{className:`max-sm:data-[state=open]:slide-in-from-bottom max-sm:data-[state=open]:zoom-in-100 max-sm:data-[state=closed]:slide-out-to-bottom max-sm:data-[state=closed]:zoom-out-100 max-sm:top-auto max-sm:right-0 max-sm:bottom-0 max-sm:left-0 max-sm:max-w-full max-sm:translate-x-0 max-sm:translate-y-0 max-sm:rounded-b-none sm:max-w-sm`,children:[g(a,{children:[h(t,{variant:`horizontal`,size:`sm`,className:`mx-auto`}),g(`div`,{className:`flex flex-col gap-0.5`,children:[h(o,{children:T}),h(i,{children:E})]})]}),g(`form`,{onSubmit:async e=>{e.preventDefault();let t=v.safeParse({email:k,password:j});if(!t.success){let e=t.error.flatten().fieldErrors;I({email:e.email?.[0],password:e.password?.[0]});return}I({}),await b(k,j)},noValidate:!0,className:`flex flex-col gap-4`,children:[w&&h(l,{variant:`destructive`,children:h(c,{children:w})}),g(`div`,{className:`flex flex-col gap-1.5`,children:[h(u,{htmlFor:D,children:`Email`}),h(s,{id:D,type:`email`,autoComplete:`email`,placeholder:`you@example.com`,value:k,onChange:e=>A(e.target.value),"aria-invalid":!!F.email,disabled:C}),F.email&&h(`p`,{className:`text-destructive text-xs`,children:F.email})]}),g(`div`,{className:`flex flex-col gap-1.5`,children:[g(`div`,{className:`flex items-center justify-between`,children:[h(u,{htmlFor:O,children:`Mật khẩu`}),x&&h(e,{type:`button`,variant:`link`,size:`sm`,className:`h-auto p-0 text-xs`,onClick:x,children:`Quên mật khẩu?`})]}),g(`div`,{className:`relative`,children:[h(s,{id:O,type:N?`text`:`password`,autoComplete:`current-password`,placeholder:`••••••••`,value:j,onChange:e=>M(e.target.value),"aria-invalid":!!F.password,disabled:C,className:`pr-10`}),h(`button`,{type:`button`,className:`absolute inset-y-0 right-0 flex items-center px-3 text-muted-foreground hover:text-foreground`,onMouseDown:e=>{e.preventDefault(),P(e=>!e)},"aria-label":N?`Ẩn mật khẩu`:`Hiện mật khẩu`,children:h(N?f:d,{size:16})})]}),F.password&&h(`p`,{className:`text-destructive text-xs`,children:F.password})]}),h(e,{type:`submit`,isLoading:C,className:`w-full`,children:`Đăng nhập`}),h(e,{type:`button`,variant:`outline`,className:`w-full`,disabled:C,onClick:()=>y(!1),children:`Đóng hộp thoại`})]}),S&&g(`div`,{className:`flex justify-center gap-1 text-muted-foreground text-sm`,children:[h(`span`,{children:`Chưa có tài khoản?`}),h(e,{variant:`link`,size:`sm`,className:`h-auto p-0`,onClick:S,children:`Đăng ký`})]})]})})};export{y as LoginPage};
|
|
2
|
-
//# sourceMappingURL=LoginPage.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LoginPage.mjs","names":[],"sources":["../../packages/components/pages/LoginPage.tsx"],"sourcesContent":["'use client';\n\nimport { useId, useState } from 'react';\n\nimport { Eye, EyeOff } from 'lucide-react';\nimport { z } from 'zod/v4';\n\nimport { Alert, AlertDescription } from '../ui/alert';\nimport { Button } from '../ui/button';\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '../ui/dialog';\nimport { LunasLogo } from '../features/logo';\nimport { Input } from '../ui/input';\nimport { Label } from '../ui/label';\n\nexport interface LoginPageProps {\n /** Controls whether the dialog is open */\n open: boolean;\n /** Called when the dialog open state changes */\n onOpenChange: (open: boolean) => void;\n /** Called when the user submits login credentials */\n onLogin: (email: string, password: string) => Promise<void> | void;\n /** Called when the \"Quên mật khẩu?\" link is clicked */\n onForgotPassword?: () => void;\n /** Called when the \"Đăng ký\" link is clicked */\n onRegister?: () => void;\n /** Disables the form and shows a spinner on the submit button */\n isLoading?: boolean;\n /** Server-side error message rendered in a destructive Alert */\n errorMessage?: string;\n /** Dialog heading. Default: \"Đăng nhập\" */\n title?: string;\n /** Dialog subheading. Default: \"Nhập thông tin để tiếp tục\" */\n subtitle?: string;\n}\n\nconst loginSchema = z.object({\n email: z.string().min(1, 'Vui lòng nhập email').email('Email không hợp lệ'),\n password: z.string().min(1, 'Vui lòng nhập mật khẩu'),\n});\n\n/**\n * Modal login dialog for the client authentication flow.\n *\n * @example\n * ```tsx\n * import { LoginPage } from '@customafk/lunas-ui/pages/LoginPage';\n *\n * <LoginPage\n * open={open}\n * onOpenChange={setOpen}\n * onLogin={async (email, password) => {\n * await authService.login(email, password);\n * setOpen(false);\n * }}\n * onRegister={() => { setOpen(false); setRegisterOpen(true); }}\n * />\n * ```\n */\nexport const LoginPage = ({\n open,\n onOpenChange,\n onLogin,\n onForgotPassword,\n onRegister,\n isLoading = false,\n errorMessage,\n title = 'Đăng nhập',\n subtitle = 'Nhập thông tin để tiếp tục',\n}: LoginPageProps) => {\n const emailId = useId();\n const passwordId = useId();\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const [showPassword, setShowPassword] = useState(false);\n const [fieldErrors, setFieldErrors] = useState<{ email?: string; password?: string }>({});\n\n const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n const result = loginSchema.safeParse({ email, password });\n if (!result.success) {\n const errors = result.error.flatten().fieldErrors;\n setFieldErrors({ email: errors.email?.[0], password: errors.password?.[0] });\n return;\n }\n setFieldErrors({});\n await onLogin(email, password);\n };\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className=\"max-sm:data-[state=open]:slide-in-from-bottom max-sm:data-[state=open]:zoom-in-100 max-sm:data-[state=closed]:slide-out-to-bottom max-sm:data-[state=closed]:zoom-out-100 max-sm:top-auto max-sm:right-0 max-sm:bottom-0 max-sm:left-0 max-sm:max-w-full max-sm:translate-x-0 max-sm:translate-y-0 max-sm:rounded-b-none sm:max-w-sm\">\n <DialogHeader>\n <LunasLogo variant=\"horizontal\" size=\"sm\" className=\"mx-auto\" />\n <div className=\"flex flex-col gap-0.5\">\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{subtitle}</DialogDescription>\n </div>\n </DialogHeader>\n\n <form onSubmit={handleSubmit} noValidate className=\"flex flex-col gap-4\">\n {errorMessage && (\n <Alert variant=\"destructive\">\n <AlertDescription>{errorMessage}</AlertDescription>\n </Alert>\n )}\n\n <div className=\"flex flex-col gap-1.5\">\n <Label htmlFor={emailId}>Email</Label>\n <Input\n id={emailId}\n type=\"email\"\n autoComplete=\"email\"\n placeholder=\"you@example.com\"\n value={email}\n onChange={e => setEmail(e.target.value)}\n aria-invalid={!!fieldErrors.email}\n disabled={isLoading}\n />\n {fieldErrors.email && <p className=\"text-destructive text-xs\">{fieldErrors.email}</p>}\n </div>\n\n <div className=\"flex flex-col gap-1.5\">\n <div className=\"flex items-center justify-between\">\n <Label htmlFor={passwordId}>Mật khẩu</Label>\n {onForgotPassword && (\n <Button type=\"button\" variant=\"link\" size=\"sm\" className=\"h-auto p-0 text-xs\" onClick={onForgotPassword}>\n Quên mật khẩu?\n </Button>\n )}\n </div>\n <div className=\"relative\">\n <Input\n id={passwordId}\n type={showPassword ? 'text' : 'password'}\n autoComplete=\"current-password\"\n placeholder=\"••••••••\"\n value={password}\n onChange={e => setPassword(e.target.value)}\n aria-invalid={!!fieldErrors.password}\n disabled={isLoading}\n className=\"pr-10\"\n />\n <button\n type=\"button\"\n className=\"absolute inset-y-0 right-0 flex items-center px-3 text-muted-foreground hover:text-foreground\"\n onMouseDown={e => {\n e.preventDefault();\n setShowPassword(v => !v);\n }}\n aria-label={showPassword ? 'Ẩn mật khẩu' : 'Hiện mật khẩu'}\n >\n {showPassword ? <EyeOff size={16} /> : <Eye size={16} />}\n </button>\n </div>\n {fieldErrors.password && <p className=\"text-destructive text-xs\">{fieldErrors.password}</p>}\n </div>\n\n <Button type=\"submit\" isLoading={isLoading} className=\"w-full\">\n Đăng nhập\n </Button>\n <Button type=\"button\" variant=\"outline\" className=\"w-full\" disabled={isLoading} onClick={() => onOpenChange(false)}>\n Đóng hộp thoại\n </Button>\n </form>\n\n {onRegister && (\n <div className=\"flex justify-center gap-1 text-muted-foreground text-sm\">\n <span>Chưa có tài khoản?</span>\n <Button variant=\"link\" size=\"sm\" className=\"h-auto p-0\" onClick={onRegister}>\n Đăng ký\n </Button>\n </div>\n )}\n </DialogContent>\n </Dialog>\n );\n};\n"],"mappings":"8gBAmCA,MAAM,EAAc,EAAE,OAAO,CAC3B,MAAO,EAAE,OAAO,CAAC,CAAC,IAAI,EAAG,qBAAqB,CAAC,CAAC,MAAM,oBAAoB,EAC1E,SAAU,EAAE,OAAO,CAAC,CAAC,IAAI,EAAG,wBAAwB,CACtD,CAAC,EAoBY,GAAa,CACxB,OACA,eACA,UACA,mBACA,aACA,YAAY,GACZ,eACA,QAAQ,YACR,WAAW,gCACS,CACpB,IAAM,EAAU,EAAM,EAChB,EAAa,EAAM,EACnB,CAAC,EAAO,GAAY,EAAS,EAAE,EAC/B,CAAC,EAAU,GAAe,E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,GACT,CAAA,CAEZ"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Input as e}from"./ui/input.mjs";import{G as t}from"./tanstack-form-fkaBh9RO.mjs";import{Field as n,FieldContent as r,FieldContentMain as i,FieldDescription as a,FieldError as o,FieldGroup as s,FieldLabel as c,FieldNote as l,FieldSeparator as u,FieldTooltip as d}from"./field-V2DoD8qL.mjs";import{EyeIcon as f,EyeOffIcon as p}from"lucide-react";import{useCallback as m,useId as h,useState as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{useStore as y}from"@tanstack/react-form";const b=({label:b,description:x,placeholder:S,orientation:C=`responsive`,tooltip:w,helperText:T,showErrorMessage:E=!0})=>{let D=h(),{form:O,name:k,state:A,handleBlur:j,handleChange:M}=t(),N=y(O.store,({isSubmitting:e})=>e),[P,F]=g(!1),I=A.meta.isDirty&&A.meta.isTouched&&!A.meta.isValid,L=m(()=>F(e=>!e),[]),R=m(({target:{value:e}})=>{N||M(e||null)},[N,M]);return v(s,{className:`gap-y-4 px-4`,children:[v(n,{"data-invalid":I,orientation:C,children:[v(r,{children:[v(c,{htmlFor:D,children:[b,w&&_(d,{tooltip:w})]}),_(a,{children:x})]}),v(i,{children:[_(e,{id:D,name:k,type:P?`text`:`password`,placeholder:S,value:A.value??``,"aria-invalid":I,autoComplete:`new-password`,onBlur:j,onChange:R}),_(`button`,{className:`absolute inset-e-0 inset-y-0 flex size-9 items-center justify-center rounded-e-md text-muted outline-none transition-[color,box-shadow] focus:z-10 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,type:`button`,onClick:L,"aria-label":P?`Ẩn mật khẩu`:`Hiện mật khẩu`,"aria-pressed":P,"aria-controls":D,children:_(P?p:f,{size:16,"aria-hidden":`true`})}),_(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:E&&A.meta.isDirty&&_(o,{errors:A.meta.errors})}),_(l,{isShow:!!T,children:T})]})]}),_(u,{})]})};export{b as PasswordField};
|
|
2
|
-
//# sourceMappingURL=password-field-B2_kzss6.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("./ui/input.cjs"),t=require("./tanstack-form-C0ab8EEl.cjs"),n=require("./field-BSLi-P0Q.cjs");let r=require("lucide-react"),i=require("react"),a=require("react/jsx-runtime"),o=require("@tanstack/react-form");const s=({label:s,description:c,placeholder:l,orientation:u=`responsive`,tooltip:d,helperText:f,showErrorMessage:p=!0})=>{let m=(0,i.useId)(),{form:h,name:g,state:_,handleBlur:v,handleChange:y}=t.G(),b=(0,o.useStore)(h.store,({isSubmitting:e})=>e),[x,S]=(0,i.useState)(!1),C=_.meta.isDirty&&_.meta.isTouched&&!_.meta.isValid,w=(0,i.useCallback)(()=>S(e=>!e),[]),T=(0,i.useCallback)(({target:{value:e}})=>{b||y(e||null)},[b,y]);return(0,a.jsxs)(n.FieldGroup,{className:`gap-y-4 px-4`,children:[(0,a.jsxs)(n.Field,{"data-invalid":C,orientation:u,children:[(0,a.jsxs)(n.FieldContent,{children:[(0,a.jsxs)(n.FieldLabel,{htmlFor:m,children:[s,d&&(0,a.jsx)(n.FieldTooltip,{tooltip:d})]}),(0,a.jsx)(n.FieldDescription,{children:c})]}),(0,a.jsxs)(n.FieldContentMain,{children:[(0,a.jsx)(e.Input,{id:m,name:g,type:x?`text`:`password`,placeholder:l,value:_.value??``,"aria-invalid":C,autoComplete:`new-password`,onBlur:v,onChange:T}),(0,a.jsx)(`button`,{className:`absolute inset-e-0 inset-y-0 flex size-9 items-center justify-center rounded-e-md text-muted outline-none transition-[color,box-shadow] focus:z-10 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,type:`button`,onClick:w,"aria-label":x?`Ẩn mật khẩu`:`Hiện mật khẩu`,"aria-pressed":x,"aria-controls":m,children:x?(0,a.jsx)(r.EyeOffIcon,{size:16,"aria-hidden":`true`}):(0,a.jsx)(r.EyeIcon,{size:16,"aria-hidden":`true`})}),(0,a.jsx)(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:p&&_.meta.isDirty&&(0,a.jsx)(n.FieldError,{errors:_.meta.errors})}),(0,a.jsx)(n.FieldNote,{isShow:!!f,children:f})]})]}),(0,a.jsx)(n.FieldSeparator,{})]})};exports.PasswordField=s;
|
|
2
|
-
//# sourceMappingURL=password-field-BHRhVyZ0.cjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./close-DYJZ8fkh.mjs";import{K as t}from"./tanstack-form-fkaBh9RO.mjs";import{n,t as r}from"./submit-button-CGBaPzE9.mjs";import{cn as i}from"@customafk/react-toolkit/utils";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{Dialog as s}from"radix-ui";const c=({title:c,open:l,contentClassName:u,onOpenChange:d,children:f})=>{let p=t();return a(s.Root,{"data-slot":`dialog`,open:l,onOpenChange:d,children:o(s.Portal,{"data-slot":`dialog-portal`,children:[a(s.Overlay,{"data-slot":`dialog-overlay`,className:i(`fixed inset-0 z-40 bg-black/40 backdrop-blur-sm`,`data-[state=open]:animate-in data-[state=open]:fade-in`,`data-[state=closed]:animate-out data-[state=closed]:fade-out`)}),a(s.Content,{"data-slot":`dialog-content`,className:i(`fixed top-4 right-4 z-50 h-[calc(100dvh-2rem)] min-w-sm max-w-xl rounded-md bg-background shadow-lg ring-1 ring-border`,`duration-300`,`data-[state=open]:animate-in data-[state=open]:slide-in-from-right data-[state=open]:fade-in`,`data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right data-[state=closed]:fade-out`),children:o(`section`,{className:`relative flex size-full flex-col`,children:[a(`header`,{className:`flex h-14 shrink-0 items-center border-b border-border px-5`,children:a(`h2`,{className:`font-semibold text-base tracking-tight text-text-positive`,children:c})}),a(`div`,{className:i(`flex flex-1 flex-col overflow-y-auto py-4`,u),children:f}),o(`div`,{className:`flex shrink-0 flex-col gap-2 border-t border-border px-4 py-3`,children:[a(p.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:t})=>a(r,{isSubmitting:e,disabled:t,className:`w-full`,onClick:()=>p.handleSubmit()})}),a(p.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:e})=>a(n,{disabled:e,className:`w-full`,onClick:()=>{p.reset(),d?.(!1)}})})]}),a(s.Close,{asChild:!0,children:a(e,{className:`absolute top-2.5 right-3`})})]})})]})})};export{c as TanStackPopoverForm};
|
|
2
|
-
//# sourceMappingURL=popover-form-CeRVpy1B.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("./close-BYHgEZvZ.cjs"),t=require("./tanstack-form-C0ab8EEl.cjs"),n=require("./submit-button-CvINfld5.cjs");let r=require("@customafk/react-toolkit/utils"),i=require("react/jsx-runtime"),a=require("radix-ui");const o=({title:o,open:s,contentClassName:c,onOpenChange:l,children:u})=>{let d=t.K();return(0,i.jsx)(a.Dialog.Root,{"data-slot":`dialog`,open:s,onOpenChange:l,children:(0,i.jsxs)(a.Dialog.Portal,{"data-slot":`dialog-portal`,children:[(0,i.jsx)(a.Dialog.Overlay,{"data-slot":`dialog-overlay`,className:(0,r.cn)(`fixed inset-0 z-40 bg-black/40 backdrop-blur-sm`,`data-[state=open]:animate-in data-[state=open]:fade-in`,`data-[state=closed]:animate-out data-[state=closed]:fade-out`)}),(0,i.jsx)(a.Dialog.Content,{"data-slot":`dialog-content`,className:(0,r.cn)(`fixed top-4 right-4 z-50 h-[calc(100dvh-2rem)] min-w-sm max-w-xl rounded-md bg-background shadow-lg ring-1 ring-border`,`duration-300`,`data-[state=open]:animate-in data-[state=open]:slide-in-from-right data-[state=open]:fade-in`,`data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right data-[state=closed]:fade-out`),children:(0,i.jsxs)(`section`,{className:`relative flex size-full flex-col`,children:[(0,i.jsx)(`header`,{className:`flex h-14 shrink-0 items-center border-b border-border px-5`,children:(0,i.jsx)(`h2`,{className:`font-semibold text-base tracking-tight text-text-positive`,children:o})}),(0,i.jsx)(`div`,{className:(0,r.cn)(`flex flex-1 flex-col overflow-y-auto py-4`,c),children:u}),(0,i.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 border-t border-border px-4 py-3`,children:[(0,i.jsx)(d.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:t})=>(0,i.jsx)(n.t,{isSubmitting:e,disabled:t,className:`w-full`,onClick:()=>d.handleSubmit()})}),(0,i.jsx)(d.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:e})=>(0,i.jsx)(n.n,{disabled:e,className:`w-full`,onClick:()=>{d.reset(),l?.(!1)}})})]}),(0,i.jsx)(a.Dialog.Close,{asChild:!0,children:(0,i.jsx)(e.t,{className:`absolute top-2.5 right-3`})})]})})]})})};exports.TanStackPopoverForm=o;
|
|
2
|
-
//# sourceMappingURL=popover-form-Ch_iMMSm.cjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("./tanstack-form-C0ab8EEl.cjs"),t=require("./ui/radio-group.cjs"),n=require("./field-BSLi-P0Q.cjs");let r=require("@customafk/react-toolkit/utils"),i=require("react/jsx-runtime"),a=require("@tanstack/react-form");const o=({label:o,description:s,orientation:c,options:l,tooltip:u,helperText:d})=>{let f=e.G(),p=(0,a.useStore)(f.form.store,({isSubmitting:e})=>e);return(0,i.jsxs)(n.FieldGroup,{className:`px-4`,children:[(0,i.jsxs)(n.Field,{orientation:c,className:`flex-col gap-2`,children:[(0,i.jsxs)(n.FieldContent,{children:[(0,i.jsxs)(n.FieldLabel,{children:[o,u&&(0,i.jsx)(n.FieldTooltip,{tooltip:u})]}),(0,i.jsx)(n.FieldDescription,{children:s}),(0,i.jsx)(n.FieldNote,{isShow:!!d,children:d})]}),(0,i.jsx)(n.FieldContentMain,{children:(0,i.jsx)(t.RadioGroup,{value:f.state.value??``,className:`w-full`,onValueChange:f.handleChange,children:l.map(e=>(0,i.jsx)(n.FieldLabel,{className:(0,r.cn)(`h-fit`,f.state.value===e.value&&`border-primary-weak! bg-primary-bg-subtle`,p&&`pointer-events-none bg-muted-muted opacity-60`,f.state.value===e.value&&p&&`border-border-strong!`),children:(0,i.jsxs)(n.Field,{orientation:`horizontal`,className:`items-start gap-3 rounded p-2!`,children:[(0,i.jsx)(t.RadioGroupItem,{value:e.value,className:`mt-0.5 shrink-0`}),(0,i.jsxs)(n.FieldContent,{className:`gap-0.5!`,children:[(0,i.jsx)(n.FieldTitle,{children:e.label}),(0,i.jsx)(n.FieldDescription,{className:`text-xs`,children:e.description})]})]})},e.value))})})]}),(0,i.jsx)(n.FieldSeparator,{})]})};exports.RadioGroupField=o;
|
|
2
|
-
//# sourceMappingURL=radio-group-field-BFhBfzoT.cjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{G as e}from"./tanstack-form-fkaBh9RO.mjs";import{RadioGroup as t,RadioGroupItem as n}from"./ui/radio-group.mjs";import{Field as r,FieldContent as i,FieldContentMain as a,FieldDescription as o,FieldGroup as s,FieldLabel as c,FieldNote as l,FieldSeparator as u,FieldTitle as d,FieldTooltip as f}from"./field-V2DoD8qL.mjs";import{cn as p}from"@customafk/react-toolkit/utils";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{useStore as g}from"@tanstack/react-form";const _=({label:_,description:v,orientation:y,options:b,tooltip:x,helperText:S})=>{let C=e(),w=g(C.form.store,({isSubmitting:e})=>e);return h(s,{className:`px-4`,children:[h(r,{orientation:y,className:`flex-col gap-2`,children:[h(i,{children:[h(c,{children:[_,x&&m(f,{tooltip:x})]}),m(o,{children:v}),m(l,{isShow:!!S,children:S})]}),m(a,{children:m(t,{value:C.state.value??``,className:`w-full`,onValueChange:C.handleChange,children:b.map(e=>m(c,{className:p(`h-fit`,C.state.value===e.value&&`border-primary-weak! bg-primary-bg-subtle`,w&&`pointer-events-none bg-muted-muted opacity-60`,C.state.value===e.value&&w&&`border-border-strong!`),children:h(r,{orientation:`horizontal`,className:`items-start gap-3 rounded p-2!`,children:[m(n,{value:e.value,className:`mt-0.5 shrink-0`}),h(i,{className:`gap-0.5!`,children:[m(d,{children:e.label}),m(o,{className:`text-xs`,children:e.description})]})]})},e.value))})})]}),m(u,{})]})};export{_ as RadioGroupField};
|
|
2
|
-
//# sourceMappingURL=radio-group-field-Iwo2Q2Ig.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("./ui/dialog.cjs"),t=require("./tanstack-form-C0ab8EEl.cjs"),n=require("./ui/select.cjs"),r=require("./field-BSLi-P0Q.cjs");let i=require("lucide-react"),a=require("react"),o=require("@customafk/react-toolkit/utils"),s=require("react/jsx-runtime"),c=require("radix-ui"),l=require("@tanstack/react-form"),u=require("@customafk/react-toolkit/hooks/useMobile");const d=(0,a.memo)(({label:d,description:f,placeholder:p,orientation:m=`responsive`,tooltip:h,options:g,helperText:_,clearable:v=!1,required:y=!1,disabled:b=!1,showErrorMessage:x=!0})=>{let S=(0,a.useId)(),C=t.G(),w=(0,u.useIsMobile)(),[T,E]=(0,a.useState)(!1),D=(0,l.useStore)(C.form.store,({isSubmitting:e})=>e),O=b||D,k=C.state.meta.isDirty||C.state.meta.isTouched,A=k&&!C.state.meta.isValid,j=y&&C.state.value===null,M=v&&!!C.state.value&&!O,N=g.find(e=>e.value===C.state.value)?.label,P=()=>{C.handleChange(null),C.handleBlur()};return(0,s.jsxs)(r.FieldGroup,{className:`gap-y-4 px-4`,children:[(0,s.jsxs)(r.Field,{orientation:m,"data-invalid":A,children:[(0,s.jsxs)(r.FieldContent,{children:[(0,s.jsxs)(r.FieldLabel,{htmlFor:C.name,"aria-required":j,children:[d,h&&(0,s.jsx)(r.FieldTooltip,{tooltip:h})]}),(0,s.jsx)(r.FieldDescription,{children:f})]}),(0,s.jsxs)(r.FieldContentMain,{className:`flex flex-col`,children:[w?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(`button`,{id:C.name,type:`button`,disabled:O,"aria-invalid":A?`true`:void 0,"aria-describedby":S,onBlur:C.handleBlur,onClick:()=>E(!0),className:(0,o.cn)(`flex w-full items-center justify-between`,`outline-1 outline-border -outline-offset-1`,`gap-2 rounded bg-transparent px-3 py-2`,`shadow-input transition-all cursor-pointer whitespace-nowrap text-sm`,`focus-visible:outline-primary-strong focus-visible:ring-4 focus-visible:ring-primary-weak`,`disabled:cursor-not-allowed disabled:opacity-50`,A&&`outline-danger bg-danger-bg-subtle ring-danger-weak`,!C.state.value&&`text-text-positive-muted`),children:[(0,s.jsx)(`span`,{className:`line-clamp-1`,children:N??p}),(0,s.jsx)(i.ChevronDownIcon,{size:16,className:`shrink-0 opacity-50`})]}),(0,s.jsx)(e.Dialog,{open:T,onOpenChange:e=>{E(e),e||C.handleBlur()},children:(0,s.jsxs)(e.DialogPortal,{children:[(0,s.jsx)(e.DialogOverlay,{}),(0,s.jsxs)(c.Dialog.Content,{onOpenAutoFocus:e=>e.preventDefault(),className:(0,o.cn)(`fixed inset-x-0 bottom-0 z-50`,`flex flex-col bg-background rounded-t-2xl outline-none`,`max-h-[80dvh] shadow-[0_-4px_24px_rgba(0,0,0,0.08)]`,`data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom data-[state=open]:fade-in-0`,`data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=closed]:fade-out-0`,`duration-300`),children:[(0,s.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-border shrink-0`,children:[(0,s.jsx)(`span`,{className:`font-semibold text-sm text-text-positive`,children:d??p??`Chọn một tùy chọn`}),(0,s.jsx)(e.DialogClose,{asChild:!0,children:(0,s.jsx)(`button`,{type:`button`,"aria-label":`Đóng`,className:`flex size-7 items-center justify-center rounded-md text-text-positive-weak transition-colors hover:bg-muted-muted hover:text-text-positive`,children:(0,s.jsx)(i.XIcon,{size:16})})})]}),(0,s.jsxs)(`div`,{className:`flex flex-col overflow-y-auto`,children:[M&&(0,s.jsx)(e.DialogClose,{asChild:!0,children:(0,s.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-x-2 px-4 py-3 text-left text-sm text-danger-strong transition-colors hover:bg-danger-bg-subtle`,onClick:P,children:[(0,s.jsx)(i.XIcon,{size:14}),`Xóa lựa chọn`]})}),g.length>0?g.map(t=>(0,s.jsx)(e.DialogClose,{asChild:!0,children:(0,s.jsx)(`button`,{type:`button`,className:(0,o.cn)(`flex w-full items-center px-4 py-3 text-left text-sm transition-colors`,`hover:bg-muted-muted active:bg-muted-muted`,C.state.value===t.value&&`bg-primary-bg-subtle font-medium text-primary`),onClick:()=>{C.handleChange(t.value),C.handleBlur()},children:t.label})},t.value)):(0,s.jsxs)(`div`,{className:`flex items-center justify-center gap-x-2 px-4 py-8 text-center text-sm text-text-positive-weak`,children:[(0,s.jsx)(i.PackagePlusIcon,{strokeWidth:1}),`Không có tùy chọn`]})]}),(0,s.jsx)(`div`,{className:`shrink-0 h-safe-bottom`})]})]})})]}):(0,s.jsxs)(`div`,{className:`relative`,children:[(0,s.jsxs)(n.Select,{value:C.state.value??``,disabled:O,onValueChange:C.handleChange,children:[(0,s.jsx)(n.SelectTrigger,{"aria-invalid":A?`true`:void 0,"aria-describedby":S,onBlur:C.handleBlur,children:(0,s.jsx)(n.SelectValue,{placeholder:p})}),(0,s.jsx)(n.SelectContent,{children:g.length>0?g.map(e=>(0,s.jsx)(n.SelectItem,{value:e.value,children:e.label},e.value)):(0,s.jsxs)(`div`,{className:`flex items-center justify-center gap-x-2 rounded border border-border bg-muted-muted px-4 py-6.5 text-center text-sm text-text-positive-weak`,children:[(0,s.jsx)(i.PackagePlusIcon,{strokeWidth:1}),`No options available`]})})]}),M&&(0,s.jsx)(`button`,{type:`button`,"aria-label":`Xóa lựa chọn`,className:`absolute right-7 top-1/2 -translate-y-1/2 flex size-4 cursor-pointer items-center justify-center rounded-md text-text-positive-weak outline-none transition-[color,transform] hover:text-text-positive focus-visible:text-primary-strong focus-visible:[&>svg]:scale-125 [&>svg]:size-3.5 [&>svg]:transition-transform`,onClick:P,children:(0,s.jsx)(i.XIcon,{"aria-hidden":`true`})})]}),k&&x&&(0,s.jsx)(r.FieldError,{id:S,className:`mt-1`,errors:C.state.meta.errors}),(0,s.jsx)(r.FieldNote,{isShow:!!_,children:_})]})]}),(0,s.jsx)(r.FieldSeparator,{})]})});d.displayName=`SelectField`,exports.SelectField=d;
|
|
2
|
-
//# sourceMappingURL=select-field-CvDBZQTl.cjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Dialog as e,DialogClose as t,DialogOverlay as n,DialogPortal as r}from"./ui/dialog.mjs";import{G as i}from"./tanstack-form-fkaBh9RO.mjs";import{Select as a,SelectContent as o,SelectItem as ee,SelectTrigger as s,SelectValue as c}from"./ui/select.mjs";import{Field as l,FieldContent as u,FieldContentMain as d,FieldDescription as f,FieldError as te,FieldGroup as p,FieldLabel as m,FieldNote as h,FieldSeparator as g,FieldTooltip as _}from"./field-V2DoD8qL.mjs";import{ChevronDownIcon as v,PackagePlusIcon as y,XIcon as b}from"lucide-react";import{memo as x,useId as S,useState as C}from"react";import{cn as w}from"@customafk/react-toolkit/utils";import{Fragment as T,jsx as E,jsxs as D}from"react/jsx-runtime";import{Dialog as O}from"radix-ui";import{useStore as k}from"@tanstack/react-form";import{useIsMobile as A}from"@customafk/react-toolkit/hooks/useMobile";const j=x(({label:x,description:j,placeholder:M,orientation:N=`responsive`,tooltip:P,options:F,helperText:I,clearable:L=!1,required:R=!1,disabled:z=!1,showErrorMessage:B=!0})=>{let V=S(),H=i(),U=A(),[W,G]=C(!1),K=k(H.form.store,({isSubmitting:e})=>e),q=z||K,J=H.state.meta.isDirty||H.state.meta.isTouched,Y=J&&!H.state.meta.isValid,X=R&&H.state.value===null,Z=L&&!!H.state.value&&!q,Q=F.find(e=>e.value===H.state.value)?.label,$=()=>{H.handleChange(null),H.handleBlur()};return D(p,{className:`gap-y-4 px-4`,children:[D(l,{orientation:N,"data-invalid":Y,children:[D(u,{children:[D(m,{htmlFor:H.name,"aria-required":X,children:[x,P&&E(_,{tooltip:P})]}),E(f,{children:j})]}),D(d,{className:`flex flex-col`,children:[U?D(T,{children:[D(`button`,{id:H.name,type:`button`,disabled:q,"aria-invalid":Y?`true`:void 0,"aria-describedby":V,onBlur:H.handleBlur,onClick:()=>G(!0),className:w(`flex w-full items-center justify-between`,`outline-1 outline-border -outline-offset-1`,`gap-2 rounded bg-transparent px-3 py-2`,`shadow-input transition-all cursor-pointer whitespace-nowrap text-sm`,`focus-visible:outline-primary-strong focus-visible:ring-4 focus-visible:ring-primary-weak`,`disabled:cursor-not-allowed disabled:opacity-50`,Y&&`outline-danger bg-danger-bg-subtle ring-danger-weak`,!H.state.value&&`text-text-positive-muted`),children:[E(`span`,{className:`line-clamp-1`,children:Q??M}),E(v,{size:16,className:`shrink-0 opacity-50`})]}),E(e,{open:W,onOpenChange:e=>{G(e),e||H.handleBlur()},children:D(r,{children:[E(n,{}),D(O.Content,{onOpenAutoFocus:e=>e.preventDefault(),className:w(`fixed inset-x-0 bottom-0 z-50`,`flex flex-col bg-background rounded-t-2xl outline-none`,`max-h-[80dvh] shadow-[0_-4px_24px_rgba(0,0,0,0.08)]`,`data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom data-[state=open]:fade-in-0`,`data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=closed]:fade-out-0`,`duration-300`),children:[D(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-border shrink-0`,children:[E(`span`,{className:`font-semibold text-sm text-text-positive`,children:x??M??`Chọn một tùy chọn`}),E(t,{asChild:!0,children:E(`button`,{type:`button`,"aria-label":`Đóng`,className:`flex size-7 items-center justify-center rounded-md text-text-positive-weak transition-colors hover:bg-muted-muted hover:text-text-positive`,children:E(b,{size:16})})})]}),D(`div`,{className:`flex flex-col overflow-y-auto`,children:[Z&&E(t,{asChild:!0,children:D(`button`,{type:`button`,className:`flex w-full items-center gap-x-2 px-4 py-3 text-left text-sm text-danger-strong transition-colors hover:bg-danger-bg-subtle`,onClick:$,children:[E(b,{size:14}),`Xóa lựa chọn`]})}),F.length>0?F.map(e=>E(t,{asChild:!0,children:E(`button`,{type:`button`,className:w(`flex w-full items-center px-4 py-3 text-left text-sm transition-colors`,`hover:bg-muted-muted active:bg-muted-muted`,H.state.value===e.value&&`bg-primary-bg-subtle font-medium text-primary`),onClick:()=>{H.handleChange(e.value),H.handleBlur()},children:e.label})},e.value)):D(`div`,{className:`flex items-center justify-center gap-x-2 px-4 py-8 text-center text-sm text-text-positive-weak`,children:[E(y,{strokeWidth:1}),`Không có tùy chọn`]})]}),E(`div`,{className:`shrink-0 h-safe-bottom`})]})]})})]}):D(`div`,{className:`relative`,children:[D(a,{value:H.state.value??``,disabled:q,onValueChange:H.handleChange,children:[E(s,{"aria-invalid":Y?`true`:void 0,"aria-describedby":V,onBlur:H.handleBlur,children:E(c,{placeholder:M})}),E(o,{children:F.length>0?F.map(e=>E(ee,{value:e.value,children:e.label},e.value)):D(`div`,{className:`flex items-center justify-center gap-x-2 rounded border border-border bg-muted-muted px-4 py-6.5 text-center text-sm text-text-positive-weak`,children:[E(y,{strokeWidth:1}),`No options available`]})})]}),Z&&E(`button`,{type:`button`,"aria-label":`Xóa lựa chọn`,className:`absolute right-7 top-1/2 -translate-y-1/2 flex size-4 cursor-pointer items-center justify-center rounded-md text-text-positive-weak outline-none transition-[color,transform] hover:text-text-positive focus-visible:text-primary-strong focus-visible:[&>svg]:scale-125 [&>svg]:size-3.5 [&>svg]:transition-transform`,onClick:$,children:E(b,{"aria-hidden":`true`})})]}),J&&B&&E(te,{id:V,className:`mt-1`,errors:H.state.meta.errors}),E(h,{isShow:!!I,children:I})]})]}),E(g,{})]})});j.displayName=`SelectField`;export{j as SelectField};
|
|
2
|
-
//# sourceMappingURL=select-field-NJgDDCO2.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Button as e}from"./ui/button.mjs";import{G as t}from"./tanstack-form-fkaBh9RO.mjs";import{PlusIcon as n,Trash2Icon as r}from"lucide-react";import{useCallback as i}from"react";import{cn as a}from"@customafk/react-toolkit/utils";import{jsx as o,jsxs as s}from"react/jsx-runtime";function c({width:e,className:t,children:n}){return o(`div`,{"data-slot":`array-col`,style:e?{width:typeof e==`number`?`${e}px`:e,flexShrink:0}:{flex:1,minWidth:0},className:t,children:n})}function l({className:e,children:t}){return s(`div`,{"data-slot":`array-header-row`,className:a(`mb-1 flex items-center gap-2 px-1 text-xs font-medium text-text-positive-weak`,e),children:[t,o(`div`,{className:`min-w-8 w-8 shrink-0`})]})}function u({defaultRow:c,children:l,addLabel:u=`Thêm hàng`,className:d}){let f=t(),p=f.state.value??[],m=i(()=>{f.pushValue({...c})},[f,c]),h=i(e=>{f.removeValue(e)},[f]);return s(`div`,{"data-slot":`simple-array-field`,className:a(`flex flex-col gap-2`,d),children:[p.map((t,n)=>s(`div`,{className:`flex items-start gap-2`,children:[l(n),o(e,{type:`button`,size:`icon`,variant:`ghost`,color:`danger`,className:`min-w-8`,onClick:()=>h(n),children:o(r,{size:14})})]},n)),o(`div`,{children:s(e,{type:`button`,variant:`outline`,color:`muted`,size:`xs`,onClick:m,children:[o(n,{size:13}),u]})})]})}export{c as ArrayCol,l as ArrayHeaderRow,u as SimpleArrayField};
|
|
2
|
-
//# sourceMappingURL=simple-array-field-BwNCeUnn.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("./ui/button.cjs"),t=require("./tanstack-form-C0ab8EEl.cjs");let n=require("lucide-react"),r=require("react"),i=require("@customafk/react-toolkit/utils"),a=require("react/jsx-runtime");function o({width:e,className:t,children:n}){return(0,a.jsx)(`div`,{"data-slot":`array-col`,style:e?{width:typeof e==`number`?`${e}px`:e,flexShrink:0}:{flex:1,minWidth:0},className:t,children:n})}function s({className:e,children:t}){return(0,a.jsxs)(`div`,{"data-slot":`array-header-row`,className:(0,i.cn)(`mb-1 flex items-center gap-2 px-1 text-xs font-medium text-text-positive-weak`,e),children:[t,(0,a.jsx)(`div`,{className:`min-w-8 w-8 shrink-0`})]})}function c({defaultRow:o,children:s,addLabel:c=`Thêm hàng`,className:l}){let u=t.G(),d=u.state.value??[],f=(0,r.useCallback)(()=>{u.pushValue({...o})},[u,o]),p=(0,r.useCallback)(e=>{u.removeValue(e)},[u]);return(0,a.jsxs)(`div`,{"data-slot":`simple-array-field`,className:(0,i.cn)(`flex flex-col gap-2`,l),children:[d.map((t,r)=>(0,a.jsxs)(`div`,{className:`flex items-start gap-2`,children:[s(r),(0,a.jsx)(e.Button,{type:`button`,size:`icon`,variant:`ghost`,color:`danger`,className:`min-w-8`,onClick:()=>p(r),children:(0,a.jsx)(n.Trash2Icon,{size:14})})]},r)),(0,a.jsx)(`div`,{children:(0,a.jsxs)(e.Button,{type:`button`,variant:`outline`,color:`muted`,size:`xs`,onClick:f,children:[(0,a.jsx)(n.PlusIcon,{size:13}),c]})})]})}exports.ArrayCol=o,exports.ArrayHeaderRow=s,exports.SimpleArrayField=c;
|
|
2
|
-
//# sourceMappingURL=simple-array-field-aGXkDZXD.cjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("./ui/checkbox.cjs"),t=require("./tanstack-form-C0ab8EEl.cjs"),n=require("./ui/label.cjs"),r=require("./ui/switch.cjs"),i=require("./field-BSLi-P0Q.cjs");let a=require("react"),o=require("react/jsx-runtime"),s=require("@tanstack/react-form");const c=({label:c,required:l,disabled:u,variant:d=`checkbox`})=>{let f=(0,a.useId)(),{form:p,name:m,state:h,handleBlur:g,handleChange:_}=t.G(),v=(0,s.useStore)(p.store,({isSubmitting:e})=>e),y=h.meta.isTouched&&!h.meta.isValid,b=h.value??!1,x=u||v,S=(0,a.useCallback)(e=>{v||_(e)},[v,_]);return(0,o.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,o.jsxs)(`div`,{className:`flex items-center gap-2 h-9`,children:[d===`switch`?(0,o.jsx)(r.Switch,{id:f,name:m,checked:b,disabled:x,"aria-invalid":y,onBlur:g,onCheckedChange:S}):(0,o.jsx)(e.Checkbox,{id:f,name:m,checked:b,disabled:x,"aria-invalid":y,onBlur:g,onCheckedChange:S}),c&&(0,o.jsxs)(n.Label,{htmlFor:f,className:`cursor-pointer`,children:[c,l&&(0,o.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]})]}),y&&(0,o.jsx)(i.FieldError,{errors:h.meta.errors})]})};exports.SimpleBooleanField=c;
|
|
2
|
-
//# sourceMappingURL=simple-boolean-field-BeVkn3c4.cjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Checkbox as e}from"./ui/checkbox.mjs";import{G as t}from"./tanstack-form-fkaBh9RO.mjs";import{Label as n}from"./ui/label.mjs";import{Switch as r}from"./ui/switch.mjs";import{FieldError as i}from"./field-V2DoD8qL.mjs";import{useCallback as a,useId as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{useStore as l}from"@tanstack/react-form";const u=({label:u,required:d,disabled:f,variant:p=`checkbox`})=>{let m=o(),{form:h,name:g,state:_,handleBlur:v,handleChange:y}=t(),b=l(h.store,({isSubmitting:e})=>e),x=_.meta.isTouched&&!_.meta.isValid,S=_.value??!1,C=f||b,w=a(e=>{b||y(e)},[b,y]);return c(`div`,{className:`flex flex-col gap-1.5`,children:[c(`div`,{className:`flex items-center gap-2 h-9`,children:[s(p===`switch`?r:e,{id:m,name:g,checked:S,disabled:C,"aria-invalid":x,onBlur:v,onCheckedChange:w}),u&&c(n,{htmlFor:m,className:`cursor-pointer`,children:[u,d&&s(`span`,{className:`text-danger-strong`,children:`*`})]})]}),x&&s(i,{errors:_.meta.errors})]})};export{u as SimpleBooleanField};
|
|
2
|
-
//# sourceMappingURL=simple-boolean-field-t_XDXqYs.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Button as e}from"./ui/button.mjs";import{Command as t,CommandEmpty as n,CommandGroup as r,CommandInput as i,CommandItem as a,CommandList as o}from"./ui/command.mjs";import{G as s}from"./tanstack-form-fkaBh9RO.mjs";import{Popover as c,PopoverContent as l,PopoverTrigger as u}from"./ui/popover.mjs";import{Label as d}from"./ui/label.mjs";import{Drawer as f,DrawerContent as p,DrawerHeader as m,DrawerTitle as h}from"./ui/drawer.mjs";import{FieldError as g}from"./field-V2DoD8qL.mjs";import{useId as _,useState as v}from"react";import{cn as y}from"@customafk/react-toolkit/utils";import{jsx as b,jsxs as x}from"react/jsx-runtime";import{useStore as S}from"@tanstack/react-form";import{useIsMobile as C}from"@customafk/react-toolkit/hooks/useMobile";const w=({label:w,placeholder:T,required:E,disabled:D,options:O})=>{let k=_(),{form:A,state:j,handleBlur:M,handleChange:N}=s(),P=S(A.store,({isSubmitting:e})=>e),F=C(),[I,L]=v(!1),R=j.meta.isTouched&&!j.meta.isValid,z=D||P,B=O.find(({value:e})=>e===j.value)?.label,V=x(t,{children:[b(i,{placeholder:T??`Tìm kiếm…`}),x(o,{children:[b(n,{children:`Không tìm thấy kết quả.`}),b(r,{children:O.map(e=>b(a,{value:e.label,onSelect:()=>{N(e.value===j.value?null:e.value),L(!1)},children:e.label},e.value))})]})]});return F?x(`div`,{className:`flex flex-col gap-1.5`,children:[w&&x(d,{htmlFor:k,children:[w,E&&b(`span`,{className:`text-danger-strong`,children:`*`})]}),b(e,{id:k,type:`button`,variant:`outline`,color:`muted`,disabled:z,"aria-invalid":R,className:y(`w-full justify-start font-normal outline-1 outline-border -outline-offset-1`,!j.value&&`text-text-positive-muted`,R&&`outline-danger bg-danger-bg-subtle`),onBlur:M,onClick:()=>L(!0),children:B??b(`span`,{className:`text-text-positive-muted`,children:T})}),b(f,{open:I,onOpenChange:L,direction:`bottom`,children:x(p,{children:[b(m,{children:b(h,{children:w??T??`Tìm kiếm…`})}),b(`div`,{className:`overflow-y-auto pb-safe-bottom`,children:V})]})}),R&&b(g,{errors:j.meta.errors})]}):x(`div`,{className:`flex flex-col gap-1.5`,children:[w&&x(d,{htmlFor:k,children:[w,E&&b(`span`,{className:`text-danger-strong`,children:`*`})]}),x(c,{children:[b(u,{asChild:!0,children:b(e,{id:k,variant:`outline`,color:`muted`,size:`lg`,disabled:z,"aria-invalid":R,className:y(`flex w-full items-center justify-start rounded outline-border font-normal`,`hover:bg-transparent`,`focus:outline-1 focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`data-[state=open]:outline-1 data-[state=open]:outline-primary-strong data-[state=open]:ring-4 data-[state=open]:ring-primary-weak`,!j.value&&`text-text-positive-muted`),children:B??b(`span`,{className:`text-text-positive-muted`,children:T})})}),b(l,{align:`start`,side:`bottom`,className:`w-[--radix-popover-trigger-width] p-0 rounded`,onBlur:M,children:V})]}),R&&b(g,{errors:j.meta.errors})]})};export{w as SimpleComboboxField};
|
|
2
|
-
//# sourceMappingURL=simple-combobox-field-HCB4A33-.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("./ui/button.cjs"),t=require("./ui/command.cjs"),n=require("./tanstack-form-C0ab8EEl.cjs"),r=require("./ui/popover.cjs"),i=require("./ui/label.cjs"),a=require("./ui/drawer.cjs"),o=require("./field-BSLi-P0Q.cjs");let s=require("react"),c=require("@customafk/react-toolkit/utils"),l=require("react/jsx-runtime"),u=require("@tanstack/react-form"),d=require("@customafk/react-toolkit/hooks/useMobile");const f=({label:f,placeholder:p,required:m,disabled:h,options:g})=>{let _=(0,s.useId)(),{form:v,state:y,handleBlur:b,handleChange:x}=n.G(),S=(0,u.useStore)(v.store,({isSubmitting:e})=>e),C=(0,d.useIsMobile)(),[w,T]=(0,s.useState)(!1),E=y.meta.isTouched&&!y.meta.isValid,D=h||S,O=g.find(({value:e})=>e===y.value)?.label,k=(0,l.jsxs)(t.Command,{children:[(0,l.jsx)(t.CommandInput,{placeholder:p??`Tìm kiếm…`}),(0,l.jsxs)(t.CommandList,{children:[(0,l.jsx)(t.CommandEmpty,{children:`Không tìm thấy kết quả.`}),(0,l.jsx)(t.CommandGroup,{children:g.map(e=>(0,l.jsx)(t.CommandItem,{value:e.label,onSelect:()=>{x(e.value===y.value?null:e.value),T(!1)},children:e.label},e.value))})]})]});return C?(0,l.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[f&&(0,l.jsxs)(i.Label,{htmlFor:_,children:[f,m&&(0,l.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,l.jsx)(e.Button,{id:_,type:`button`,variant:`outline`,color:`muted`,disabled:D,"aria-invalid":E,className:(0,c.cn)(`w-full justify-start font-normal outline-1 outline-border -outline-offset-1`,!y.value&&`text-text-positive-muted`,E&&`outline-danger bg-danger-bg-subtle`),onBlur:b,onClick:()=>T(!0),children:O??(0,l.jsx)(`span`,{className:`text-text-positive-muted`,children:p})}),(0,l.jsx)(a.Drawer,{open:w,onOpenChange:T,direction:`bottom`,children:(0,l.jsxs)(a.DrawerContent,{children:[(0,l.jsx)(a.DrawerHeader,{children:(0,l.jsx)(a.DrawerTitle,{children:f??p??`Tìm kiếm…`})}),(0,l.jsx)(`div`,{className:`overflow-y-auto pb-safe-bottom`,children:k})]})}),E&&(0,l.jsx)(o.FieldError,{errors:y.meta.errors})]}):(0,l.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[f&&(0,l.jsxs)(i.Label,{htmlFor:_,children:[f,m&&(0,l.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,l.jsxs)(r.Popover,{children:[(0,l.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,l.jsx)(e.Button,{id:_,variant:`outline`,color:`muted`,size:`lg`,disabled:D,"aria-invalid":E,className:(0,c.cn)(`flex w-full items-center justify-start rounded outline-border font-normal`,`hover:bg-transparent`,`focus:outline-1 focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`data-[state=open]:outline-1 data-[state=open]:outline-primary-strong data-[state=open]:ring-4 data-[state=open]:ring-primary-weak`,!y.value&&`text-text-positive-muted`),children:O??(0,l.jsx)(`span`,{className:`text-text-positive-muted`,children:p})})}),(0,l.jsx)(r.PopoverContent,{align:`start`,side:`bottom`,className:`w-[--radix-popover-trigger-width] p-0 rounded`,onBlur:b,children:k})]}),E&&(0,l.jsx)(o.FieldError,{errors:y.meta.errors})]})};exports.SimpleComboboxField=f;
|
|
2
|
-
//# sourceMappingURL=simple-combobox-field-U0ZAl7VQ.cjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Button as e}from"./ui/button.mjs";import{G as t}from"./tanstack-form-fkaBh9RO.mjs";import{Popover as n,PopoverContent as r,PopoverTrigger as i}from"./ui/popover.mjs";import{Label as a}from"./ui/label.mjs";import{Calendar as o}from"./ui/calendar.mjs";import{FieldError as s}from"./field-V2DoD8qL.mjs";import{CalendarDaysIcon as c}from"lucide-react";import{useId as l}from"react";import{cn as u}from"@customafk/react-toolkit/utils";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{format as p}from"@customafk/react-toolkit/date-fns";import{useStore as m}from"@tanstack/react-form";const h=({label:h,placeholder:g,required:_,disabled:v,minDate:y,maxDate:b})=>{let x=l(),{form:S,state:C,handleBlur:w,handleChange:T}=t(),E=m(S.store,({isSubmitting:e})=>e),D=C.meta.isTouched&&!C.meta.isValid;return f(`div`,{className:`flex flex-col gap-1.5`,children:[h&&f(a,{htmlFor:x,children:[h,_&&d(`span`,{className:`text-danger-strong`,children:`*`})]}),f(n,{children:[d(i,{asChild:!0,children:f(e,{id:x,variant:`outline`,color:`muted`,size:`lg`,disabled:v||E,"aria-invalid":D,className:u(`flex w-full items-center justify-between rounded outline-border font-normal`,`hover:bg-transparent`,`focus:outline-1 focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`data-[state=open]:outline-1 data-[state=open]:outline-primary-strong data-[state=open]:ring-4 data-[state=open]:ring-primary-weak`,C.value===null&&`text-text-positive-muted`),children:[d(`span`,{children:C.value?p(C.value,`PPP`):g??`Select date`}),d(c,{strokeWidth:1})]})}),d(r,{align:`start`,side:`bottom`,className:`w-fit p-0 rounded`,onBlur:w,children:d(o,{mode:`single`,selected:C.value??void 0,hidden:{before:y??new Date(1900,0,1),after:b??new Date(2100,11,31)},onSelect:e=>{e&&T(e)}})})]}),D&&d(s,{errors:C.meta.errors})]})};export{h as SimpleDateField};
|
|
2
|
-
//# sourceMappingURL=simple-date-field-Dj4bJoji.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("./ui/button.cjs"),t=require("./tanstack-form-C0ab8EEl.cjs"),n=require("./ui/popover.cjs"),r=require("./ui/label.cjs"),i=require("./ui/calendar.cjs"),a=require("./field-BSLi-P0Q.cjs");let o=require("lucide-react"),s=require("react"),c=require("@customafk/react-toolkit/utils"),l=require("react/jsx-runtime"),u=require("@customafk/react-toolkit/date-fns"),d=require("@tanstack/react-form");const f=({label:f,placeholder:p,required:m,disabled:h,minDate:g,maxDate:_})=>{let v=(0,s.useId)(),{form:y,state:b,handleBlur:x,handleChange:S}=t.G(),C=(0,d.useStore)(y.store,({isSubmitting:e})=>e),w=b.meta.isTouched&&!b.meta.isValid;return(0,l.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[f&&(0,l.jsxs)(r.Label,{htmlFor:v,children:[f,m&&(0,l.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,l.jsxs)(n.Popover,{children:[(0,l.jsx)(n.PopoverTrigger,{asChild:!0,children:(0,l.jsxs)(e.Button,{id:v,variant:`outline`,color:`muted`,size:`lg`,disabled:h||C,"aria-invalid":w,className:(0,c.cn)(`flex w-full items-center justify-between rounded outline-border font-normal`,`hover:bg-transparent`,`focus:outline-1 focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`data-[state=open]:outline-1 data-[state=open]:outline-primary-strong data-[state=open]:ring-4 data-[state=open]:ring-primary-weak`,b.value===null&&`text-text-positive-muted`),children:[(0,l.jsx)(`span`,{children:b.value?(0,u.format)(b.value,`PPP`):p??`Select date`}),(0,l.jsx)(o.CalendarDaysIcon,{strokeWidth:1})]})}),(0,l.jsx)(n.PopoverContent,{align:`start`,side:`bottom`,className:`w-fit p-0 rounded`,onBlur:x,children:(0,l.jsx)(i.Calendar,{mode:`single`,selected:b.value??void 0,hidden:{before:g??new Date(1900,0,1),after:_??new Date(2100,11,31)},onSelect:e=>{e&&S(e)}})})]}),w&&(0,l.jsx)(a.FieldError,{errors:b.meta.errors})]})};exports.SimpleDateField=f;
|
|
2
|
-
//# sourceMappingURL=simple-date-field-DtxEpEZj.cjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Input as e}from"./ui/input.mjs";import{G as t}from"./tanstack-form-fkaBh9RO.mjs";import{Label as n}from"./ui/label.mjs";import{FieldError as r}from"./field-V2DoD8qL.mjs";import{AtSignIcon as i}from"lucide-react";import{useCallback as a,useId as o}from"react";import{cn as s}from"@customafk/react-toolkit/utils";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{useStore as u}from"@tanstack/react-form";const d=({label:d,placeholder:f,required:p,maxLength:m,disabled:h})=>{let g=o(),{form:_,name:v,state:y,handleBlur:b,handleChange:x}=t(),S=u(_.store,({isSubmitting:e})=>e),C=y.meta.isTouched&&!y.meta.isValid,w=a(({target:{value:e}})=>{S||m&&e.length>m||x(e||null)},[S,m,x]);return l(`div`,{className:`flex flex-col gap-1.5`,children:[d&&l(n,{htmlFor:g,children:[d,p&&c(`span`,{className:`text-danger-strong`,children:`*`})]}),l(`div`,{className:`relative`,children:[c(e,{id:g,name:v,type:`email`,value:y.value??``,"aria-invalid":C,autoComplete:`email`,placeholder:f,disabled:h||S,className:s(`pl-9`),onBlur:b,onChange:w}),c(`div`,{className:`pointer-events-none absolute inset-y-0 left-0 flex size-9 items-center justify-center text-muted`,children:c(i,{size:14})})]}),C&&c(r,{errors:y.meta.errors})]})};export{d as SimpleEmailField};
|
|
2
|
-
//# sourceMappingURL=simple-email-field-BDyhkmHV.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("./ui/input.cjs"),t=require("./tanstack-form-C0ab8EEl.cjs"),n=require("./ui/label.cjs"),r=require("./field-BSLi-P0Q.cjs");let i=require("lucide-react"),a=require("react"),o=require("@customafk/react-toolkit/utils"),s=require("react/jsx-runtime"),c=require("@tanstack/react-form");const l=({label:l,placeholder:u,required:d,maxLength:f,disabled:p})=>{let m=(0,a.useId)(),{form:h,name:g,state:_,handleBlur:v,handleChange:y}=t.G(),b=(0,c.useStore)(h.store,({isSubmitting:e})=>e),x=_.meta.isTouched&&!_.meta.isValid,S=(0,a.useCallback)(({target:{value:e}})=>{b||f&&e.length>f||y(e||null)},[b,f,y]);return(0,s.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[l&&(0,s.jsxs)(n.Label,{htmlFor:m,children:[l,d&&(0,s.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,s.jsxs)(`div`,{className:`relative`,children:[(0,s.jsx)(e.Input,{id:m,name:g,type:`email`,value:_.value??``,"aria-invalid":x,autoComplete:`email`,placeholder:u,disabled:p||b,className:(0,o.cn)(`pl-9`),onBlur:v,onChange:S}),(0,s.jsx)(`div`,{className:`pointer-events-none absolute inset-y-0 left-0 flex size-9 items-center justify-center text-muted`,children:(0,s.jsx)(i.AtSignIcon,{size:14})})]}),x&&(0,s.jsx)(r.FieldError,{errors:_.meta.errors})]})};exports.SimpleEmailField=l;
|
|
2
|
-
//# sourceMappingURL=simple-email-field-DK9I_Tc_.cjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("./tanstack-form-C0ab8EEl.cjs"),t=require("./ui/label.cjs"),n=require("./field-BSLi-P0Q.cjs"),r=require("./number-input-CAr3JaA-.cjs");let i=require("react"),a=require("react/jsx-runtime"),o=require("@tanstack/react-form");const s=({label:s,placeholder:c,required:l,unit:u,allowNegative:d,disabled:f})=>{let p=(0,i.useId)(),{form:m,state:h,handleBlur:g,handleChange:_}=e.G(),v=(0,o.useStore)(m.store,({isSubmitting:e})=>e),y=h.meta.isTouched&&!h.meta.isValid,b=(0,i.useCallback)(e=>{v||_(e)},[v,_]);return(0,a.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[s&&(0,a.jsxs)(t.Label,{htmlFor:p,children:[s,l&&(0,a.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,a.jsx)(r.t,{id:p,value:h.value,placeholder:c,unitText:u,allowNegative:d,disabled:f||v,onBlur:g,onValueChange:b}),y&&(0,a.jsx)(n.FieldError,{errors:h.meta.errors})]})};exports.SimpleNumberField=s;
|
|
2
|
-
//# sourceMappingURL=simple-number-field-BspqWU-3.cjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{G as e}from"./tanstack-form-fkaBh9RO.mjs";import{Label as t}from"./ui/label.mjs";import{FieldError as n}from"./field-V2DoD8qL.mjs";import{t as r}from"./number-input-CJcEV9Cg.mjs";import{useCallback as i,useId as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{useStore as c}from"@tanstack/react-form";const l=({label:l,placeholder:u,required:d,unit:f,allowNegative:p,disabled:m})=>{let h=a(),{form:g,state:_,handleBlur:v,handleChange:y}=e(),b=c(g.store,({isSubmitting:e})=>e),x=_.meta.isTouched&&!_.meta.isValid,S=i(e=>{b||y(e)},[b,y]);return s(`div`,{className:`flex flex-col gap-1.5`,children:[l&&s(t,{htmlFor:h,children:[l,d&&o(`span`,{className:`text-danger-strong`,children:`*`})]}),o(r,{id:h,value:_.value,placeholder:u,unitText:f,allowNegative:p,disabled:m||b,onBlur:v,onValueChange:S}),x&&o(n,{errors:_.meta.errors})]})};export{l as SimpleNumberField};
|
|
2
|
-
//# sourceMappingURL=simple-number-field-hneXMhfJ.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("./ui/input.cjs"),t=require("./tanstack-form-C0ab8EEl.cjs"),n=require("./ui/label.cjs"),r=require("./field-BSLi-P0Q.cjs");let i=require("lucide-react"),a=require("react"),o=require("react/jsx-runtime"),s=require("@tanstack/react-form");const c=({label:c,placeholder:l,required:u,disabled:d})=>{let f=(0,a.useId)(),{form:p,name:m,state:h,handleBlur:g,handleChange:_}=t.G(),v=(0,s.useStore)(p.store,({isSubmitting:e})=>e),[y,b]=(0,a.useState)(!1),x=h.meta.isTouched&&!h.meta.isValid,S=(0,a.useCallback)(()=>b(e=>!e),[]),C=(0,a.useCallback)(({target:{value:e}})=>{v||_(e||null)},[v,_]);return(0,o.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[c&&(0,o.jsxs)(n.Label,{htmlFor:f,children:[c,u&&(0,o.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,o.jsxs)(`div`,{className:`relative`,children:[(0,o.jsx)(e.Input,{id:f,name:m,type:y?`text`:`password`,value:h.value??``,"aria-invalid":x,autoComplete:`current-password`,placeholder:l,disabled:d||v,className:`pr-9`,onBlur:g,onChange:C}),(0,o.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-label":y?`Ẩn mật khẩu`:`Hiện mật khẩu`,"aria-pressed":y,"aria-controls":f,className:`absolute inset-y-0 right-0 flex size-9 items-center justify-center text-muted outline-none transition-colors hover:text-text-positive focus-visible:text-text-positive disabled:pointer-events-none disabled:opacity-50`,disabled:d||v,onClick:S,children:y?(0,o.jsx)(i.EyeOffIcon,{size:16,"aria-hidden":`true`}):(0,o.jsx)(i.EyeIcon,{size:16,"aria-hidden":`true`})})]}),x&&(0,o.jsx)(r.FieldError,{errors:h.meta.errors})]})};exports.SimplePasswordField=c;
|
|
2
|
-
//# sourceMappingURL=simple-password-field-BEEcleom.cjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Input as e}from"./ui/input.mjs";import{G as t}from"./tanstack-form-fkaBh9RO.mjs";import{Label as n}from"./ui/label.mjs";import{FieldError as r}from"./field-V2DoD8qL.mjs";import{EyeIcon as i,EyeOffIcon as a}from"lucide-react";import{useCallback as o,useId as s,useState as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{useStore as d}from"@tanstack/react-form";const f=({label:f,placeholder:p,required:m,disabled:h})=>{let g=s(),{form:_,name:v,state:y,handleBlur:b,handleChange:x}=t(),S=d(_.store,({isSubmitting:e})=>e),[C,w]=c(!1),T=y.meta.isTouched&&!y.meta.isValid,E=o(()=>w(e=>!e),[]),D=o(({target:{value:e}})=>{S||x(e||null)},[S,x]);return u(`div`,{className:`flex flex-col gap-1.5`,children:[f&&u(n,{htmlFor:g,children:[f,m&&l(`span`,{className:`text-danger-strong`,children:`*`})]}),u(`div`,{className:`relative`,children:[l(e,{id:g,name:v,type:C?`text`:`password`,value:y.value??``,"aria-invalid":T,autoComplete:`current-password`,placeholder:p,disabled:h||S,className:`pr-9`,onBlur:b,onChange:D}),l(`button`,{type:`button`,tabIndex:-1,"aria-label":C?`Ẩn mật khẩu`:`Hiện mật khẩu`,"aria-pressed":C,"aria-controls":g,className:`absolute inset-y-0 right-0 flex size-9 items-center justify-center text-muted outline-none transition-colors hover:text-text-positive focus-visible:text-text-positive disabled:pointer-events-none disabled:opacity-50`,disabled:h||S,onClick:E,children:l(C?a:i,{size:16,"aria-hidden":`true`})})]}),T&&l(r,{errors:y.meta.errors})]})};export{f as SimplePasswordField};
|
|
2
|
-
//# sourceMappingURL=simple-password-field-vsLRHDk4.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{G as e}from"./tanstack-form-fkaBh9RO.mjs";import{Label as t}from"./ui/label.mjs";import{RadioGroup as n,RadioGroupItem as r}from"./ui/radio-group.mjs";import{FieldError as i}from"./field-V2DoD8qL.mjs";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{useStore as s}from"@tanstack/react-form";const c=({label:c,required:l,disabled:u,options:d,orientation:f=`vertical`})=>{let{form:p,name:m,state:h,handleBlur:g,handleChange:_}=e(),v=s(p.store,({isSubmitting:e})=>e),y=h.meta.isTouched&&!h.meta.isValid,b=u||v;return o(`div`,{className:`flex flex-col gap-1.5`,children:[c&&o(t,{children:[c,l&&a(`span`,{className:`text-danger-strong`,children:`*`})]}),a(n,{name:m,value:h.value??``,disabled:b,"aria-invalid":y,className:f===`horizontal`?`flex flex-row flex-wrap gap-x-4 gap-y-2`:`flex flex-col gap-2`,onValueChange:_,onBlur:g,children:d.map(e=>o(`div`,{className:`flex items-center gap-2`,children:[a(r,{id:`${m}-${e.value}`,value:e.value}),a(t,{htmlFor:`${m}-${e.value}`,className:`cursor-pointer font-normal`,children:e.label})]},e.value))}),y&&a(i,{errors:h.meta.errors})]})};export{c as SimpleRadioGroupField};
|
|
2
|
-
//# sourceMappingURL=simple-radio-group-field-BURm_BSA.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("./tanstack-form-C0ab8EEl.cjs"),t=require("./ui/label.cjs"),n=require("./ui/radio-group.cjs"),r=require("./field-BSLi-P0Q.cjs");let i=require("react/jsx-runtime"),a=require("@tanstack/react-form");const o=({label:o,required:s,disabled:c,options:l,orientation:u=`vertical`})=>{let{form:d,name:f,state:p,handleBlur:m,handleChange:h}=e.G(),g=(0,a.useStore)(d.store,({isSubmitting:e})=>e),_=p.meta.isTouched&&!p.meta.isValid,v=c||g;return(0,i.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[o&&(0,i.jsxs)(t.Label,{children:[o,s&&(0,i.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,i.jsx)(n.RadioGroup,{name:f,value:p.value??``,disabled:v,"aria-invalid":_,className:u===`horizontal`?`flex flex-row flex-wrap gap-x-4 gap-y-2`:`flex flex-col gap-2`,onValueChange:h,onBlur:m,children:l.map(e=>(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(n.RadioGroupItem,{id:`${f}-${e.value}`,value:e.value}),(0,i.jsx)(t.Label,{htmlFor:`${f}-${e.value}`,className:`cursor-pointer font-normal`,children:e.label})]},e.value))}),_&&(0,i.jsx)(r.FieldError,{errors:p.meta.errors})]})};exports.SimpleRadioGroupField=o;
|
|
2
|
-
//# sourceMappingURL=simple-radio-group-field-Wm8xB0fN.cjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Button as e}from"./ui/button.mjs";import{G as t}from"./tanstack-form-fkaBh9RO.mjs";import{Label as n}from"./ui/label.mjs";import{Drawer as r,DrawerClose as i,DrawerContent as a,DrawerHeader as o,DrawerTitle as s}from"./ui/drawer.mjs";import{Select as c,SelectContent as l,SelectItem as u,SelectTrigger as d,SelectValue as f}from"./ui/select.mjs";import{FieldError as p}from"./field-V2DoD8qL.mjs";import{PackagePlusIcon as m}from"lucide-react";import{useId as h,useState as g}from"react";import{cn as _}from"@customafk/react-toolkit/utils";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{useIsMobile as b}from"@customafk/react-toolkit/hooks/useMobile";const x=({label:x,placeholder:S,required:C,options:w})=>{let T=h(),{state:E,handleBlur:D,handleChange:O}=t(),k=b(),[A,j]=g(!1),M=E.meta.isTouched&&!E.meta.isValid,N=w.find(e=>e.value===E.value)?.label;return k?y(`div`,{className:`flex flex-col gap-1.5`,children:[x&&y(n,{htmlFor:T,children:[x,C&&v(`span`,{className:`text-danger-strong`,children:`*`})]}),v(e,{id:T,type:`button`,variant:`outline`,color:`muted`,className:_(`w-full justify-start font-normal outline-1 outline-border -outline-offset-1`,!E.value&&`text-text-positive-muted`,M&&`outline-danger bg-danger-bg-subtle`),"aria-invalid":M,onBlur:D,onClick:()=>j(!0),children:N??v(`span`,{className:`text-text-positive-muted`,children:S})}),v(r,{open:A,onOpenChange:j,direction:`bottom`,children:y(a,{children:[v(o,{children:v(s,{children:x??S??`Select an option`})}),v(`div`,{className:`flex flex-col overflow-y-auto pb-safe-bottom`,children:w.length>0?w.map(e=>v(i,{asChild:!0,children:v(`button`,{type:`button`,className:_(`flex w-full items-center px-4 py-3 text-left text-sm transition-colors`,`hover:bg-muted-muted active:bg-muted-muted`,E.value===e.value&&`bg-primary-bg-subtle font-medium text-primary`),onClick:()=>{O(e.value),j(!1)},children:e.label})},e.value)):y(`div`,{className:`flex items-center justify-center gap-x-2 px-4 py-8 text-center text-sm text-text-positive-weak`,children:[v(m,{strokeWidth:1}),`No options available`]})})]})}),M&&v(p,{errors:E.meta.errors})]}):y(`div`,{className:`flex flex-col gap-1.5`,children:[x&&y(n,{htmlFor:T,children:[x,C&&v(`span`,{className:`text-danger-strong`,children:`*`})]}),y(c,{value:E.value??``,onValueChange:O,children:[v(d,{id:T,"aria-invalid":M?`true`:void 0,onBlur:D,children:v(f,{placeholder:S})}),v(l,{children:w.length>0?w.map(e=>v(u,{value:e.value,children:e.label},e.value)):y(`div`,{className:`flex items-center justify-center gap-x-2 rounded border border-border bg-muted-muted px-4 py-6.5 text-center text-sm text-text-positive-weak`,children:[v(m,{strokeWidth:1}),`No options available`]})})]}),M&&v(p,{errors:E.meta.errors})]})};export{x as SimpleSelectField};
|
|
2
|
-
//# sourceMappingURL=simple-select-field-8cY51U4d.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("./ui/button.cjs"),t=require("./tanstack-form-C0ab8EEl.cjs"),n=require("./ui/label.cjs"),r=require("./ui/drawer.cjs"),i=require("./ui/select.cjs"),a=require("./field-BSLi-P0Q.cjs");let o=require("lucide-react"),s=require("react"),c=require("@customafk/react-toolkit/utils"),l=require("react/jsx-runtime"),u=require("@customafk/react-toolkit/hooks/useMobile");const d=({label:d,placeholder:f,required:p,options:m})=>{let h=(0,s.useId)(),{state:g,handleBlur:_,handleChange:v}=t.G(),y=(0,u.useIsMobile)(),[b,x]=(0,s.useState)(!1),S=g.meta.isTouched&&!g.meta.isValid,C=m.find(e=>e.value===g.value)?.label;return y?(0,l.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[d&&(0,l.jsxs)(n.Label,{htmlFor:h,children:[d,p&&(0,l.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,l.jsx)(e.Button,{id:h,type:`button`,variant:`outline`,color:`muted`,className:(0,c.cn)(`w-full justify-start font-normal outline-1 outline-border -outline-offset-1`,!g.value&&`text-text-positive-muted`,S&&`outline-danger bg-danger-bg-subtle`),"aria-invalid":S,onBlur:_,onClick:()=>x(!0),children:C??(0,l.jsx)(`span`,{className:`text-text-positive-muted`,children:f})}),(0,l.jsx)(r.Drawer,{open:b,onOpenChange:x,direction:`bottom`,children:(0,l.jsxs)(r.DrawerContent,{children:[(0,l.jsx)(r.DrawerHeader,{children:(0,l.jsx)(r.DrawerTitle,{children:d??f??`Select an option`})}),(0,l.jsx)(`div`,{className:`flex flex-col overflow-y-auto pb-safe-bottom`,children:m.length>0?m.map(e=>(0,l.jsx)(r.DrawerClose,{asChild:!0,children:(0,l.jsx)(`button`,{type:`button`,className:(0,c.cn)(`flex w-full items-center px-4 py-3 text-left text-sm transition-colors`,`hover:bg-muted-muted active:bg-muted-muted`,g.value===e.value&&`bg-primary-bg-subtle font-medium text-primary`),onClick:()=>{v(e.value),x(!1)},children:e.label})},e.value)):(0,l.jsxs)(`div`,{className:`flex items-center justify-center gap-x-2 px-4 py-8 text-center text-sm text-text-positive-weak`,children:[(0,l.jsx)(o.PackagePlusIcon,{strokeWidth:1}),`No options available`]})})]})}),S&&(0,l.jsx)(a.FieldError,{errors:g.meta.errors})]}):(0,l.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[d&&(0,l.jsxs)(n.Label,{htmlFor:h,children:[d,p&&(0,l.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,l.jsxs)(i.Select,{value:g.value??``,onValueChange:v,children:[(0,l.jsx)(i.SelectTrigger,{id:h,"aria-invalid":S?`true`:void 0,onBlur:_,children:(0,l.jsx)(i.SelectValue,{placeholder:f})}),(0,l.jsx)(i.SelectContent,{children:m.length>0?m.map(e=>(0,l.jsx)(i.SelectItem,{value:e.value,children:e.label},e.value)):(0,l.jsxs)(`div`,{className:`flex items-center justify-center gap-x-2 rounded border border-border bg-muted-muted px-4 py-6.5 text-center text-sm text-text-positive-weak`,children:[(0,l.jsx)(o.PackagePlusIcon,{strokeWidth:1}),`No options available`]})})]}),S&&(0,l.jsx)(a.FieldError,{errors:g.meta.errors})]})};exports.SimpleSelectField=d;
|
|
2
|
-
//# sourceMappingURL=simple-select-field-QQ65caBf.cjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("./ui/input.cjs"),t=require("./tanstack-form-C0ab8EEl.cjs"),n=require("./ui/label.cjs"),r=require("./field-BSLi-P0Q.cjs");let i=require("react"),a=require("react/jsx-runtime"),o=require("@tanstack/react-form");const s=({label:s,placeholder:c,required:l,maxLength:u,disabled:d})=>{let f=(0,i.useId)(),{form:p,name:m,state:h,handleBlur:g,handleChange:_}=t.G(),v=(0,o.useStore)(p.store,({isSubmitting:e})=>e),y=h.meta.isTouched&&!h.meta.isValid,b=(0,i.useCallback)(({target:{value:e}})=>{v||u&&e.length>u||_(e||null)},[v,u,_]);return(0,a.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[s&&(0,a.jsxs)(n.Label,{htmlFor:f,children:[s,l&&(0,a.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,a.jsx)(e.Input,{id:f,name:m,value:h.value??``,"aria-invalid":y,placeholder:c,autoComplete:`off`,disabled:d||v,onBlur:g,onChange:b}),y&&(0,a.jsx)(r.FieldError,{errors:h.meta.errors})]})};exports.SimpleTextField=s;
|
|
2
|
-
//# sourceMappingURL=simple-text-field-BHkCPiE5.cjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Input as e}from"./ui/input.mjs";import{G as t}from"./tanstack-form-fkaBh9RO.mjs";import{Label as n}from"./ui/label.mjs";import{FieldError as r}from"./field-V2DoD8qL.mjs";import{useCallback as i,useId as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{useStore as c}from"@tanstack/react-form";const l=({label:l,placeholder:u,required:d,maxLength:f,disabled:p})=>{let m=a(),{form:h,name:g,state:_,handleBlur:v,handleChange:y}=t(),b=c(h.store,({isSubmitting:e})=>e),x=_.meta.isTouched&&!_.meta.isValid,S=i(({target:{value:e}})=>{b||f&&e.length>f||y(e||null)},[b,f,y]);return s(`div`,{className:`flex flex-col gap-1.5`,children:[l&&s(n,{htmlFor:m,children:[l,d&&o(`span`,{className:`text-danger-strong`,children:`*`})]}),o(e,{id:m,name:g,value:_.value??``,"aria-invalid":x,placeholder:u,autoComplete:`off`,disabled:p||b,onBlur:v,onChange:S}),x&&o(r,{errors:_.meta.errors})]})};export{l as SimpleTextField};
|
|
2
|
-
//# sourceMappingURL=simple-text-field-DK72_OA_.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{G as e}from"./tanstack-form-fkaBh9RO.mjs";import{Label as t}from"./ui/label.mjs";import{Textarea as n}from"./ui/textarea.mjs";import{FieldError as r}from"./field-V2DoD8qL.mjs";import{useCallback as i,useId as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{useStore as c}from"@tanstack/react-form";const l=({label:l,placeholder:u,required:d,maxLength:f,rows:p,disabled:m})=>{let h=a(),{form:g,name:_,state:v,handleBlur:y,handleChange:b}=e(),x=c(g.store,({isSubmitting:e})=>e),S=v.meta.isTouched&&!v.meta.isValid,C=i(({target:{value:e}})=>{x||f&&e.length>f||b(e||null)},[x,f,b]);return s(`div`,{className:`flex flex-col gap-1.5`,children:[l&&s(t,{htmlFor:h,children:[l,d&&o(`span`,{className:`text-danger-strong`,children:`*`})]}),o(n,{id:h,name:_,value:v.value??``,"aria-invalid":S,placeholder:u,rows:p,disabled:m||x,onBlur:y,onChange:C}),S&&o(r,{errors:v.meta.errors})]})};export{l as SimpleTextareaField};
|
|
2
|
-
//# sourceMappingURL=simple-textarea-field-B72nNQHv.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("./tanstack-form-C0ab8EEl.cjs"),t=require("./ui/label.cjs"),n=require("./ui/textarea.cjs"),r=require("./field-BSLi-P0Q.cjs");let i=require("react"),a=require("react/jsx-runtime"),o=require("@tanstack/react-form");const s=({label:s,placeholder:c,required:l,maxLength:u,rows:d,disabled:f})=>{let p=(0,i.useId)(),{form:m,name:h,state:g,handleBlur:_,handleChange:v}=e.G(),y=(0,o.useStore)(m.store,({isSubmitting:e})=>e),b=g.meta.isTouched&&!g.meta.isValid,x=(0,i.useCallback)(({target:{value:e}})=>{y||u&&e.length>u||v(e||null)},[y,u,v]);return(0,a.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[s&&(0,a.jsxs)(t.Label,{htmlFor:p,children:[s,l&&(0,a.jsx)(`span`,{className:`text-danger-strong`,children:`*`})]}),(0,a.jsx)(n.Textarea,{id:p,name:h,value:g.value??``,"aria-invalid":b,placeholder:c,rows:d,disabled:f||y,onBlur:_,onChange:x}),b&&(0,a.jsx)(r.FieldError,{errors:g.meta.errors})]})};exports.SimpleTextareaField=s;
|
|
2
|
-
//# sourceMappingURL=simple-textarea-field-Bu5h7sfH.cjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{G as e}from"./tanstack-form-fkaBh9RO.mjs";import{Field as t,FieldContent as n,FieldDescription as r,FieldGroup as i,FieldNote as a,FieldSeparator as o,FieldTitle as s}from"./field-V2DoD8qL.mjs";import{cn as c}from"@customafk/react-toolkit/utils";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{Switch as d}from"radix-ui";function f({className:e,...t}){return l(d.Root,{"data-slot":`switch`,className:c(`peer`,`w-8 shrink-0 cursor-pointer items-center rounded-full shadow-xs transition-all`,`inline-flex h-5`,`focus-visible:border-primary-strong`,`focus-visible:ring-primary-weak`,`focus-visible:ring-4`,`disabled:cursor-not-allowed`,`disabled:opacity-50`,`-outline-offset-1 inset-shadow-2xs outline-1`,`data-[state=checked]:bg-primary`,`data-[state=checked]:outline-primary-strong`,`data-[state=unchecked]:bg-muted-weak`,`data-[state=unchecked]:outline-border`,`data-[state=unchecked]:[&_span]:size-4`,`data-[state=unchecked]:[&_span]:translate-x-0.5`,`data-[state=unchecked]:[&_span]:rtl:-translate-x-0.5`,e),...t,children:l(d.Thumb,{"data-slot":`switch-thumb`,className:c(`block size-4 bg-card shadow-xs`,`pointer-events-none rounded-full ring-0 transition-transform`,`data-[state=checked]:translate-x-[calc(100%-3px)]`,`data-[state=unchecked]:translate-x-0`)})})}const p=({label:c,description:d,helperText:p})=>{let m=e();return u(i,{className:`gap-y-4 px-4`,children:[u(t,{orientation:`vertical`,className:`relative justify-between gap-y-1`,children:[u(n,{children:[l(s,{className:`cursor-pointer`,children:l(`label`,{htmlFor:m.name,children:c})}),l(r,{children:d}),l(f,{id:m.name,checked:m.state.value??!1,className:`absolute top-1 right-1`,onBlur:m.handleBlur,onCheckedChange:m.handleChange})]}),l(a,{isShow:!!p,children:p})]}),l(o,{})]})};export{p as SwitchField};
|
|
2
|
-
//# sourceMappingURL=switch-field-DoPUWb9d.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("./tanstack-form-C0ab8EEl.cjs"),t=require("./field-BSLi-P0Q.cjs");let n=require("@customafk/react-toolkit/utils"),r=require("react/jsx-runtime"),i=require("radix-ui");function a({className:e,...t}){return(0,r.jsx)(i.Switch.Root,{"data-slot":`switch`,className:(0,n.cn)(`peer`,`w-8 shrink-0 cursor-pointer items-center rounded-full shadow-xs transition-all`,`inline-flex h-5`,`focus-visible:border-primary-strong`,`focus-visible:ring-primary-weak`,`focus-visible:ring-4`,`disabled:cursor-not-allowed`,`disabled:opacity-50`,`-outline-offset-1 inset-shadow-2xs outline-1`,`data-[state=checked]:bg-primary`,`data-[state=checked]:outline-primary-strong`,`data-[state=unchecked]:bg-muted-weak`,`data-[state=unchecked]:outline-border`,`data-[state=unchecked]:[&_span]:size-4`,`data-[state=unchecked]:[&_span]:translate-x-0.5`,`data-[state=unchecked]:[&_span]:rtl:-translate-x-0.5`,e),...t,children:(0,r.jsx)(i.Switch.Thumb,{"data-slot":`switch-thumb`,className:(0,n.cn)(`block size-4 bg-card shadow-xs`,`pointer-events-none rounded-full ring-0 transition-transform`,`data-[state=checked]:translate-x-[calc(100%-3px)]`,`data-[state=unchecked]:translate-x-0`)})})}const o=({label:n,description:i,helperText:o})=>{let s=e.G();return(0,r.jsxs)(t.FieldGroup,{className:`gap-y-4 px-4`,children:[(0,r.jsxs)(t.Field,{orientation:`vertical`,className:`relative justify-between gap-y-1`,children:[(0,r.jsxs)(t.FieldContent,{children:[(0,r.jsx)(t.FieldTitle,{className:`cursor-pointer`,children:(0,r.jsx)(`label`,{htmlFor:s.name,children:n})}),(0,r.jsx)(t.FieldDescription,{children:i}),(0,r.jsx)(a,{id:s.name,checked:s.state.value??!1,className:`absolute top-1 right-1`,onBlur:s.handleBlur,onCheckedChange:s.handleChange})]}),(0,r.jsx)(t.FieldNote,{isShow:!!o,children:o})]}),(0,r.jsx)(t.FieldSeparator,{})]})};exports.SwitchField=o;
|
|
2
|
-
//# sourceMappingURL=switch-field-eLVlQZSI.cjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("./ui/skeleton.cjs");let t=require("react"),n=require("react/jsx-runtime"),r=require("@tanstack/react-form");const{fieldContext:i,formContext:a,useFieldContext:o,useFormContext:s}=(0,r.createFormHookContexts)();function c(){return(0,n.jsx)(e.Skeleton,{"data-slot":`tanstack-field-skeleton`,className:`h-9 w-full rounded`})}function l(e){let r=(0,t.lazy)(e);return e=>(0,n.jsx)(t.Suspense,{fallback:(0,n.jsx)(c,{}),children:(0,n.jsx)(r,{...e})})}const u=l(()=>Promise.resolve().then(()=>require("./text-field-DT50dOVI.cjs")).then(e=>({default:e.TextField}))),d=l(()=>Promise.resolve().then(()=>require("./textarea-field-BhqX29CS.cjs")).then(e=>({default:e.TextareaField}))),f=l(()=>Promise.resolve().then(()=>require("./text-editor-field-DcEUC0iH.cjs")).then(e=>({default:e.TextEditorField}))),p=l(()=>Promise.resolve().then(()=>require("./number-field-CWDYA3La.cjs")).then(e=>({default:e.NumberField}))),m=l(()=>Promise.resolve().then(()=>require("./email-field-D3nSkHj2.cjs")).then(e=>({default:e.EmailField}))),h=l(()=>Promise.resolve().then(()=>require("./password-field-BHRhVyZ0.cjs")).then(e=>({default:e.PasswordField}))),g=l(()=>Promise.resolve().then(()=>require("./select-field-CvDBZQTl.cjs")).then(e=>({default:e.SelectField}))),_=l(()=>Promise.resolve().then(()=>require("./combobox-field-ZYr7636s.cjs")).then(e=>({default:e.ComboboxField}))),v=l(()=>Promise.resolve().then(()=>require("./date-field-1Hmcv8Zp.cjs")).then(e=>({default:e.DateField}))),y=l(()=>Promise.resolve().then(()=>require("./switch-field-eLVlQZSI.cjs")).then(e=>({default:e.SwitchField}))),b=l(()=>Promise.resolve().then(()=>require("./radio-group-field-BFhBfzoT.cjs")).then(e=>({default:e.RadioGroupField}))),x=l(()=>Promise.resolve().then(()=>require("./checkbox-field-ldZRSCca.cjs")).then(e=>({default:e.CheckboxField}))),S=l(()=>Promise.resolve().then(()=>require("./simple-text-field-BHkCPiE5.cjs")).then(e=>({default:e.SimpleTextField}))),C=l(()=>Promise.resolve().then(()=>require("./simple-email-field-DK9I_Tc_.cjs")).then(e=>({default:e.SimpleEmailField}))),w=l(()=>Promise.resolve().then(()=>require("./simple-password-field-BEEcleom.cjs")).then(e=>({default:e.SimplePasswordField}))),T=l(()=>Promise.resolve().then(()=>require("./simple-textarea-field-Bu5h7sfH.cjs")).then(e=>({default:e.SimpleTextareaField}))),E=l(()=>Promise.resolve().then(()=>require("./simple-number-field-BspqWU-3.cjs")).then(e=>({default:e.SimpleNumberField}))),D=l(()=>Promise.resolve().then(()=>require("./simple-select-field-QQ65caBf.cjs")).then(e=>({default:e.SimpleSelectField}))),O=(0,t.lazy)(()=>Promise.resolve().then(()=>require("./simple-array-field-aGXkDZXD.cjs")).then(e=>({default:e.SimpleArrayField})));function k(e){return(0,n.jsx)(t.Suspense,{fallback:(0,n.jsx)(c,{}),children:(0,n.jsx)(O,{...e})})}const A=l(()=>Promise.resolve().then(()=>require("./simple-boolean-field-BeVkn3c4.cjs")).then(e=>({default:e.SimpleBooleanField}))),j=l(()=>Promise.resolve().then(()=>require("./simple-combobox-field-U0ZAl7VQ.cjs")).then(e=>({default:e.SimpleComboboxField}))),M=l(()=>Promise.resolve().then(()=>require("./simple-date-field-DtxEpEZj.cjs")).then(e=>({default:e.SimpleDateField}))),N=l(()=>Promise.resolve().then(()=>require("./simple-radio-group-field-Wm8xB0fN.cjs")).then(e=>({default:e.SimpleRadioGroupField}))),P=l(()=>Promise.resolve().then(()=>require("./simple-array-field-aGXkDZXD.cjs")).then(e=>({default:e.ArrayCol}))),F=l(()=>Promise.resolve().then(()=>require("./simple-array-field-aGXkDZXD.cjs")).then(e=>({default:e.ArrayHeaderRow}))),I=l(()=>Promise.resolve().then(()=>require("./dialog-form-C1qpltYx.cjs")).then(e=>({default:e.TanStackDialogForm}))),L=l(()=>Promise.resolve().then(()=>require("./popover-form-Ch_iMMSm.cjs")).then(e=>({default:e.TanStackPopoverForm}))),R=l(()=>Promise.resolve().then(()=>require("./container-form-D8QNEn8M.cjs")).then(e=>({default:e.TanStackContainerForm}))),z=l(()=>Promise.resolve().then(()=>require("./section-form-C_pHiBEW.cjs")).then(e=>({default:e.TanStackSectionForm}))),B=l(()=>Promise.resolve().then(()=>require("./card-form-BR5kDTzB.cjs")).then(e=>({default:e.TanStackCardForm}))),V=l(()=>Promise.resolve().then(()=>require("./group-field-sVykO2JZ.cjs")).then(e=>({default:e.TanStackFieldGroup}))),H=l(()=>Promise.resolve().then(()=>require("./title-field-B2hM3S_S.cjs")).then(e=>({default:e.TanStackTitleField}))),U=l(()=>Promise.resolve().then(()=>require("./actions-form-DF2eYxGQ.cjs")).then(e=>({default:e.TanStackActionsForm}))),W=l(()=>Promise.resolve().then(()=>require("./action-submit-B9vHpLoN.cjs")).then(e=>({default:e.TanStackActionSubmit}))),G=l(()=>Promise.resolve().then(()=>require("./field-BSLi-P0Q.cjs")).then(e=>({default:e.FieldGroup}))),K=l(()=>Promise.resolve().then(()=>require("./field-BSLi-P0Q.cjs")).then(e=>({default:e.Field}))),q=l(()=>Promise.resolve().then(()=>require("./field-BSLi-P0Q.cjs")).then(e=>({default:e.FieldContent}))),J=l(()=>Promise.resolve().then(()=>require("./field-BSLi-P0Q.cjs")).then(e=>({default:e.FieldLabel}))),Y=l(()=>Promise.resolve().then(()=>require("./field-BSLi-P0Q.cjs")).then(e=>({default:e.FieldContentMain}))),X=l(()=>Promise.resolve().then(()=>require("./field-BSLi-P0Q.cjs")).then(e=>({default:e.FieldSeparator}))),Z=l(()=>Promise.resolve().then(()=>require("./field-BSLi-P0Q.cjs")).then(e=>({default:e.FieldError}))),{useAppForm:Q,withForm:$,withFieldGroup:ee}=(0,r.createFormHook)({fieldContext:i,formContext:a,fieldComponents:{TextField:u,TextareaField:d,TextEditorField:f,NumberField:p,EmailField:m,PasswordField:h,SelectField:g,ComboboxField:_,DateField:v,SwitchField:y,RadioGroupField:b,CheckboxField:x,SimpleTextField:S,SimpleEmailField:C,SimplePasswordField:w,SimpleTextareaField:T,SimpleNumberField:E,SimpleSelectField:D,SimpleArrayField:k,SimpleBooleanField:A,SimpleComboboxField:j,SimpleDateField:M,SimpleRadioGroupField:N,FieldGroup:G,Field:K,FieldContent:q,FieldLabel:J,FieldContentMain:Y,FieldSeparator:X,FieldError:Z},formComponents:{TanStackDialogForm:I,TanStackPopoverForm:L,TanStackContainerForm:R,TanStackSectionForm:z,TanStackCardForm:B,TanStackFieldGroup:V,TanStackTitleField:H,TanStackActionsForm:U,TanStackActionSubmit:W,ArrayCol:P,ArrayHeaderRow:F}});Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"G",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"H",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"K",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"U",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"W",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return f}});
|
|
2
|
-
//# sourceMappingURL=tanstack-form-C0ab8EEl.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tanstack-form-C0ab8EEl.cjs","names":["Skeleton","Suspense","Impl"],"sources":["../packages/components/features/tanstack-form/components/form-context.ts","../packages/components/features/tanstack-form/tanstack-form.tsx"],"sourcesContent":["'use client';\n\nimport { createFormHookContexts } from '@tanstack/react-form';\n\n/**\n * Shared field/form contexts, split out from `tanstack-form.tsx` so that field and form\n * components can depend on them directly instead of importing back through the file that\n * lazy-loads those same components (which would reintroduce a circular import).\n */\nexport const { fieldContext, formContext, useFieldContext: useTanStackFieldContext, useFormContext: useTanStackFormContext } = createFormHookContexts();\n","'use client';\n\nimport type { ComponentProps, ComponentType } from 'react';\nimport { lazy, Suspense } from 'react';\n\nimport { createFormHook } from '@tanstack/react-form';\n\nimport { Skeleton } from '@/components/ui/skeleton';\n\nimport type { ArrayCol as ArrayColType, ArrayHeaderRow as ArrayHeaderRowType, SimpleArrayFieldProps } from './components/atoms/simple-array-field';\nimport type { SimpleBooleanField as SimpleBooleanFieldType } from './components/atoms/simple-boolean-field';\nimport type { SimpleComboboxField as SimpleComboboxFieldType } from './components/atoms/simple-combobox-field';\nimport type { SimpleDateField as SimpleDateFieldType } from './components/atoms/simple-date-field';\nimport type { SimpleEmailField as SimpleEmailFieldType } from './components/atoms/simple-email-field';\nimport type { SimpleNumberField as SimpleNumberFieldType } from './components/atoms/simple-number-field';\nimport type { SimplePasswordField as SimplePasswordFieldType } from './components/atoms/simple-password-field';\nimport type { SimpleRadioGroupField as SimpleRadioGroupFieldType } from './components/atoms/simple-radio-group-field';\nimport type { SimpleSelectField as SimpleSelectFieldType } from './components/atoms/simple-select-field';\nimport type { SimpleTextField as SimpleTextFieldType } from './components/atoms/simple-text-field';\nimport type { SimpleTextareaField as SimpleTextareaFieldType } from './components/atoms/simple-textarea-field';\nimport type { CheckboxField as CheckboxFieldType } from './components/fields/checkbox-field';\nimport type { ComboboxField as ComboboxFieldType } from './components/fields/combobox-field';\nimport type { DateField as DateFieldType } from './components/fields/date-field';\nimport type { EmailField as EmailFieldType } from './components/fields/email-field';\nimport type { NumberField as NumberFieldType } from './components/fields/number-field';\nimport type { PasswordField as PasswordFieldType } from './components/fields/password-field';\nimport type { RadioGroupField as RadioGroupFieldType } from './components/fields/radio-group-field';\nimport type { SelectField as SelectFieldType } from './components/fields/select-field';\nimport type { SwitchField as SwitchFieldType } from './components/fields/switch-field';\nimport type { TextEditorField as TextEditorFieldType } from './components/fields/text-editor-field';\nimport type { TextField as TextFieldType } from './components/fields/text-field';\nimport type { TextareaField as TextareaFieldType } from './components/fields/textarea-field';\nimport { fieldContext, formContext, useTanStackFieldContext, useTanStackFormContext } from './components/form-context';\nimport type { TanStackActionSubmit as TanStackActionSubmitType } from './components/forms/action-submit';\nimport type { TanStackActionsForm as TanStackActionsFormType } from './components/forms/actions-form';\nimport type { TanStackCardForm as TanStackCardFormType } from './components/forms/card-form';\nimport type { TanStackContainerForm as TanStackContainerFormType } from './components/forms/container-form';\nimport type { TanStackDialogForm as TanStackDialogFormType } from './components/forms/dialog-form';\nimport type { TanStackFieldGroup as TanStackFieldGroupType } from './components/forms/group-field';\nimport type { TanStackPopoverForm as TanStackPopoverFormType } from './components/forms/popover-form';\nimport type { TanStackSectionForm as TanStackSectionFormType } from './components/forms/section-form';\nimport type { TanStackTitleField as TanStackTitleFieldType } from './components/forms/title-field';\nimport type {\n FieldContentMain as FieldContentMainType,\n FieldContent as FieldContentType,\n FieldError as FieldErrorType,\n FieldGroup as FieldGroupType,\n FieldLabel as FieldLabelType,\n FieldSeparator as FieldSeparatorType,\n Field as FieldType,\n} from './components/ui/field';\n\n/** Input-shaped pulse placeholder shown while a lazy field/form chunk is still loading. */\nfunction FieldSkeleton() {\n return <Skeleton data-slot=\"tanstack-field-skeleton\" className=\"h-9 w-full rounded\" />;\n}\n\n/**\n * Wraps a `lazy()`-loaded component in its own `Suspense` boundary so it can be dropped\n * anywhere (inside or outside our own form containers) without callers needing to set up\n * Suspense themselves. Keeps this file itself small — the heavy per-field-type\n * implementations (Radix Select/Combobox/date-picker, the rich text editor, etc.) only load\n * when a form actually renders that field type.\n */\nfunction lazyField<P extends object>(loader: () => Promise<{ default: ComponentType<P> }>): ComponentType<P> {\n const LazyComponent = lazy(loader);\n return (props: P) => (\n <Suspense fallback={<FieldSkeleton />}>\n <LazyComponent {...props} />\n </Suspense>\n );\n}\n\n// ─── Rich field components (lazy) ─────────────────────────────────────────────\n\nconst TextField = lazyField<ComponentProps<typeof TextFieldType>>(() => import('./components/fields/text-field').then(m => ({ default: m.TextField })));\nconst TextareaField = lazyField<ComponentProps<typeof TextareaFieldType>>(() =>\n import('./components/fields/textarea-field').then(m => ({ default: m.TextareaField }))\n);\nconst TextEditorField = lazyField<ComponentProps<typeof TextEditorFieldType>>(() =>\n import('./components/fields/text-editor-field').then(m => ({ default: m.TextEditorField }))\n);\nconst NumberField = lazyField<ComponentProps<typeof NumberFieldType>>(() => import('./components/fields/number-field').then(m => ({ default: m.NumberField })));\nconst EmailField = lazyField<ComponentProps<typeof EmailFieldType>>(() => import('./components/fields/email-field').then(m => ({ default: m.EmailField })));\nconst PasswordField = lazyField<ComponentProps<typeof PasswordFieldType>>(() =>\n import('./components/fields/password-field').then(m => ({ default: m.PasswordField }))\n);\nconst SelectField = lazyField<ComponentProps<typeof SelectFieldType>>(() => import('./components/fields/select-field').then(m => ({ default: m.SelectField })));\nconst ComboboxField = lazyField<ComponentProps<typeof ComboboxFieldType>>(() =>\n import('./components/fields/combobox-field').then(m => ({ default: m.ComboboxField }))\n);\nconst DateField = lazyField<ComponentProps<typeof DateFieldType>>(() => import('./components/fields/date-field').then(m => ({ default: m.DateField })));\nconst SwitchField = lazyField<ComponentProps<typeof SwitchFieldType>>(() => import('./components/fields/switch-field').then(m => ({ default: m.SwitchField })));\nconst RadioGroupField = lazyField<ComponentProps<typeof RadioGroupFieldType>>(() =>\n import('./components/fields/radio-group-field').then(m => ({ default: m.RadioGroupField }))\n);\nconst CheckboxField = lazyField<ComponentProps<typeof CheckboxFieldType>>(() =>\n import('./components/fields/checkbox-field').then(m => ({ default: m.CheckboxField }))\n);\n\n// ─── Simple (minimal) field components (lazy) ─────────────────────────────────\n\nconst SimpleTextField = lazyField<ComponentProps<typeof SimpleTextFieldType>>(() =>\n import('./components/atoms/simple-text-field').then(m => ({ default: m.SimpleTextField }))\n);\nconst SimpleEmailField = lazyField<ComponentProps<typeof SimpleEmailFieldType>>(() =>\n import('./components/atoms/simple-email-field').then(m => ({ default: m.SimpleEmailField }))\n);\nconst SimplePasswordField = lazyField<ComponentProps<typeof SimplePasswordFieldType>>(() =>\n import('./components/atoms/simple-password-field').then(m => ({ default: m.SimplePasswordField }))\n);\nconst SimpleTextareaField = lazyField<ComponentProps<typeof SimpleTextareaFieldType>>(() =>\n import('./components/atoms/simple-textarea-field').then(m => ({ default: m.SimpleTextareaField }))\n);\nconst SimpleNumberField = lazyField<ComponentProps<typeof SimpleNumberFieldType>>(() =>\n import('./components/atoms/simple-number-field').then(m => ({ default: m.SimpleNumberField }))\n);\nconst SimpleSelectField = lazyField<ComponentProps<typeof SimpleSelectFieldType>>(() =>\n import('./components/atoms/simple-select-field').then(m => ({ default: m.SimpleSelectField }))\n);\nconst LazySimpleArrayField = lazy(() =>\n import('./components/atoms/simple-array-field').then(m => ({ default: m.SimpleArrayField as ComponentType<SimpleArrayFieldProps<unknown>> }))\n);\n\n/** Kept as its own generic wrapper (instead of `lazyField`) so callers can still write `<SimpleArrayField<Row> />`. */\nfunction SimpleArrayField<T>(props: SimpleArrayFieldProps<T>) {\n const Impl = LazySimpleArrayField as ComponentType<SimpleArrayFieldProps<T>>;\n return (\n <Suspense fallback={<FieldSkeleton />}>\n <Impl {...props} />\n </Suspense>\n );\n}\n\nconst SimpleBooleanField = lazyField<ComponentProps<typeof SimpleBooleanFieldType>>(() =>\n import('./components/atoms/simple-boolean-field').then(m => ({ default: m.SimpleBooleanField }))\n);\nconst SimpleComboboxField = lazyField<ComponentProps<typeof SimpleComboboxFieldType>>(() =>\n import('./components/atoms/simple-combobox-field').then(m => ({ default: m.SimpleComboboxField }))\n);\nconst SimpleDateField = lazyField<ComponentProps<typeof SimpleDateFieldType>>(() =>\n import('./components/atoms/simple-date-field').then(m => ({ default: m.SimpleDateField }))\n);\nconst SimpleRadioGroupField = lazyField<ComponentProps<typeof SimpleRadioGroupFieldType>>(() =>\n import('./components/atoms/simple-radio-group-field').then(m => ({ default: m.SimpleRadioGroupField }))\n);\n\n// ─── Array field layout helpers (lazy, co-located with SimpleArrayField) ──────\n\nconst ArrayCol = lazyField<ComponentProps<typeof ArrayColType>>(() => import('./components/atoms/simple-array-field').then(m => ({ default: m.ArrayCol })));\nconst ArrayHeaderRow = lazyField<ComponentProps<typeof ArrayHeaderRowType>>(() =>\n import('./components/atoms/simple-array-field').then(m => ({ default: m.ArrayHeaderRow }))\n);\n\n// ─── Form containers (lazy) ───────────────────────────────────────────────────\n\nconst TanStackDialogForm = lazyField<ComponentProps<typeof TanStackDialogFormType>>(() =>\n import('./components/forms/dialog-form').then(m => ({ default: m.TanStackDialogForm }))\n);\nconst TanStackPopoverForm = lazyField<ComponentProps<typeof TanStackPopoverFormType>>(() =>\n import('./components/forms/popover-form').then(m => ({ default: m.TanStackPopoverForm }))\n);\nconst TanStackContainerForm = lazyField<ComponentProps<typeof TanStackContainerFormType>>(() =>\n import('./components/forms/container-form').then(m => ({ default: m.TanStackContainerForm }))\n);\nconst TanStackSectionForm = lazyField<ComponentProps<typeof TanStackSectionFormType>>(() =>\n import('./components/forms/section-form').then(m => ({ default: m.TanStackSectionForm }))\n);\nconst TanStackCardForm = lazyField<ComponentProps<typeof TanStackCardFormType>>(() =>\n import('./components/forms/card-form').then(m => ({ default: m.TanStackCardForm }))\n);\nconst TanStackFieldGroup = lazyField<ComponentProps<typeof TanStackFieldGroupType>>(() =>\n import('./components/forms/group-field').then(m => ({ default: m.TanStackFieldGroup }))\n);\nconst TanStackTitleField = lazyField<ComponentProps<typeof TanStackTitleFieldType>>(() =>\n import('./components/forms/title-field').then(m => ({ default: m.TanStackTitleField }))\n);\nconst TanStackActionsForm = lazyField<ComponentProps<typeof TanStackActionsFormType>>(() =>\n import('./components/forms/actions-form').then(m => ({ default: m.TanStackActionsForm }))\n);\nconst TanStackActionSubmit = lazyField<ComponentProps<typeof TanStackActionSubmitType>>(() =>\n import('./components/forms/action-submit').then(m => ({ default: m.TanStackActionSubmit }))\n);\n\n// ─── Field UI primitives (lazy) ───────────────────────────────────────────────\n\nconst FieldGroup = lazyField<ComponentProps<typeof FieldGroupType>>(() => import('./components/ui/field').then(m => ({ default: m.FieldGroup })));\nconst Field = lazyField<ComponentProps<typeof FieldType>>(() => import('./components/ui/field').then(m => ({ default: m.Field })));\nconst FieldContent = lazyField<ComponentProps<typeof FieldContentType>>(() => import('./components/ui/field').then(m => ({ default: m.FieldContent })));\nconst FieldLabel = lazyField<ComponentProps<typeof FieldLabelType>>(() => import('./components/ui/field').then(m => ({ default: m.FieldLabel })));\nconst FieldContentMain = lazyField<ComponentProps<typeof FieldContentMainType>>(() =>\n import('./components/ui/field').then(m => ({ default: m.FieldContentMain }))\n);\nconst FieldSeparator = lazyField<ComponentProps<typeof FieldSeparatorType>>(() => import('./components/ui/field').then(m => ({ default: m.FieldSeparator })));\nconst FieldError = lazyField<ComponentProps<typeof FieldErrorType>>(() => import('./components/ui/field').then(m => ({ default: m.FieldError })));\n\n/**\n * Factory result from {@link createFormHook} pre-wired with all Lunas UI field and form components.\n *\n * ### `useTanStackForm`\n * Pre-configured TanStack Form hook that returns a type-safe form instance bound to all Lunas UI\n * field and form components.\n *\n * @example\n * import { useTanStackForm } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * const form = useTanStackForm({\n * defaultValues: { name: '', email: '' },\n * onSubmit: async ({ value }) => console.log(value),\n * });\n *\n * return (\n * <form.Provider>\n * <form.AppForm>\n * <form.AppField name=\"name\" children={(field) => <field.TextField label=\"Name\" />} />\n * <form.Subscribe selector={(s) => s.canSubmit}>\n * {(canSubmit) => <form.TanStackActionSubmit disabled={!canSubmit} />}\n * </form.Subscribe>\n * </form.AppForm>\n * </form.Provider>\n * );\n *\n * ### `withTanStackForm`\n * Higher-order component that wraps a sub-form component with access to the parent\n * `useTanStackForm` form context, enabling isolated field groups that still participate in the\n * top-level form state.\n *\n * @example\n * import { withTanStackForm } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * const AddressFields = withTanStackForm(\n * { street: '', city: '' } as const,\n * ({ form }) => (\n * <>\n * <form.AppField name=\"street\" children={(f) => <f.TextField label=\"Street\" />} />\n * <form.AppField name=\"city\" children={(f) => <f.TextField label=\"City\" />} />\n * </>\n * ),\n * );\n *\n * ### `withTanStackFieldGroup`\n * Higher-order component that creates a reusable field-group component sharing the enclosing\n * `useTanStackForm` context without requiring additional form providers.\n *\n * @example\n * import { withTanStackFieldGroup } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * const ContactGroup = withTanStackFieldGroup(({ form }) => (\n * <form.AppField name=\"phone\" children={(f) => <f.TextField label=\"Phone\" />} />\n * ));\n */\nconst {\n useAppForm: useTanStackForm,\n withForm: withTanStackForm,\n withFieldGroup: withTanStackFieldGroup,\n} = createFormHook({\n fieldContext,\n formContext,\n\n fieldComponents: {\n TextField,\n TextareaField,\n TextEditorField,\n NumberField,\n EmailField,\n PasswordField,\n\n SelectField,\n ComboboxField,\n DateField,\n SwitchField,\n RadioGroupField,\n CheckboxField,\n\n SimpleTextField,\n SimpleEmailField,\n SimplePasswordField,\n SimpleTextareaField,\n SimpleNumberField,\n SimpleSelectField,\n SimpleArrayField,\n SimpleBooleanField,\n SimpleComboboxField,\n SimpleDateField,\n SimpleRadioGroupField,\n\n FieldGroup,\n Field,\n FieldContent,\n FieldLabel,\n FieldContentMain,\n FieldSeparator,\n FieldError,\n },\n formComponents: {\n TanStackDialogForm,\n TanStackPopoverForm,\n TanStackContainerForm,\n TanStackSectionForm,\n TanStackCardForm,\n TanStackFieldGroup,\n TanStackTitleField,\n\n TanStackActionsForm,\n TanStackActionSubmit,\n\n ArrayCol,\n ArrayHeaderRow,\n },\n});\n\nexport {\n // Array helpers\n ArrayCol,\n ArrayHeaderRow,\n CheckboxField,\n ComboboxField,\n DateField,\n EmailField,\n Field,\n FieldContent,\n FieldContentMain,\n FieldError,\n // Field UI primitives\n FieldGroup,\n FieldLabel,\n FieldSeparator,\n NumberField,\n PasswordField,\n RadioGroupField,\n SelectField,\n SimpleArrayField,\n SimpleBooleanField,\n SimpleComboboxField,\n SimpleDateField,\n SimpleEmailField,\n SimpleNumberField,\n SimplePasswordField,\n SimpleRadioGroupField,\n SimpleSelectField,\n SimpleTextareaField,\n // Simple (minimal) field components\n SimpleTextField,\n SwitchField,\n TanStackActionSubmit,\n // Form actions\n TanStackActionsForm,\n TanStackCardForm,\n TanStackContainerForm,\n // Form containers\n TanStackDialogForm,\n TanStackFieldGroup,\n TanStackPopoverForm,\n TanStackSectionForm,\n TanStackTitleField,\n TextareaField,\n TextEditorField,\n // Rich field components\n TextField,\n useTanStackFieldContext,\n // Hooks & HOCs\n useTanStackForm,\n useTanStackFormContext,\n withTanStackFieldGroup,\n withTanStackForm,\n};\n"],"mappings":"6HASA,KAAa,CAAE,eAAc,cAAa,gBAAiB,EAAyB,eAAgB,IAAA,EAAA,EAAA,uBAAA,CAAkD,EC4CtJ,SAAS,GAAgB,CACvB,OAAO,EAAA,EAAA,IAAA,CAACA,EAAAA,SAAD,CAAU,YAAU,0BAA0B,UAAU,oBAAsB,CAAA,CACvF,CASA,SAAS,EAA4B,EAAwE,CAC3G,IAAM,GAAA,EAAA,EAAA,KAAA,CAAqB,CAAM,EACjC,MAAQ,KACN,EAAA,EAAA,IAAA,CAACC,EAAAA,SAAD,CAAU,UAAU,EAAA,EAAA,IAAA,CAAC,EAAD,CAAgB,CAAA,EAClC,UAAA,EAAA,EAAA,IAAA,CAAC,EAAD,CAAe,GAAI,CAAQ,CAAA,CACnB,CAAA,CAEd,CAIA,MAAM,EAAY,MAAA,QAAA,QAAA,CAAA,CAAA,SAAA,QAAsD,2BAAA,CAAA,CAAA,CAAyC,KAAK,IAAM,CAAE,QAAS,EAAE,SAAU,EAAE,CAAC,EAChJ,EAAgB,MAAA,QAAA,QAAA,CAAA,CAAA,SAAA,QACpB,+BAAA,CAAA,CAAA,CAA6C,KAAK,IAAM,CAAE,QAAS,EAAE,aAAc,EAAE,CACvF,EACM,EAAkB,MAAA,QAAA,QAAA,CAAA,CAAA,SAAA,QACtB,kCAAA,CAAA,CAAA,CAAgD,KAAK,IAAM,CAAE,QAAS,EAAE,eAAgB,EAAE,CAC5F,EACM,EAAc,MAAA,QAAA,QAAA,CAAA,CAAA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