@customafk/lunas-ui 0.2.83 → 0.2.84
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/action-submit-BHY2dndL.mjs +2 -0
- package/dist/{action-submit-BQdkz4mS.mjs.map → action-submit-BHY2dndL.mjs.map} +1 -1
- package/dist/action-submit-tpgKvZ47.cjs +2 -0
- package/dist/{action-submit-B9vHpLoN.cjs.map → action-submit-tpgKvZ47.cjs.map} +1 -1
- package/dist/actions-form-PByL8_M5.mjs +2 -0
- package/dist/{actions-form-D4n1W3-X.mjs.map → actions-form-PByL8_M5.mjs.map} +1 -1
- package/dist/actions-form-X46W7FVa.cjs +2 -0
- package/dist/{actions-form-DF2eYxGQ.cjs.map → actions-form-X46W7FVa.cjs.map} +1 -1
- package/dist/{button-BnoPktln.d.cts → button-BGW-LZ3i.d.cts} +2 -2
- package/dist/{button-BnoPktln.d.mts → button-BGW-LZ3i.d.mts} +2 -2
- package/dist/{calendar-BkV5hTX2.d.mts → calendar-BNTvKnwd.d.cts} +2 -2
- package/dist/{calendar-iDMPT1kI.d.cts → calendar-DbaIaWr0.d.mts} +2 -2
- package/dist/{carousel-D7VXWJ3S.d.mts → carousel-Bw-VhPR3.d.mts} +2 -2
- package/dist/{carousel-bBvM31sh.d.cts → carousel-DRqMTyKS.d.cts} +2 -2
- package/dist/checkbox-field-BG35eKvM.cjs +2 -0
- package/dist/{checkbox-field-ldZRSCca.cjs.map → checkbox-field-BG35eKvM.cjs.map} +1 -1
- package/dist/checkbox-field-C-NyMjEm.mjs +2 -0
- package/dist/{checkbox-field-BRGTLOjq.mjs.map → checkbox-field-C-NyMjEm.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-Cx0A-CD4.mjs +2 -0
- package/dist/{combobox-field-CvkdZkQE.mjs.map → combobox-field-Cx0A-CD4.mjs.map} +1 -1
- package/dist/combobox-field-ROYquFD8.cjs +2 -0
- package/dist/{combobox-field-ZYr7636s.cjs.map → combobox-field-ROYquFD8.cjs.map} +1 -1
- package/dist/data-display/country.cjs +1 -1
- package/dist/date-field-46UtGmEV.cjs +2 -0
- package/dist/{date-field-1Hmcv8Zp.cjs.map → date-field-46UtGmEV.cjs.map} +1 -1
- package/dist/date-field-zoPch5tC.mjs +2 -0
- package/dist/{date-field-DGMTG_hu.mjs.map → date-field-zoPch5tC.mjs.map} +1 -1
- package/dist/dialog-form-BRV1niqF.mjs +2 -0
- package/dist/{dialog-form-BRSZpRTC.mjs.map → dialog-form-BRV1niqF.mjs.map} +1 -1
- package/dist/dialog-form-X9MxC8pq.cjs +2 -0
- package/dist/{dialog-form-C1qpltYx.cjs.map → dialog-form-X9MxC8pq.cjs.map} +1 -1
- package/dist/dialogs/detail-dialog/components/sidebar.d.cts +1 -1
- package/dist/dialogs/detail-dialog/components/sidebar.d.mts +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-0UjeYtnM.cjs +2 -0
- package/dist/{email-field-D3nSkHj2.cjs.map → email-field-0UjeYtnM.cjs.map} +1 -1
- package/dist/email-field-CPEVNvn8.mjs +2 -0
- package/dist/{email-field-C2Lvl_rQ.mjs.map → email-field-CPEVNvn8.mjs.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-D7IE_cdR.d.cts} +4 -4
- package/dist/{flex-C63_IqSY.d.mts → flex-D7IE_cdR.d.mts} +4 -4
- package/dist/group-field-Cs0uWHg0.mjs +2 -0
- package/dist/{group-field-gejvx_Td.mjs.map → group-field-Cs0uWHg0.mjs.map} +1 -1
- package/dist/group-field-DJXL9sRy.cjs +2 -0
- package/dist/{group-field-sVykO2JZ.cjs.map → group-field-DJXL9sRy.cjs.map} +1 -1
- package/dist/{index-DvC1inRy.d.cts → index-0HuXxgjQ.d.cts} +13 -10
- package/dist/{index-DvC1inRy.d.mts → index-CZ_2KVir.d.mts} +13 -10
- package/dist/{index-DRAyYm8g.d.cts → index-CvFEJoon.d.cts} +12 -3
- package/dist/{index-DRAyYm8g.d.mts → index-CvFEJoon.d.mts} +12 -3
- package/dist/{index-CrkOhm--.d.mts → index-DJY2uC2H.d.mts} +12 -12
- package/dist/{index--wNkNzCB.d.cts → index-UZik7mgS.d.cts} +12 -12
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +12 -12
- package/dist/index.d.mts +12 -12
- package/dist/index.mjs +1 -1
- package/dist/{input-DxNK7Wo6.d.cts → input-D73TrUof.d.cts} +2 -2
- package/dist/{input-DxNK7Wo6.d.mts → input-D73TrUof.d.mts} +2 -2
- 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-CMskIrWP.cjs +2 -0
- package/dist/{number-field-CWDYA3La.cjs.map → number-field-CMskIrWP.cjs.map} +1 -1
- package/dist/number-field-DSGwWg7y.mjs +2 -0
- package/dist/{number-field-CR5PLX6H.mjs.map → number-field-DSGwWg7y.mjs.map} +1 -1
- package/dist/{pagination-BRw-yZBY.d.cts → pagination-DDcO-TPf.d.cts} +2 -2
- package/dist/{pagination-BlLiOvY9.d.mts → pagination-DWg3Xv34.d.mts} +2 -2
- package/dist/{paragraph-CRo5eC7H.d.mts → paragraph--8GcgnQL.d.cts} +3 -3
- package/dist/{paragraph-CkCNIsvz.d.cts → paragraph-BOa0VlGX.d.mts} +3 -3
- package/dist/password-field-BxJqTPhN.cjs +2 -0
- package/dist/{password-field-BHRhVyZ0.cjs.map → password-field-BxJqTPhN.cjs.map} +1 -1
- package/dist/password-field-DsmwNZep.mjs +2 -0
- package/dist/{password-field-B2_kzss6.mjs.map → password-field-DsmwNZep.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-BUc5ivCF.mjs +2 -0
- package/dist/{popover-form-CeRVpy1B.mjs.map → popover-form-BUc5ivCF.mjs.map} +1 -1
- package/dist/popover-form-CdXVFl0t.cjs +2 -0
- package/dist/{popover-form-Ch_iMMSm.cjs.map → popover-form-CdXVFl0t.cjs.map} +1 -1
- package/dist/radio-group-field-CmCo87tm.mjs +2 -0
- package/dist/{radio-group-field-Iwo2Q2Ig.mjs.map → radio-group-field-CmCo87tm.mjs.map} +1 -1
- package/dist/radio-group-field-gHNAwrdr.cjs +2 -0
- package/dist/{radio-group-field-BFhBfzoT.cjs.map → radio-group-field-gHNAwrdr.cjs.map} +1 -1
- package/dist/{resizable-CNqPu4Ck.d.cts → resizable-C6JLqxF3.d.cts} +2 -2
- package/dist/{resizable-CNqPu4Ck.d.mts → resizable-C6JLqxF3.d.mts} +2 -2
- package/dist/rolldown-runtime-DWNI8pZO.cjs +1 -0
- package/dist/{search-input-C8feOKe2.d.cts → search-input-DEvYI6Rm.d.mts} +2 -2
- package/dist/{search-input-CoqwakbI.d.mts → search-input-h_3MoMqK.d.cts} +2 -2
- package/dist/select-field-8PfksL_U.mjs +2 -0
- package/dist/{select-field-NJgDDCO2.mjs.map → select-field-8PfksL_U.mjs.map} +1 -1
- package/dist/select-field-Ce53hZ3J.cjs +2 -0
- package/dist/{select-field-CvDBZQTl.cjs.map → select-field-Ce53hZ3J.cjs.map} +1 -1
- package/dist/simple-array-field-BAR4MjDR.cjs +2 -0
- package/dist/{simple-array-field-aGXkDZXD.cjs.map → simple-array-field-BAR4MjDR.cjs.map} +1 -1
- package/dist/simple-array-field-C0kpO1cq.mjs +2 -0
- package/dist/{simple-array-field-BwNCeUnn.mjs.map → simple-array-field-C0kpO1cq.mjs.map} +1 -1
- package/dist/simple-boolean-field-36jmOxCR.cjs +2 -0
- package/dist/{simple-boolean-field-BeVkn3c4.cjs.map → simple-boolean-field-36jmOxCR.cjs.map} +1 -1
- package/dist/simple-boolean-field-Bdc4wuUU.mjs +2 -0
- package/dist/{simple-boolean-field-t_XDXqYs.mjs.map → simple-boolean-field-Bdc4wuUU.mjs.map} +1 -1
- package/dist/simple-combobox-field-BPDtPj1W.cjs +2 -0
- package/dist/{simple-combobox-field-U0ZAl7VQ.cjs.map → simple-combobox-field-BPDtPj1W.cjs.map} +1 -1
- package/dist/simple-combobox-field-CR5Q6Nsd.mjs +2 -0
- package/dist/{simple-combobox-field-HCB4A33-.mjs.map → simple-combobox-field-CR5Q6Nsd.mjs.map} +1 -1
- package/dist/simple-date-field-DUPnGa5d.cjs +2 -0
- package/dist/{simple-date-field-DtxEpEZj.cjs.map → simple-date-field-DUPnGa5d.cjs.map} +1 -1
- package/dist/simple-date-field-DkhG2o7I.mjs +2 -0
- package/dist/{simple-date-field-Dj4bJoji.mjs.map → simple-date-field-DkhG2o7I.mjs.map} +1 -1
- package/dist/simple-email-field-BTYqiFp8.cjs +2 -0
- package/dist/{simple-email-field-DK9I_Tc_.cjs.map → simple-email-field-BTYqiFp8.cjs.map} +1 -1
- package/dist/simple-email-field-CpxklyKr.mjs +2 -0
- package/dist/{simple-email-field-BDyhkmHV.mjs.map → simple-email-field-CpxklyKr.mjs.map} +1 -1
- package/dist/simple-number-field-CTFyTMgw.cjs +2 -0
- package/dist/{simple-number-field-BspqWU-3.cjs.map → simple-number-field-CTFyTMgw.cjs.map} +1 -1
- package/dist/simple-number-field-DuCvwUG9.mjs +2 -0
- package/dist/{simple-number-field-hneXMhfJ.mjs.map → simple-number-field-DuCvwUG9.mjs.map} +1 -1
- package/dist/simple-password-field-BaeUvVB1.cjs +2 -0
- package/dist/{simple-password-field-BEEcleom.cjs.map → simple-password-field-BaeUvVB1.cjs.map} +1 -1
- package/dist/simple-password-field-Cu_JvDEE.mjs +2 -0
- package/dist/{simple-password-field-vsLRHDk4.mjs.map → simple-password-field-Cu_JvDEE.mjs.map} +1 -1
- package/dist/simple-radio-group-field-DiU4eQ_c.cjs +2 -0
- package/dist/{simple-radio-group-field-Wm8xB0fN.cjs.map → simple-radio-group-field-DiU4eQ_c.cjs.map} +1 -1
- package/dist/simple-radio-group-field-RJ_cEsxK.mjs +2 -0
- package/dist/{simple-radio-group-field-BURm_BSA.mjs.map → simple-radio-group-field-RJ_cEsxK.mjs.map} +1 -1
- package/dist/simple-select-field-B3uEUqvQ.mjs +2 -0
- package/dist/{simple-select-field-8cY51U4d.mjs.map → simple-select-field-B3uEUqvQ.mjs.map} +1 -1
- package/dist/simple-select-field-C8vmeHbL.cjs +2 -0
- package/dist/{simple-select-field-QQ65caBf.cjs.map → simple-select-field-C8vmeHbL.cjs.map} +1 -1
- package/dist/simple-text-field-BEoQmd1b.mjs +2 -0
- package/dist/{simple-text-field-DK72_OA_.mjs.map → simple-text-field-BEoQmd1b.mjs.map} +1 -1
- package/dist/simple-text-field-zFJt_99J.cjs +2 -0
- package/dist/{simple-text-field-BHkCPiE5.cjs.map → simple-text-field-zFJt_99J.cjs.map} +1 -1
- package/dist/simple-textarea-field-CzpApMiv.mjs +2 -0
- package/dist/{simple-textarea-field-B72nNQHv.mjs.map → simple-textarea-field-CzpApMiv.mjs.map} +1 -1
- package/dist/simple-textarea-field-DyQZEDTe.cjs +2 -0
- package/dist/{simple-textarea-field-Bu5h7sfH.cjs.map → simple-textarea-field-DyQZEDTe.cjs.map} +1 -1
- package/dist/switch-field-CsI6eXJu.cjs +2 -0
- package/dist/{switch-field-eLVlQZSI.cjs.map → switch-field-CsI6eXJu.cjs.map} +1 -1
- package/dist/switch-field-D2SWDM1l.mjs +2 -0
- package/dist/{switch-field-DoPUWb9d.mjs.map → switch-field-D2SWDM1l.mjs.map} +1 -1
- package/dist/tanstack-form-BiOihtxs.cjs +2 -0
- package/dist/tanstack-form-BiOihtxs.cjs.map +1 -0
- package/dist/tanstack-form-Do6xL2kv.mjs +2 -0
- package/dist/tanstack-form-Do6xL2kv.mjs.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-D9CYYDKM.cjs +2 -0
- package/dist/{text-field-DT50dOVI.cjs.map → text-field-D9CYYDKM.cjs.map} +1 -1
- package/dist/text-field-wes_PQEd.mjs +2 -0
- package/dist/{text-field-Bm-k6Jr7.mjs.map → text-field-wes_PQEd.mjs.map} +1 -1
- package/dist/textarea-field-BiNmDHgL.mjs +2 -0
- package/dist/{textarea-field-DNLyrRH7.mjs.map → textarea-field-BiNmDHgL.mjs.map} +1 -1
- package/dist/textarea-field-CRf0M2Eb.cjs +2 -0
- package/dist/{textarea-field-BhqX29CS.cjs.map → textarea-field-CRf0M2Eb.cjs.map} +1 -1
- package/dist/title-field-B9LLoqIi.cjs +2 -0
- package/dist/{title-field-B2hM3S_S.cjs.map → title-field-B9LLoqIi.cjs.map} +1 -1
- package/dist/title-field-C4BmSDR2.mjs +2 -0
- package/dist/{title-field-oAqHRw59.mjs.map → title-field-C4BmSDR2.mjs.map} +1 -1
- package/dist/typography/paragraph.d.cts +1 -1
- package/dist/typography/paragraph.d.mts +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/button.d.cts +1 -1
- package/dist/ui/button.d.mts +1 -1
- package/dist/ui/calendar.d.cts +1 -1
- package/dist/ui/calendar.d.mts +1 -1
- package/dist/ui/carousel.cjs +1 -1
- package/dist/ui/carousel.d.cts +1 -1
- package/dist/ui/carousel.d.mts +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/input.d.cts +1 -1
- package/dist/ui/input.d.mts +1 -1
- package/dist/ui/inputs/search-input.d.cts +1 -1
- package/dist/ui/inputs/search-input.d.mts +1 -1
- package/dist/ui/item.cjs +1 -1
- package/dist/ui/pagination.d.cts +1 -1
- package/dist/ui/pagination.d.mts +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 +7 -2
- package/styles/text-editor.css +205 -38
- 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/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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch-field-
|
|
1
|
+
{"version":3,"file":"switch-field-CsI6eXJu.cjs","names":["SwitchPrimitive","useTanStackFieldContext","FieldGroup","Field","FieldContent","FieldTitle","FieldDescription","FieldNote","FieldSeparator"],"sources":["../packages/components/features/tanstack-form/components/ui/switch.tsx","../packages/components/features/tanstack-form/components/fields/switch-field.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Switch as SwitchPrimitive } from 'radix-ui';\n\n/**\n * Accessible toggle switch built on Radix UI, styled with primary-color checked state and smooth thumb transition.\n *\n * @example\n * import { Switch } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <Switch defaultChecked onCheckedChange={(checked) => console.log(checked)} />\n */\nfunction Switch({ className, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root>) {\n return (\n <SwitchPrimitive.Root\n data-slot=\"switch\"\n className={cn(\n 'peer',\n 'w-8 shrink-0 cursor-pointer items-center rounded-full shadow-xs transition-all',\n 'inline-flex h-5',\n 'focus-visible:border-primary-strong',\n 'focus-visible:ring-primary-weak',\n 'focus-visible:ring-4',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n\n '-outline-offset-1 inset-shadow-2xs outline-1',\n\n 'data-[state=checked]:bg-primary',\n 'data-[state=checked]:outline-primary-strong',\n\n 'data-[state=unchecked]:bg-muted-weak',\n 'data-[state=unchecked]:outline-border',\n\n 'data-[state=unchecked]:[&_span]:size-4',\n 'data-[state=unchecked]:[&_span]:translate-x-0.5',\n 'data-[state=unchecked]:[&_span]:rtl:-translate-x-0.5',\n className\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n data-slot=\"switch-thumb\"\n className={cn(\n 'block size-4 bg-card shadow-xs',\n 'pointer-events-none rounded-full ring-0 transition-transform',\n 'data-[state=checked]:translate-x-[calc(100%-3px)]',\n 'data-[state=unchecked]:translate-x-0'\n )}\n />\n </SwitchPrimitive.Root>\n );\n}\n\nexport { Switch };\n","'use client';\n\nimport { useTanStackFieldContext } from '../form-context';\nimport { Field, FieldContent, FieldDescription, FieldGroup, FieldNote, FieldSeparator, FieldTitle } from '../ui/field';\nimport { Switch } from '../ui/switch';\n\nimport type { SwitchFieldProps as Props } from '../../types';\n\n/**\n * A TanStack Form-connected boolean toggle field rendered as a labelled switch,\n * positioned absolutely in the top-right corner of the field card.\n *\n * @example\n * import { SwitchField } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <form.Field name=\"notifications\">\n * {() => (\n * <SwitchField\n * label=\"Enable notifications\"\n * description=\"Receive email alerts for important events\"\n * helperText=\"You can change this at any time\"\n * />\n * )}\n * </form.Field>\n */\nexport const SwitchField: React.FC<Props> = ({ label, description, helperText }) => {\n const field = useTanStackFieldContext<boolean | null>();\n\n return (\n <FieldGroup className=\"gap-y-4 px-4\">\n <Field orientation=\"vertical\" className=\"relative justify-between gap-y-1\">\n <FieldContent>\n <FieldTitle className=\"cursor-pointer\">\n <label htmlFor={field.name}>{label}</label>\n </FieldTitle>\n <FieldDescription>{description}</FieldDescription>\n <Switch\n id={field.name}\n checked={field.state.value ?? false}\n className=\"absolute top-1 right-1\"\n onBlur={field.handleBlur}\n onCheckedChange={field.handleChange}\n />\n </FieldContent>\n <FieldNote isShow={!!helperText}>{helperText}</FieldNote>\n </Field>\n <FieldSeparator />\n </FieldGroup>\n );\n};\n"],"mappings":"qJAcA,SAAS,EAAO,CAAE,YAAW,GAAG,GAA4D,CAC1F,OACE,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAgB,KAAjB,CACE,YAAU,SACV,WAAA,EAAA,EAAA,GAAA,CACE,OACA,iFACA,kBACA,sCACA,kCACA,uBACA,8BACA,sBAEA,+CAEA,kCACA,8CAEA,uCACA,wCAEA,yCACA,kDACA,uDACA,CACF,EACA,GAAI,EAEJ,UAAA,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAgB,MAAjB,CACE,YAAU,eACV,WAAA,EAAA,EAAA,GAAA,CACE,iCACA,+DACA,oDACA,sCACF,CACD,CAAA,CACmB,CAAA,CAE1B,CC7BA,MAAa,GAAgC,CAAE,QAAO,cAAa,gBAAiB,CAClF,IAAM,EAAQC,EAAAA,GAAwC,EAEtD,OACE,EAAA,EAAA,KAAA,CAACC,EAAAA,EAAD,CAAY,UAAU,eAAtB,SAAA,EACE,EAAA,EAAA,KAAA,CAACC,EAAAA,EAAD,CAAO,YAAY,WAAW,UAAU,mCAAxC,SAAA,EACE,EAAA,EAAA,KAAA,CAACC,EAAAA,EAAD,CAAA,SAAA,EACE,EAAA,EAAA,IAAA,CAACC,EAAAA,GAAD,CAAY,UAAU,iBACpB,UAAA,EAAA,EAAA,IAAA,CAAC,QAAD,CAAO,QAAS,EAAM,KAAO,SAAA,CAAa,CAAA,CAChC,CAAA,GACZ,EAAA,EAAA,IAAA,CAACC,EAAAA,EAAD,CAAA,SAAmB,CAA8B,CAAA,GACjD,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,GAAI,EAAM,KACV,QAAS,EAAM,MAAM,OAAS,GAC9B,UAAU,yBACV,OAAQ,EAAM,WACd,gBAAiB,EAAM,YACxB,CAAA,CACW,CAAA,CAAA,GACd,EAAA,EAAA,IAAA,CAACC,EAAAA,EAAD,CAAW,OAAQ,CAAC,CAAC,EAAa,SAAA,CAAsB,CAAA,CACnD,CACP,CAAA,GAAA,EAAA,EAAA,IAAA,CAACC,EAAAA,GAAD,CAAiB,CAAA,CACP,GAEhB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{$ as e,G as t,J as n,K as r,X as i,et as a,rt as o,tt as s}from"./tanstack-form-Do6xL2kv.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=o();return u(i,{className:`gap-y-4 px-4`,children:[u(t,{orientation:`vertical`,className:`relative justify-between gap-y-1`,children:[u(r,{children:[l(s,{className:`cursor-pointer`,children:l(`label`,{htmlFor:m.name,children:c})}),l(n,{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(e,{isShow:!!p,children:p})]}),l(a,{})]})};export{p as SwitchField};
|
|
2
|
+
//# sourceMappingURL=switch-field-D2SWDM1l.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch-field-
|
|
1
|
+
{"version":3,"file":"switch-field-D2SWDM1l.mjs","names":["Switch","SwitchPrimitive","Switch"],"sources":["../packages/components/features/tanstack-form/components/ui/switch.tsx","../packages/components/features/tanstack-form/components/fields/switch-field.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Switch as SwitchPrimitive } from 'radix-ui';\n\n/**\n * Accessible toggle switch built on Radix UI, styled with primary-color checked state and smooth thumb transition.\n *\n * @example\n * import { Switch } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <Switch defaultChecked onCheckedChange={(checked) => console.log(checked)} />\n */\nfunction Switch({ className, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root>) {\n return (\n <SwitchPrimitive.Root\n data-slot=\"switch\"\n className={cn(\n 'peer',\n 'w-8 shrink-0 cursor-pointer items-center rounded-full shadow-xs transition-all',\n 'inline-flex h-5',\n 'focus-visible:border-primary-strong',\n 'focus-visible:ring-primary-weak',\n 'focus-visible:ring-4',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n\n '-outline-offset-1 inset-shadow-2xs outline-1',\n\n 'data-[state=checked]:bg-primary',\n 'data-[state=checked]:outline-primary-strong',\n\n 'data-[state=unchecked]:bg-muted-weak',\n 'data-[state=unchecked]:outline-border',\n\n 'data-[state=unchecked]:[&_span]:size-4',\n 'data-[state=unchecked]:[&_span]:translate-x-0.5',\n 'data-[state=unchecked]:[&_span]:rtl:-translate-x-0.5',\n className\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n data-slot=\"switch-thumb\"\n className={cn(\n 'block size-4 bg-card shadow-xs',\n 'pointer-events-none rounded-full ring-0 transition-transform',\n 'data-[state=checked]:translate-x-[calc(100%-3px)]',\n 'data-[state=unchecked]:translate-x-0'\n )}\n />\n </SwitchPrimitive.Root>\n );\n}\n\nexport { Switch };\n","'use client';\n\nimport { useTanStackFieldContext } from '../form-context';\nimport { Field, FieldContent, FieldDescription, FieldGroup, FieldNote, FieldSeparator, FieldTitle } from '../ui/field';\nimport { Switch } from '../ui/switch';\n\nimport type { SwitchFieldProps as Props } from '../../types';\n\n/**\n * A TanStack Form-connected boolean toggle field rendered as a labelled switch,\n * positioned absolutely in the top-right corner of the field card.\n *\n * @example\n * import { SwitchField } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <form.Field name=\"notifications\">\n * {() => (\n * <SwitchField\n * label=\"Enable notifications\"\n * description=\"Receive email alerts for important events\"\n * helperText=\"You can change this at any time\"\n * />\n * )}\n * </form.Field>\n */\nexport const SwitchField: React.FC<Props> = ({ label, description, helperText }) => {\n const field = useTanStackFieldContext<boolean | null>();\n\n return (\n <FieldGroup className=\"gap-y-4 px-4\">\n <Field orientation=\"vertical\" className=\"relative justify-between gap-y-1\">\n <FieldContent>\n <FieldTitle className=\"cursor-pointer\">\n <label htmlFor={field.name}>{label}</label>\n </FieldTitle>\n <FieldDescription>{description}</FieldDescription>\n <Switch\n id={field.name}\n checked={field.state.value ?? false}\n className=\"absolute top-1 right-1\"\n onBlur={field.handleBlur}\n onCheckedChange={field.handleChange}\n />\n </FieldContent>\n <FieldNote isShow={!!helperText}>{helperText}</FieldNote>\n </Field>\n <FieldSeparator />\n </FieldGroup>\n );\n};\n"],"mappings":"6OAcA,SAASA,EAAO,CAAE,YAAW,GAAG,GAA4D,CAC1F,OACE,EAACC,EAAgB,KAAjB,CACE,YAAU,SACV,UAAW,EACT,OACA,iFACA,kBACA,sCACA,kCACA,uBACA,8BACA,sBAEA,+CAEA,kCACA,8CAEA,uCACA,wCAEA,yCACA,kDACA,uDACA,CACF,EACA,GAAI,EAEJ,SAAA,EAACA,EAAgB,MAAjB,CACE,YAAU,eACV,UAAW,EACT,iCACA,+DACA,oDACA,sCACF,CACD,CAAA,CACmB,CAAA,CAE1B,CC7BA,MAAa,GAAgC,CAAE,QAAO,cAAa,gBAAiB,CAClF,IAAM,EAAQ,EAAwC,EAEtD,OACE,EAAC,EAAD,CAAY,UAAU,eAAtB,SAAA,CACE,EAAC,EAAD,CAAO,YAAY,WAAW,UAAU,mCAAxC,SAAA,CACE,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAY,UAAU,iBACpB,SAAA,EAAC,QAAD,CAAO,QAAS,EAAM,KAAO,SAAA,CAAa,CAAA,CAChC,CAAA,EACZ,EAAC,EAAD,CAAA,SAAmB,CAA8B,CAAA,EACjD,EAACC,EAAD,CACE,GAAI,EAAM,KACV,QAAS,EAAM,MAAM,OAAS,GAC9B,UAAU,yBACV,OAAQ,EAAM,WACd,gBAAiB,EAAM,YACxB,CAAA,CACW,CAAA,CAAA,EACd,EAAC,EAAD,CAAW,OAAQ,CAAC,CAAC,EAAa,SAAA,CAAsB,CAAA,CACnD,CACP,CAAA,EAAA,EAAC,EAAD,CAAiB,CAAA,CACP,GAEhB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-DWNI8pZO.cjs"),t=require("./ui/skeleton.cjs"),n=require("./ui/tooltip.cjs"),r=require("./text-editor-DWZf3yrW.cjs"),i=require("./ui/separator.cjs");let a=require("lucide-react"),o=require("react"),s=require("@customafk/react-toolkit/utils"),c=require("class-variance-authority"),l=require("react/jsx-runtime"),u=require("radix-ui"),d=require("@tanstack/react-form");const{fieldContext:f,formContext:p,useFieldContext:m,useFormContext:h}=(0,d.createFormHookContexts)();function g({className:e,children:t,...n}){return(0,l.jsxs)(u.Label.Root,{"data-slot":`label`,className:(0,s.cn)(`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:[(0,l.jsx)(`span`,{className:`flex items-center gap-1`,children:t}),(0,l.jsx)(`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`})]})}var _=e.t({Field:()=>S,FieldContent:()=>C,FieldContentMain:()=>w,FieldDescription:()=>D,FieldError:()=>j,FieldGroup:()=>x,FieldLabel:()=>T,FieldLegend:()=>b,FieldNote:()=>O,FieldSeparator:()=>A,FieldSet:()=>y,FieldTitle:()=>E,FieldTooltip:()=>k});const v=(0,c.cva)(`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`}}),y=(0,o.memo)(({className:e,...t})=>(0,l.jsx)(`fieldset`,{"data-slot":`field-set`,className:(0,s.cn)(`flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t}));y.displayName=`FieldSet`;const b=(0,o.memo)(({className:e,variant:t=`legend`,...n})=>(0,l.jsx)(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:(0,s.cn)(`mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,e),...n}));b.displayName=`FieldLegend`;const x=(0,o.memo)(({className:e,...t})=>(0,l.jsx)(`div`,{"data-slot":`field-group`,className:(0,s.cn)(`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}));x.displayName=`FieldGroup`;const S=(0,o.memo)(({className:e,orientation:t=`vertical`,...n})=>(0,l.jsx)(`div`,{"data-slot":`field`,"data-orientation":t,className:(0,s.cn)(v({orientation:t}),e),...n}));S.displayName=`Field`;const C=(0,o.memo)(({className:e,...t})=>(0,l.jsx)(`div`,{"data-slot":`field-content`,className:(0,s.cn)(`group/field-content flex flex-col gap-1.5 leading-snug`,e),...t}));C.displayName=`FieldContent`;const w=(0,o.memo)(({className:e,...t})=>(0,l.jsx)(`div`,{"data-slot":`field-content-main`,className:(0,s.cn)(`relative`,e),...t}));w.displayName=`FieldContentMain`;const T=(0,o.memo)(({className:e,...t})=>(0,l.jsx)(g,{"data-slot":`field-label`,className:(0,s.cn)(`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}));T.displayName=`FieldLabel`;const E=(0,o.memo)(({className:e,...t})=>(0,l.jsx)(`div`,{"data-slot":`field-label`,className:(0,s.cn)(`flex w-fit items-center gap-2 font-medium text-sm leading-snug group-data-[disabled=true]/field:opacity-50`,e),...t}));E.displayName=`FieldTitle`;const D=(0,o.memo)(({className:e,...t})=>(0,l.jsx)(`p`,{"data-slot":`field-description`,className:(0,s.cn)(`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}));D.displayName=`FieldDescription`;const O=(0,o.memo)(({isShow:e=!0,className:t,children:n,...r})=>e===!1?null:(0,l.jsxs)(`div`,{"data-slot":`field-note`,className:(0,s.cn)(`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:[(0,l.jsx)(a.InfoIcon,{size:12,className:`mt-0.5 shrink-0 text-primary/70`}),(0,l.jsx)(`span`,{children:n})]}));O.displayName=`FieldNote`;const k=(0,o.memo)(({tooltip:e})=>(0,l.jsxs)(n.Tooltip,{children:[(0,l.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,l.jsxs)(`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:[(0,l.jsx)(a.HelpCircleIcon,{size:13,"aria-hidden":`true`}),(0,l.jsx)(`span`,{className:`sr-only`,children:`Thêm thông tin`})]})}),(0,l.jsx)(n.TooltipContent,{side:`top`,className:`max-w-xs text-balance`,children:e})]}));k.displayName=`FieldTooltip`;const A=(0,o.memo)(({children:e,className:t,...n})=>(0,l.jsxs)(`div`,{"data-slot":`field-separator`,"data-content":!!e,className:(0,s.cn)(`relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2`,t),...n,children:[(0,l.jsx)(i.Separator,{className:`absolute inset-0 top-1/2`}),e&&(0,l.jsx)(`span`,{className:`relative mx-auto block w-fit bg-background px-2 text-text-positive-weak`,"data-slot":`field-separator-content`,children:e})]}));A.displayName=`FieldSeparator`;const j=(0,o.memo)(({className:e,children:t,errors:n,requiredMessage:r=`Trường này là bắt buộc`,...i})=>{let a=(0,o.useMemo)(()=>{let e=e=>e.code===`invalid_type`?r:e.message;return t||(n?n?.length===1&&n[0]?.message?(0,l.jsx)(`div`,{className:`flex flex-row items-center justify-start gap-x-0.5`,children:(0,l.jsx)(`p`,{children:e(n[0])})}):(0,l.jsx)(`ul`,{className:`flex list-none flex-col`,children:n.map(t=>typeof t==`string`?(0,l.jsx)(`li`,{children:t},t):t?.message?(0,l.jsx)(`li`,{children:e(t)},t.code??t.message):null)}):null)},[t,n,r]);return a?(0,l.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:(0,s.cn)(`w-full font-medium text-danger-strong text-xs`,e),...i,children:a}):null});j.displayName=`FieldError`;const M=(0,o.memo)(({label:e,description:t,placeholder:n,tooltip:i,helperText:a,showErrorMessage:s=!0,required:c=!1,maxLength:u,showCharacterCount:f,enableLink:p,enableBubbleMenu:h,enableTaskList:g,enableHighlight:_,enableColor:v,enableImage:y,enableTable:b,enableSlashCommand:w,onImageUpload:E,variant:M,size:N})=>{let{form:P,state:F,handleChange:I}=m(),L=(0,d.useStore)(P.store,({isSubmitting:e})=>e),R=F.meta.isDirty&&F.meta.isTouched&&!F.meta.isValid,z=c&&F.value===null,B=(0,o.useCallback)(e=>{L||I(e||null)},[L,I]);return(0,l.jsxs)(x,{className:`gap-y-4 px-4`,children:[(0,l.jsxs)(S,{orientation:`vertical`,"data-invalid":R,children:[(0,l.jsxs)(C,{children:[(0,l.jsxs)(T,{"aria-required":z,children:[e,i&&(0,l.jsx)(k,{tooltip:i})]}),(0,l.jsx)(D,{children:t})]}),(0,l.jsx)(r.t,{value:F.value??``,placeholder:n,readOnly:L,onChange:B,maxLength:u,showCharacterCount:f,enableLink:p,enableBubbleMenu:h,enableTaskList:g,enableHighlight:_,enableColor:v,enableImage:y,enableTable:b,enableSlashCommand:w,onImageUpload:E,variant:M,size:N}),F.meta.isDirty&&s&&!!F.meta.errors.length&&(0,l.jsx)(j,{errors:F.meta.errors}),(0,l.jsx)(O,{isShow:!!a,children:a})]}),(0,l.jsx)(A,{})]})});M.displayName=`TextEditorField`;function N(){return(0,l.jsx)(t.Skeleton,{"data-slot":`tanstack-field-skeleton`,className:`h-9 w-full rounded`})}function P(e){let t=(0,o.lazy)(e);return e=>(0,l.jsx)(o.Suspense,{fallback:(0,l.jsx)(N,{}),children:(0,l.jsx)(t,{...e})})}const F=P(()=>Promise.resolve().then(()=>require("./text-field-D9CYYDKM.cjs")).then(e=>({default:e.TextField}))),I=P(()=>Promise.resolve().then(()=>require("./textarea-field-CRf0M2Eb.cjs")).then(e=>({default:e.TextareaField}))),L=P(()=>Promise.resolve().then(()=>require("./number-field-CMskIrWP.cjs")).then(e=>({default:e.NumberField}))),R=P(()=>Promise.resolve().then(()=>require("./email-field-0UjeYtnM.cjs")).then(e=>({default:e.EmailField}))),z=P(()=>Promise.resolve().then(()=>require("./password-field-BxJqTPhN.cjs")).then(e=>({default:e.PasswordField}))),B=P(()=>Promise.resolve().then(()=>require("./select-field-Ce53hZ3J.cjs")).then(e=>({default:e.SelectField}))),V=P(()=>Promise.resolve().then(()=>require("./combobox-field-ROYquFD8.cjs")).then(e=>({default:e.ComboboxField}))),H=P(()=>Promise.resolve().then(()=>require("./date-field-46UtGmEV.cjs")).then(e=>({default:e.DateField}))),U=P(()=>Promise.resolve().then(()=>require("./switch-field-CsI6eXJu.cjs")).then(e=>({default:e.SwitchField}))),W=P(()=>Promise.resolve().then(()=>require("./radio-group-field-gHNAwrdr.cjs")).then(e=>({default:e.RadioGroupField}))),G=P(()=>Promise.resolve().then(()=>require("./checkbox-field-BG35eKvM.cjs")).then(e=>({default:e.CheckboxField}))),K=P(()=>Promise.resolve().then(()=>require("./simple-text-field-zFJt_99J.cjs")).then(e=>({default:e.SimpleTextField}))),q=P(()=>Promise.resolve().then(()=>require("./simple-email-field-BTYqiFp8.cjs")).then(e=>({default:e.SimpleEmailField}))),J=P(()=>Promise.resolve().then(()=>require("./simple-password-field-BaeUvVB1.cjs")).then(e=>({default:e.SimplePasswordField}))),Y=P(()=>Promise.resolve().then(()=>require("./simple-textarea-field-DyQZEDTe.cjs")).then(e=>({default:e.SimpleTextareaField}))),X=P(()=>Promise.resolve().then(()=>require("./simple-number-field-CTFyTMgw.cjs")).then(e=>({default:e.SimpleNumberField}))),Z=P(()=>Promise.resolve().then(()=>require("./simple-select-field-C8vmeHbL.cjs")).then(e=>({default:e.SimpleSelectField}))),ee=(0,o.lazy)(()=>Promise.resolve().then(()=>require("./simple-array-field-BAR4MjDR.cjs")).then(e=>({default:e.SimpleArrayField})));function Q(e){return(0,l.jsx)(o.Suspense,{fallback:(0,l.jsx)(N,{}),children:(0,l.jsx)(ee,{...e})})}const te=P(()=>Promise.resolve().then(()=>require("./simple-boolean-field-36jmOxCR.cjs")).then(e=>({default:e.SimpleBooleanField}))),$=P(()=>Promise.resolve().then(()=>require("./simple-combobox-field-BPDtPj1W.cjs")).then(e=>({default:e.SimpleComboboxField}))),ne=P(()=>Promise.resolve().then(()=>require("./simple-date-field-DUPnGa5d.cjs")).then(e=>({default:e.SimpleDateField}))),re=P(()=>Promise.resolve().then(()=>require("./simple-radio-group-field-DiU4eQ_c.cjs")).then(e=>({default:e.SimpleRadioGroupField}))),ie=P(()=>Promise.resolve().then(()=>require("./simple-array-field-BAR4MjDR.cjs")).then(e=>({default:e.ArrayCol}))),ae=P(()=>Promise.resolve().then(()=>require("./simple-array-field-BAR4MjDR.cjs")).then(e=>({default:e.ArrayHeaderRow}))),oe=P(()=>Promise.resolve().then(()=>require("./dialog-form-X9MxC8pq.cjs")).then(e=>({default:e.TanStackDialogForm}))),se=P(()=>Promise.resolve().then(()=>require("./popover-form-CdXVFl0t.cjs")).then(e=>({default:e.TanStackPopoverForm}))),ce=P(()=>Promise.resolve().then(()=>require("./container-form-D8QNEn8M.cjs")).then(e=>({default:e.TanStackContainerForm}))),le=P(()=>Promise.resolve().then(()=>require("./section-form-C_pHiBEW.cjs")).then(e=>({default:e.TanStackSectionForm}))),ue=P(()=>Promise.resolve().then(()=>require("./card-form-BR5kDTzB.cjs")).then(e=>({default:e.TanStackCardForm}))),de=P(()=>Promise.resolve().then(()=>require("./group-field-DJXL9sRy.cjs")).then(e=>({default:e.TanStackFieldGroup}))),fe=P(()=>Promise.resolve().then(()=>require("./title-field-B9LLoqIi.cjs")).then(e=>({default:e.TanStackTitleField}))),pe=P(()=>Promise.resolve().then(()=>require("./actions-form-X46W7FVa.cjs")).then(e=>({default:e.TanStackActionsForm}))),me=P(()=>Promise.resolve().then(()=>require("./action-submit-tpgKvZ47.cjs")).then(e=>({default:e.TanStackActionSubmit}))),he=P(()=>Promise.resolve().then(()=>_).then(e=>({default:e.FieldGroup}))),ge=P(()=>Promise.resolve().then(()=>_).then(e=>({default:e.Field}))),_e=P(()=>Promise.resolve().then(()=>_).then(e=>({default:e.FieldContent}))),ve=P(()=>Promise.resolve().then(()=>_).then(e=>({default:e.FieldLabel}))),ye=P(()=>Promise.resolve().then(()=>_).then(e=>({default:e.FieldContentMain}))),be=P(()=>Promise.resolve().then(()=>_).then(e=>({default:e.FieldSeparator}))),xe=P(()=>Promise.resolve().then(()=>_).then(e=>({default:e.FieldError}))),{useAppForm:Se,withForm:Ce,withFieldGroup:we}=(0,d.createFormHook)({fieldContext:f,formContext:p,fieldComponents:{TextField:F,TextareaField:I,TextEditorField:M,NumberField:L,EmailField:R,PasswordField:z,SelectField:B,ComboboxField:V,DateField:H,SwitchField:U,RadioGroupField:W,CheckboxField:G,SimpleTextField:K,SimpleEmailField:q,SimplePasswordField:J,SimpleTextareaField:Y,SimpleNumberField:X,SimpleSelectField:Z,SimpleArrayField:Q,SimpleBooleanField:te,SimpleComboboxField:$,SimpleDateField:ne,SimpleRadioGroupField:re,FieldGroup:he,Field:ge,FieldContent:_e,FieldLabel:ve,FieldContentMain:ye,FieldSeparator:be,FieldError:xe},formComponents:{TanStackDialogForm:oe,TanStackPopoverForm:se,TanStackContainerForm:ce,TanStackSectionForm:le,TanStackCardForm:ue,TanStackFieldGroup:de,TanStackTitleField:fe,TanStackActionsForm:pe,TanStackActionSubmit:me,ArrayCol:ie,ArrayHeaderRow:ae}});Object.defineProperty(exports,"$",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return me}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return de}}),Object.defineProperty(exports,"G",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"H",{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,"J",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"K",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return le}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,"Q",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,"U",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,"W",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"X",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"Y",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"Z",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,"et",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"it",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,"nt",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,"q",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"rt",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,"tt",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return F}});
|
|
2
|
+
//# sourceMappingURL=tanstack-form-BiOihtxs.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tanstack-form-BiOihtxs.cjs","names":["LabelPrimitive","FieldGroup","Field","FieldContent","FieldContentMain","FieldLabel","InfoIcon","Tooltip","TooltipTrigger","HelpCircleIcon","TooltipContent","FieldSeparator","Separator","FieldError","FieldGroup","Field","FieldContent","FieldLabel","TextEditor","FieldError","FieldSeparator","Skeleton","Suspense","Impl"],"sources":["../packages/components/features/tanstack-form/components/form-context.ts","../packages/components/features/tanstack-form/components/ui/label.tsx","../packages/components/features/tanstack-form/components/ui/field.tsx","../packages/components/features/tanstack-form/components/fields/text-editor-field.tsx","../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 { 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","'use client';\n\nimport { memo, useCallback } from 'react';\n\nimport { useStore } from '@tanstack/react-form';\n\nimport { TextEditor } from '@/components/features/text-editor';\n\nimport type { TextEditorFieldProps as Props } from '../../types';\nimport { useTanStackFieldContext } from '../form-context';\nimport { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldNote, FieldSeparator, FieldTooltip } from '../ui/field';\n\nexport const TextEditorField: React.FC<Props> = memo(\n ({\n label,\n description,\n placeholder,\n tooltip,\n helperText,\n showErrorMessage = true,\n required = false,\n maxLength,\n showCharacterCount,\n enableLink,\n enableBubbleMenu,\n enableTaskList,\n enableHighlight,\n enableColor,\n enableImage,\n enableTable,\n enableSlashCommand,\n onImageUpload,\n variant,\n size,\n }) => {\n const { form, state, handleChange } = useTanStackFieldContext<string | null>();\n\n const isSubmitting = useStore(form.store, ({ isSubmitting }) => isSubmitting);\n\n const _invalid = state.meta.isDirty && state.meta.isTouched && !state.meta.isValid;\n const _isEmpty = required && state.value === null;\n\n const onChange = useCallback(\n (html: string) => {\n if (isSubmitting) return;\n handleChange(html || null);\n },\n [isSubmitting, handleChange]\n );\n\n return (\n <FieldGroup className=\"gap-y-4 px-4\">\n <Field orientation=\"vertical\" data-invalid={_invalid}>\n <FieldContent>\n <FieldLabel aria-required={_isEmpty}>\n {label}\n {tooltip && <FieldTooltip tooltip={tooltip} />}\n </FieldLabel>\n <FieldDescription>{description}</FieldDescription>\n </FieldContent>\n <TextEditor\n value={state.value ?? ''}\n placeholder={placeholder}\n readOnly={isSubmitting}\n onChange={onChange}\n maxLength={maxLength}\n showCharacterCount={showCharacterCount}\n enableLink={enableLink}\n enableBubbleMenu={enableBubbleMenu}\n enableTaskList={enableTaskList}\n enableHighlight={enableHighlight}\n enableColor={enableColor}\n enableImage={enableImage}\n enableTable={enableTable}\n enableSlashCommand={enableSlashCommand}\n onImageUpload={onImageUpload}\n variant={variant}\n size={size}\n />\n {state.meta.isDirty && showErrorMessage && !!state.meta.errors.length && <FieldError errors={state.meta.errors} />}\n <FieldNote isShow={!!helperText}>{helperText}</FieldNote>\n </Field>\n <FieldSeparator />\n </FieldGroup>\n );\n }\n);\nTextEditorField.displayName = 'TextEditorField';\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 { TextEditorField } 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 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":"kZASA,KAAa,CAAE,eAAc,cAAa,gBAAiB,EAAyB,eAAgB,IAAA,EAAA,EAAA,uBAAA,CAAkD,ECKtJ,SAAS,EAAM,CAAE,YAAW,WAAU,GAAG,GAA2D,CAClG,OACE,EAAA,EAAA,KAAA,CAACA,EAAAA,MAAe,KAAhB,CACE,YAAU,QACV,WAAA,EAAA,EAAA,GAAA,CACE,qBACA,2CACA,iDACA,iDACA,wCACA,mCACA,2BACA,8DACA,CACF,EACA,GAAI,EAbN,SAAA,EAeE,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,0BAA2B,UAAe,CAAA,GAC1D,EAAA,EAAA,IAAA,CAAC,OAAD,CACE,YAAU,qBACV,UAAU,4GACX,SAAA,UAEK,CAAA,CACa,GAEzB,wPC1BA,MAAM,GAAA,EAAA,EAAA,IAAA,CAAoB,kGAAmG,CAC3H,SAAU,CACR,YAAa,CACX,SAAU,CAAC,uCAAuC,EAClD,WAAY,CACV,8BACA,wCACA,0CACA,sCACA,+CACA,yEACF,EACA,WAAY,CACV,wCACA,2BACA,+BACA,wBACA,2BACA,wDACA,6DACA,sDACA,+DACA,yFACF,CACF,CACF,EACA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,QAAA,QAAA,CAAA,CAAA,SAAA,CAAA,CAAA,CAAuF,KAAK,IAAM,CAAE,QAAS,EAAE,UAAW,EAAE,CAAC,EAC1I,GAAmB,MAAA,QAAA,QAAA,CAAA,CAAA,SAAA,CAAA,CAAA,CACS,KAAK,IAAM,CAAE,QAAS,EAAE,gBAAiB,EAAE,CAC7E,EACM,GAAiB,MAAA,QAAA,QAAA,CAAA,CAAA,SAAA,CAAA,CAAA,CAA2F,KAAK,IAAM,CAAE,QAAS,EAAE,cAAe,EAAE,CAAC,EACtJ,GAAa,MAAA,QAAA,QAAA,CAAA,CAAA,SAAA,CAAA,CAAA,CAAuF,KAAK,IAAM,CAAE,QAAS,EAAE,UAAW,EAAE,CAAC,EAyD1I,CACJ,WAAY,GACZ,SAAU,GACV,eAAgB,KAAA,EAAA,EAAA,eAAA,CACC,CACjB,eACA,cAEA,gBAAiB,CACf,YACA,gBACA,kBACA,cACA,aACA,gBAEA,cACA,gBACA,YACA,cACA,kBACA,gBAEA,kBACA,mBACA,sBACA,sBACA,oBACA,oBACA,mBACA,sBACA,sBACA,mBACA,yBAEA,cACA,SACA,gBACA,cACA,oBACA,kBACA,aACF,EACA,eAAgB,CACd,sBACA,uBACA,yBACA,uBACA,oBACA,sBACA,sBAEA,uBACA,wBAEA,YACA,iBACF,CACF,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Skeleton as e}from"./ui/skeleton.mjs";import{Tooltip as t,TooltipContent as n,TooltipTrigger as r}from"./ui/tooltip.mjs";import{t as i}from"./text-editor-XBOAwJk-.mjs";import{Separator as a}from"./ui/separator.mjs";import{HelpCircleIcon as o,InfoIcon as ee}from"lucide-react";import{Suspense as s,lazy as c,memo as l,useCallback as te,useMemo as u}from"react";import{cn as d}from"@customafk/react-toolkit/utils";import{cva as f}from"class-variance-authority";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{Label as h}from"radix-ui";import{createFormHook as g,createFormHookContexts as _,useStore as ne}from"@tanstack/react-form";var v=Object.defineProperty,y=(e,t)=>{let n={};for(var r in e)v(n,r,{get:e[r],enumerable:!0});return t||v(n,Symbol.toStringTag,{value:`Module`}),n};const{fieldContext:b,formContext:x,useFieldContext:S,useFormContext:C}=_();function w({className:e,children:t,...n}){return m(h.Root,{"data-slot":`label`,className:d(`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:[p(`span`,{className:`flex items-center gap-1`,children:t}),p(`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`})]})}var T=y({Field:()=>A,FieldContent:()=>j,FieldContentMain:()=>M,FieldDescription:()=>F,FieldError:()=>z,FieldGroup:()=>k,FieldLabel:()=>N,FieldLegend:()=>O,FieldNote:()=>I,FieldSeparator:()=>R,FieldSet:()=>D,FieldTitle:()=>P,FieldTooltip:()=>L});const E=f(`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`}}),D=l(({className:e,...t})=>p(`fieldset`,{"data-slot":`field-set`,className:d(`flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t}));D.displayName=`FieldSet`;const O=l(({className:e,variant:t=`legend`,...n})=>p(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:d(`mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,e),...n}));O.displayName=`FieldLegend`;const k=l(({className:e,...t})=>p(`div`,{"data-slot":`field-group`,className:d(`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}));k.displayName=`FieldGroup`;const A=l(({className:e,orientation:t=`vertical`,...n})=>p(`div`,{"data-slot":`field`,"data-orientation":t,className:d(E({orientation:t}),e),...n}));A.displayName=`Field`;const j=l(({className:e,...t})=>p(`div`,{"data-slot":`field-content`,className:d(`group/field-content flex flex-col gap-1.5 leading-snug`,e),...t}));j.displayName=`FieldContent`;const M=l(({className:e,...t})=>p(`div`,{"data-slot":`field-content-main`,className:d(`relative`,e),...t}));M.displayName=`FieldContentMain`;const N=l(({className:e,...t})=>p(w,{"data-slot":`field-label`,className:d(`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}));N.displayName=`FieldLabel`;const P=l(({className:e,...t})=>p(`div`,{"data-slot":`field-label`,className:d(`flex w-fit items-center gap-2 font-medium text-sm leading-snug group-data-[disabled=true]/field:opacity-50`,e),...t}));P.displayName=`FieldTitle`;const F=l(({className:e,...t})=>p(`p`,{"data-slot":`field-description`,className:d(`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}));F.displayName=`FieldDescription`;const I=l(({isShow:e=!0,className:t,children:n,...r})=>e===!1?null:m(`div`,{"data-slot":`field-note`,className:d(`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:[p(ee,{size:12,className:`mt-0.5 shrink-0 text-primary/70`}),p(`span`,{children:n})]}));I.displayName=`FieldNote`;const L=l(({tooltip:e})=>m(t,{children:[p(r,{asChild:!0,children:m(`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:[p(o,{size:13,"aria-hidden":`true`}),p(`span`,{className:`sr-only`,children:`Thêm thông tin`})]})}),p(n,{side:`top`,className:`max-w-xs text-balance`,children:e})]}));L.displayName=`FieldTooltip`;const R=l(({children:e,className:t,...n})=>m(`div`,{"data-slot":`field-separator`,"data-content":!!e,className:d(`relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2`,t),...n,children:[p(a,{className:`absolute inset-0 top-1/2`}),e&&p(`span`,{className:`relative mx-auto block w-fit bg-background px-2 text-text-positive-weak`,"data-slot":`field-separator-content`,children:e})]}));R.displayName=`FieldSeparator`;const z=l(({className:e,children:t,errors:n,requiredMessage:r=`Trường này là bắt buộc`,...i})=>{let a=u(()=>{let e=e=>e.code===`invalid_type`?r:e.message;return t||(n?n?.length===1&&n[0]?.message?p(`div`,{className:`flex flex-row items-center justify-start gap-x-0.5`,children:p(`p`,{children:e(n[0])})}):p(`ul`,{className:`flex list-none flex-col`,children:n.map(t=>typeof t==`string`?p(`li`,{children:t},t):t?.message?p(`li`,{children:e(t)},t.code??t.message):null)}):null)},[t,n,r]);return a?p(`div`,{role:`alert`,"data-slot":`field-error`,className:d(`w-full font-medium text-danger-strong text-xs`,e),...i,children:a}):null});z.displayName=`FieldError`;const B=l(({label:e,description:t,placeholder:n,tooltip:r,helperText:a,showErrorMessage:o=!0,required:ee=!1,maxLength:s,showCharacterCount:c,enableLink:l,enableBubbleMenu:u,enableTaskList:d,enableHighlight:f,enableColor:h,enableImage:g,enableTable:_,enableSlashCommand:v,onImageUpload:y,variant:b,size:x})=>{let{form:C,state:w,handleChange:T}=S(),E=ne(C.store,({isSubmitting:e})=>e),D=w.meta.isDirty&&w.meta.isTouched&&!w.meta.isValid,O=ee&&w.value===null,M=te(e=>{E||T(e||null)},[E,T]);return m(k,{className:`gap-y-4 px-4`,children:[m(A,{orientation:`vertical`,"data-invalid":D,children:[m(j,{children:[m(N,{"aria-required":O,children:[e,r&&p(L,{tooltip:r})]}),p(F,{children:t})]}),p(i,{value:w.value??``,placeholder:n,readOnly:E,onChange:M,maxLength:s,showCharacterCount:c,enableLink:l,enableBubbleMenu:u,enableTaskList:d,enableHighlight:f,enableColor:h,enableImage:g,enableTable:_,enableSlashCommand:v,onImageUpload:y,variant:b,size:x}),w.meta.isDirty&&o&&!!w.meta.errors.length&&p(z,{errors:w.meta.errors}),p(I,{isShow:!!a,children:a})]}),p(R,{})]})});B.displayName=`TextEditorField`;function V(){return p(e,{"data-slot":`tanstack-field-skeleton`,className:`h-9 w-full rounded`})}function H(e){let t=c(e);return e=>p(s,{fallback:p(V,{}),children:p(t,{...e})})}const U=H(()=>import(`./text-field-wes_PQEd.mjs`).then(e=>({default:e.TextField}))),W=H(()=>import(`./textarea-field-BiNmDHgL.mjs`).then(e=>({default:e.TextareaField}))),G=H(()=>import(`./number-field-DSGwWg7y.mjs`).then(e=>({default:e.NumberField}))),K=H(()=>import(`./email-field-CPEVNvn8.mjs`).then(e=>({default:e.EmailField}))),q=H(()=>import(`./password-field-DsmwNZep.mjs`).then(e=>({default:e.PasswordField}))),J=H(()=>import(`./select-field-8PfksL_U.mjs`).then(e=>({default:e.SelectField}))),Y=H(()=>import(`./combobox-field-Cx0A-CD4.mjs`).then(e=>({default:e.ComboboxField}))),X=H(()=>import(`./date-field-zoPch5tC.mjs`).then(e=>({default:e.DateField}))),Z=H(()=>import(`./switch-field-D2SWDM1l.mjs`).then(e=>({default:e.SwitchField}))),Q=H(()=>import(`./radio-group-field-CmCo87tm.mjs`).then(e=>({default:e.RadioGroupField}))),$=H(()=>import(`./checkbox-field-C-NyMjEm.mjs`).then(e=>({default:e.CheckboxField}))),re=H(()=>import(`./simple-text-field-BEoQmd1b.mjs`).then(e=>({default:e.SimpleTextField}))),ie=H(()=>import(`./simple-email-field-CpxklyKr.mjs`).then(e=>({default:e.SimpleEmailField}))),ae=H(()=>import(`./simple-password-field-Cu_JvDEE.mjs`).then(e=>({default:e.SimplePasswordField}))),oe=H(()=>import(`./simple-textarea-field-CzpApMiv.mjs`).then(e=>({default:e.SimpleTextareaField}))),se=H(()=>import(`./simple-number-field-DuCvwUG9.mjs`).then(e=>({default:e.SimpleNumberField}))),ce=H(()=>import(`./simple-select-field-B3uEUqvQ.mjs`).then(e=>({default:e.SimpleSelectField}))),le=c(()=>import(`./simple-array-field-C0kpO1cq.mjs`).then(e=>({default:e.SimpleArrayField})));function ue(e){return p(s,{fallback:p(V,{}),children:p(le,{...e})})}const de=H(()=>import(`./simple-boolean-field-Bdc4wuUU.mjs`).then(e=>({default:e.SimpleBooleanField}))),fe=H(()=>import(`./simple-combobox-field-CR5Q6Nsd.mjs`).then(e=>({default:e.SimpleComboboxField}))),pe=H(()=>import(`./simple-date-field-DkhG2o7I.mjs`).then(e=>({default:e.SimpleDateField}))),me=H(()=>import(`./simple-radio-group-field-RJ_cEsxK.mjs`).then(e=>({default:e.SimpleRadioGroupField}))),he=H(()=>import(`./simple-array-field-C0kpO1cq.mjs`).then(e=>({default:e.ArrayCol}))),ge=H(()=>import(`./simple-array-field-C0kpO1cq.mjs`).then(e=>({default:e.ArrayHeaderRow}))),_e=H(()=>import(`./dialog-form-BRV1niqF.mjs`).then(e=>({default:e.TanStackDialogForm}))),ve=H(()=>import(`./popover-form-BUc5ivCF.mjs`).then(e=>({default:e.TanStackPopoverForm}))),ye=H(()=>import(`./container-form-BjiGIzwm.mjs`).then(e=>({default:e.TanStackContainerForm}))),be=H(()=>import(`./section-form-BJWWflUR.mjs`).then(e=>({default:e.TanStackSectionForm}))),xe=H(()=>import(`./card-form-D9fNO-6F.mjs`).then(e=>({default:e.TanStackCardForm}))),Se=H(()=>import(`./group-field-Cs0uWHg0.mjs`).then(e=>({default:e.TanStackFieldGroup}))),Ce=H(()=>import(`./title-field-C4BmSDR2.mjs`).then(e=>({default:e.TanStackTitleField}))),we=H(()=>import(`./actions-form-PByL8_M5.mjs`).then(e=>({default:e.TanStackActionsForm}))),Te=H(()=>import(`./action-submit-BHY2dndL.mjs`).then(e=>({default:e.TanStackActionSubmit}))),Ee=H(()=>Promise.resolve().then(()=>T).then(e=>({default:e.FieldGroup}))),De=H(()=>Promise.resolve().then(()=>T).then(e=>({default:e.Field}))),Oe=H(()=>Promise.resolve().then(()=>T).then(e=>({default:e.FieldContent}))),ke=H(()=>Promise.resolve().then(()=>T).then(e=>({default:e.FieldLabel}))),Ae=H(()=>Promise.resolve().then(()=>T).then(e=>({default:e.FieldContentMain}))),je=H(()=>Promise.resolve().then(()=>T).then(e=>({default:e.FieldSeparator}))),Me=H(()=>Promise.resolve().then(()=>T).then(e=>({default:e.FieldError}))),{useAppForm:Ne,withForm:Pe,withFieldGroup:Fe}=g({fieldContext:b,formContext:x,fieldComponents:{TextField:U,TextareaField:W,TextEditorField:B,NumberField:G,EmailField:K,PasswordField:q,SelectField:J,ComboboxField:Y,DateField:X,SwitchField:Z,RadioGroupField:Q,CheckboxField:$,SimpleTextField:re,SimpleEmailField:ie,SimplePasswordField:ae,SimpleTextareaField:oe,SimpleNumberField:se,SimpleSelectField:ce,SimpleArrayField:ue,SimpleBooleanField:de,SimpleComboboxField:fe,SimpleDateField:pe,SimpleRadioGroupField:me,FieldGroup:Ee,Field:De,FieldContent:Oe,FieldLabel:ke,FieldContentMain:Ae,FieldSeparator:je,FieldError:Me},formComponents:{TanStackDialogForm:_e,TanStackPopoverForm:ve,TanStackContainerForm:ye,TanStackSectionForm:be,TanStackCardForm:xe,TanStackFieldGroup:Se,TanStackTitleField:Ce,TanStackActionsForm:we,TanStackActionSubmit:Te,ArrayCol:he,ArrayHeaderRow:ge}});export{I as $,Te as A,W as B,se as C,re as D,ce as E,Se as F,A as G,Fe as H,ve as I,F as J,j as K,be as L,xe as M,ye as N,oe as O,_e as P,O as Q,Ce as R,ie as S,me as T,Pe as U,Ne as V,B as W,k as X,z as Y,N as Z,J as _,X as a,fe as b,Oe as c,Ee as d,R as et,ke as f,Q as g,q as h,Y as i,C as it,we as j,Z as k,Ae as l,G as m,ge as n,L as nt,K as o,je as p,M as q,$ as r,S as rt,De as s,he as t,P as tt,Me as u,ue as v,ae as w,pe as x,de as y,U as z};
|
|
2
|
+
//# sourceMappingURL=tanstack-form-Do6xL2kv.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tanstack-form-Do6xL2kv.mjs","names":["Label","LabelPrimitive","FieldGroup","Field","FieldContent","FieldContentMain","FieldLabel","Label","Tooltip","FieldSeparator","Separator","FieldError","FieldGroup","Field","FieldContent","FieldLabel","FieldError","FieldSeparator","Impl"],"sources":["../packages/components/features/tanstack-form/components/form-context.ts","../packages/components/features/tanstack-form/components/ui/label.tsx","../packages/components/features/tanstack-form/components/ui/field.tsx","../packages/components/features/tanstack-form/components/fields/text-editor-field.tsx","../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 { 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","'use client';\n\nimport { memo, useCallback } from 'react';\n\nimport { useStore } from '@tanstack/react-form';\n\nimport { TextEditor } from '@/components/features/text-editor';\n\nimport type { TextEditorFieldProps as Props } from '../../types';\nimport { useTanStackFieldContext } from '../form-context';\nimport { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldNote, FieldSeparator, FieldTooltip } from '../ui/field';\n\nexport const TextEditorField: React.FC<Props> = memo(\n ({\n label,\n description,\n placeholder,\n tooltip,\n helperText,\n showErrorMessage = true,\n required = false,\n maxLength,\n showCharacterCount,\n enableLink,\n enableBubbleMenu,\n enableTaskList,\n enableHighlight,\n enableColor,\n enableImage,\n enableTable,\n enableSlashCommand,\n onImageUpload,\n variant,\n size,\n }) => {\n const { form, state, handleChange } = useTanStackFieldContext<string | null>();\n\n const isSubmitting = useStore(form.store, ({ isSubmitting }) => isSubmitting);\n\n const _invalid = state.meta.isDirty && state.meta.isTouched && !state.meta.isValid;\n const _isEmpty = required && state.value === null;\n\n const onChange = useCallback(\n (html: string) => {\n if (isSubmitting) return;\n handleChange(html || null);\n },\n [isSubmitting, handleChange]\n );\n\n return (\n <FieldGroup className=\"gap-y-4 px-4\">\n <Field orientation=\"vertical\" data-invalid={_invalid}>\n <FieldContent>\n <FieldLabel aria-required={_isEmpty}>\n {label}\n {tooltip && <FieldTooltip tooltip={tooltip} />}\n </FieldLabel>\n <FieldDescription>{description}</FieldDescription>\n </FieldContent>\n <TextEditor\n value={state.value ?? ''}\n placeholder={placeholder}\n readOnly={isSubmitting}\n onChange={onChange}\n maxLength={maxLength}\n showCharacterCount={showCharacterCount}\n enableLink={enableLink}\n enableBubbleMenu={enableBubbleMenu}\n enableTaskList={enableTaskList}\n enableHighlight={enableHighlight}\n enableColor={enableColor}\n enableImage={enableImage}\n enableTable={enableTable}\n enableSlashCommand={enableSlashCommand}\n onImageUpload={onImageUpload}\n variant={variant}\n size={size}\n />\n {state.meta.isDirty && showErrorMessage && !!state.meta.errors.length && <FieldError errors={state.meta.errors} />}\n <FieldNote isShow={!!helperText}>{helperText}</FieldNote>\n </Field>\n <FieldSeparator />\n </FieldGroup>\n );\n }\n);\nTextEditorField.displayName = 'TextEditorField';\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 { TextEditorField } 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 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":"0xBASA,KAAa,CAAE,eAAc,cAAa,gBAAiB,EAAyB,eAAgB,GAA2B,EAAuB,ECKtJ,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,EACA,GAAI,EAbN,SAAA,CAeE,EAAC,OAAD,CAAM,UAAU,0BAA2B,UAAe,CAAA,EAC1D,EAAC,OAAD,CACE,YAAU,qBACV,UAAU,4GACX,SAAA,UAEK,CAAA,CACa,GAEzB,sPC1BA,MAA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,CAAE,QAAS,EAAE,gBAAiB,EAAE,CAC7E,EACM,GAAiB,MAAA,QAAA,QAAA,CAAA,CAAA,SAAA,CAAA,CAAA,CAA2F,KAAK,IAAM,CAAE,QAAS,EAAE,cAAe,EAAE,CAAC,EACtJ,GAAa,MAAA,QAAA,QAAA,CAAA,CAAA,SAAA,CAAA,CAAA,CAAuF,KAAK,IAAM,CAAE,QAAS,EAAE,UAAW,EAAE,CAAC,EAyD1I,CACJ,WAAY,GACZ,SAAU,GACV,eAAgB,IACd,EAAe,CACjB,eACA,cAEA,gBAAiB,CACf,YACA,gBACA,kBACA,cACA,aACA,gBAEA,cACA,gBACA,YACA,cACA,kBACA,gBAEA,mBACA,oBACA,uBACA,uBACA,qBACA,qBACA,oBACA,sBACA,uBACA,mBACA,yBAEA,cACA,SACA,gBACA,cACA,oBACA,kBACA,aACF,EACA,eAAgB,CACd,sBACA,uBACA,yBACA,uBACA,oBACA,sBACA,sBAEA,uBACA,wBAEA,YACA,iBACF,CACF,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-DWNI8pZO.cjs"),t=require("./ui/dropdown-menu.cjs"),n=require("./ui/spinner.cjs"),r=require("./ui/popover.cjs");let i=require("lucide-react"),a=require("react"),o=require("@customafk/react-toolkit/utils"),s=require("class-variance-authority"),c=require("react/jsx-runtime"),l=require("@tiptap/react"),u=require("@tiptap/extension-character-count"),d=require("@tiptap/extension-code-block-lowlight");d=e.n(d,1);let f=require("@tiptap/extension-highlight"),p=require("@tiptap/extension-image");p=e.n(p,1);let m=require("@tiptap/extension-link"),h=require("@tiptap/extension-list-keymap"),g=require("@tiptap/extension-placeholder");g=e.n(g,1);let _=require("@tiptap/extension-table"),v=require("@tiptap/extension-task-item"),y=require("@tiptap/extension-task-list"),b=require("@tiptap/extension-text-align");b=e.n(b,1);let x=require("@tiptap/extension-text-style"),S=require("@tiptap/extension-underline");S=e.n(S,1);let ee=require("@tiptap/react/menus"),C=require("@tiptap/starter-kit");C=e.n(C,1);let w=require("dompurify");w=e.n(w,1);let T=require("lowlight"),te=require("@tiptap/suggestion");function E({isActive:e,className:t,children:n,...r}){return(0,c.jsx)(`button`,{type:`button`,"data-slot":`toolbar-button`,"data-active":e||void 0,"aria-pressed":e===void 0?void 0:e,className:(0,o.cn)(`inline-flex size-8 shrink-0 items-center justify-center rounded text-sm outline-none transition-colors min-w-8`,`hover:bg-muted-weak hover:text-text-positive-strong`,`focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1`,`disabled:pointer-events-none disabled:opacity-40`,e&&`bg-primary-muted text-primary hover:bg-primary-muted/80 hover:text-primary`,t),...r,children:n})}function D(){return(0,c.jsx)(`div`,{"data-slot":`toolbar-divider`,role:`separator`,"aria-orientation":`vertical`,className:`mx-0.5 h-5 w-px shrink-0 bg-border`})}function O({editor:e}){let[t,n]=(0,a.useState)(!1),[s,u]=(0,a.useState)(``),d=(0,l.useEditorState)({editor:e,selector:e=>e.editor.isActive(`link`)}),f=(0,a.useCallback)(t=>{if(t){let t=e.getAttributes(`link`).href??``;u(t)}n(t)},[e]),p=(0,a.useCallback)(()=>{let t=s.trim();t&&(e.chain().focus().setLink({href:t,target:`_blank`}).run(),n(!1))},[e,s]),m=(0,a.useCallback)(()=>{e.chain().focus().unsetLink().run(),n(!1)},[e]);return(0,c.jsxs)(r.Popover,{open:t,onOpenChange:f,children:[(0,c.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,c.jsx)(E,{isActive:d,"aria-label":`Liên kết`,title:`Link (Ctrl+K)`,"data-slot":`toolbar-link-button`,children:(0,c.jsx)(i.Link2,{className:`h-3.5 w-3.5`})})}),(0,c.jsxs)(r.PopoverContent,{"data-slot":`link-dialog`,sideOffset:6,align:`start`,className:`w-72 p-3`,children:[(0,c.jsx)(`p`,{className:`mb-2 font-medium text-text-positive-strong text-xs`,children:d?`Edit Link`:`Insert Link`}),(0,c.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,c.jsx)(`input`,{type:`url`,placeholder:`https://example.com`,value:s,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),p()),e.key===`Escape`&&n(!1)},"aria-label":`Đường dẫn liên kết`,autoFocus:!0,className:(0,o.cn)(`flex-1 rounded border border-border bg-transparent px-2.5 py-1.5 text-sm text-text-positive`,`outline-none placeholder:text-text-positive-muted`,`focus:border-primary focus:ring-1 focus:ring-primary/30`)}),(0,c.jsx)(`button`,{type:`button`,onClick:p,disabled:!s.trim(),className:(0,o.cn)(`rounded bg-primary px-2.5 py-1.5 font-medium text-text-negative text-xs`,`transition-colors hover:bg-primary-strong`,`disabled:pointer-events-none disabled:opacity-50`),children:`Apply`})]}),d&&(0,c.jsxs)(`button`,{type:`button`,onClick:m,className:`mt-2 flex items-center gap-1 text-danger-strong text-xs hover:underline`,children:[(0,c.jsx)(i.Link2Off,{className:`h-3 w-3`}),`Remove link`]})]})]})}function k(e){try{return new URL(e).hostname}catch{return e}}function A({node:e,selected:t}){let n=e.attrs.src,r=e.attrs.alt;return(0,c.jsxs)(l.NodeViewWrapper,{"data-slot":`text-editor-image`,className:`my-5 flex flex-col items-center`,children:[(0,c.jsx)(`img`,{src:n,alt:r??``,className:(0,o.cn)(`max-w-full rounded-lg border border-border`,t&&`outline-2 outline-primary outline-offset-2`)}),(0,c.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,contentEditable:!1,className:`mt-1.5 text-text-positive-weak text-xs hover:text-text-positive hover:underline`,children:k(n)})]})}const j=(0,a.forwardRef)(({items:e,command:t},n)=>{let[r,i]=(0,a.useState)(0);return(0,a.useEffect)(()=>{i(0)},[]),(0,a.useImperativeHandle)(n,()=>({onKeyDown:({event:n})=>{if(e.length===0)return!1;if(n.key===`ArrowDown`)return i(t=>(t+1)%e.length),!0;if(n.key===`ArrowUp`)return i(t=>(t-1+e.length)%e.length),!0;if(n.key===`Enter`){let n=e[r];return n&&t(n),!0}return!1}})),e.length===0?(0,c.jsx)(`div`,{"data-slot":`slash-command-menu`,className:`w-56 rounded-md border border-border bg-popover p-2 text-text-positive-weak text-xs shadow-dropdown`,children:`Không tìm thấy lệnh phù hợp`}):(0,c.jsx)(`div`,{"data-slot":`slash-command-menu`,role:`listbox`,"aria-label":`Lệnh chèn nhanh`,className:`max-h-72 w-56 overflow-y-auto rounded-md border border-border bg-popover p-1 shadow-dropdown`,children:e.map((e,n)=>{let a=e.icon;return(0,c.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":n===r,onClick:()=>t(e),onMouseEnter:()=>i(n),className:(0,o.cn)(`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm transition-colors`,n===r?`bg-primary-muted text-primary`:`text-text-positive hover:bg-muted-muted`),children:[(0,c.jsx)(a,{className:`h-3.5 w-3.5 shrink-0`}),(0,c.jsx)(`span`,{children:e.label})]},e.label)})})});j.displayName=`SlashCommandMenu`;function M(e){let t=[{label:`Heading 1`,icon:i.Heading1,command:(e,t)=>e.chain().focus().deleteRange(t).toggleHeading({level:1}).run()},{label:`Heading 2`,icon:i.Heading2,command:(e,t)=>e.chain().focus().deleteRange(t).toggleHeading({level:2}).run()},{label:`Heading 3`,icon:i.Heading3,command:(e,t)=>e.chain().focus().deleteRange(t).toggleHeading({level:3}).run()},{label:`Bullet list`,icon:i.List,command:(e,t)=>e.chain().focus().deleteRange(t).toggleBulletList().run()},{label:`Ordered list`,icon:i.ListOrdered,command:(e,t)=>e.chain().focus().deleteRange(t).toggleOrderedList().run()}];if(e.enableTaskList&&t.push({label:`Task list`,icon:i.ListChecks,command:(e,t)=>e.chain().focus().deleteRange(t).toggleTaskList().run()}),t.push({label:`Blockquote`,icon:i.Quote,command:(e,t)=>e.chain().focus().deleteRange(t).toggleBlockquote().run()},{label:`Code block`,icon:i.Code2,command:(e,t)=>e.chain().focus().deleteRange(t).toggleCodeBlock().run()},{label:`Horizontal rule`,icon:i.Minus,command:(e,t)=>e.chain().focus().deleteRange(t).setHorizontalRule().run()}),e.enableTable&&t.push({label:`Table`,icon:i.Table,command:(e,t)=>e.chain().focus().deleteRange(t).insertTable({rows:3,cols:3,withHeaderRow:!0}).run()}),e.enableImage&&e.onImageUpload){let n=e.onImageUpload;t.push({label:`Image`,icon:i.Image,command:(e,t)=>{e.chain().focus().deleteRange(t).run();let r=document.createElement(`input`);r.type=`file`,r.accept=`image/*`,r.onchange=()=>{let t=r.files?.[0];if(!t)return;let i=t.name.replace(/\.[^./]+$/,``);n(t).then(t=>e.chain().focus().setImage({src:t,alt:i}).run())},r.click()}})}return t}function ne(e){return l.Extension.create({name:`slashCommand`,addProseMirrorPlugins(){let t=this.editor;return[(0,te.Suggestion)({editor:t,char:`/`,startOfLine:!1,command:({editor:e,range:t,props:n})=>n.command(e,t),items:({query:t})=>M(e).filter(e=>e.label.toLowerCase().includes(t.toLowerCase())),render:()=>{let e,t;return{onStart:n=>{e=new l.ReactRenderer(j,{editor:n.editor,props:{items:n.items,command:e=>n.command(e)}}),t=n.mount(e.element)},onUpdate:t=>{e?.updateProps({items:t.items,command:e=>t.command(e)})},onKeyDown:n=>n.event.key===`Escape`?(t?.(),!0):e?.ref?.onKeyDown(n)??!1,onExit:()=>{t?.(),e?.destroy()}}}})]}})}const re=(0,s.cva)([`flex flex-col overflow-hidden rounded-md`],{variants:{variant:{outline:`border border-border bg-background shadow-xs`,ghost:`border-0`},size:{sm:`text-xs [&_.ProseMirror]:min-h-24 [&_.ProseMirror]:px-2.5 [&_.ProseMirror]:py-1.5`,md:`text-sm`,lg:`text-base [&_.ProseMirror]:min-h-56 [&_.ProseMirror]:px-4 [&_.ProseMirror]:py-3`}},defaultVariants:{variant:`outline`,size:`md`}});function N({editor:e,onImageUpload:t}){let[s,l]=(0,a.useState)(!1),[u,d]=(0,a.useState)(``),[f,p]=(0,a.useState)(``),[m,h]=(0,a.useState)(!1),[g,_]=(0,a.useState)(null),v=(0,a.useRef)(null),y=(0,a.useCallback)(e=>{e&&(d(``),p(``),_(null)),l(e)},[]),b=(0,a.useCallback)((t,n)=>{e.chain().focus().setImage({src:t,alt:n||void 0}).run(),l(!1)},[e]),x=(0,a.useCallback)(()=>{let e=u.trim();e&&b(e,f.trim())},[u,f,b]),S=(0,a.useCallback)(async e=>{let n=e.target.files?.[0];if(e.target.value=``,!(!n||!t)){_(null),h(!0);try{let e=await t(n);b(e,f.trim()||n.name.replace(/\.[^./]+$/,``))}catch{_(`Tải ảnh lên thất bại. Vui lòng thử lại.`)}finally{h(!1)}}},[t,f,b]);return(0,c.jsxs)(r.Popover,{open:s,onOpenChange:y,children:[(0,c.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,c.jsx)(E,{title:`Chèn ảnh`,"aria-label":`Chèn ảnh`,"data-slot":`toolbar-image-button`,children:(0,c.jsx)(i.ImageIcon,{className:`h-3.5 w-3.5`})})}),(0,c.jsxs)(r.PopoverContent,{"data-slot":`image-dialog`,sideOffset:6,align:`start`,className:`w-72 p-3`,children:[(0,c.jsx)(`p`,{className:`mb-2 font-medium text-text-positive-strong text-xs`,children:`Chèn ảnh`}),t&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`input`,{ref:v,type:`file`,accept:`image/*`,className:`hidden`,onChange:S}),(0,c.jsx)(`button`,{type:`button`,onClick:()=>v.current?.click(),disabled:m,className:(0,o.cn)(`flex w-full items-center justify-center gap-1.5 rounded border border-border border-dashed py-2 text-text-positive-weak text-xs`,`transition-colors hover:border-primary hover:text-primary`,`disabled:pointer-events-none disabled:opacity-60`),children:m?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(n.Spinner,{className:`size-3.5`}),` Đang tải lên…`]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(i.Upload,{className:`h-3.5 w-3.5`}),` Tải ảnh từ máy`]})}),g&&(0,c.jsx)(`p`,{className:`mt-1.5 text-danger-strong text-xs`,children:g}),(0,c.jsxs)(`div`,{className:`my-2 flex items-center gap-2`,children:[(0,c.jsx)(`div`,{className:`h-px flex-1 bg-border`}),(0,c.jsx)(`span`,{className:`text-text-positive-muted text-xs`,children:`hoặc`}),(0,c.jsx)(`div`,{className:`h-px flex-1 bg-border`})]})]}),(0,c.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,c.jsx)(`input`,{type:`url`,placeholder:`https://example.com/image.png`,value:u,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),x()),e.key===`Escape`&&l(!1)},"aria-label":`Đường dẫn ảnh`,disabled:m,className:(0,o.cn)(`flex-1 rounded border border-border bg-transparent px-2.5 py-1.5 text-sm text-text-positive`,`outline-none placeholder:text-text-positive-muted`,`focus:border-primary focus:ring-1 focus:ring-primary/30`,`disabled:pointer-events-none disabled:opacity-60`)}),(0,c.jsx)(`button`,{type:`button`,onClick:x,disabled:!u.trim()||m,className:(0,o.cn)(`rounded bg-primary px-2.5 py-1.5 font-medium text-text-negative text-xs`,`transition-colors hover:bg-primary-strong`,`disabled:pointer-events-none disabled:opacity-50`),children:`Chèn`})]}),(0,c.jsx)(`input`,{type:`text`,placeholder:`Mô tả ảnh (alt text) — tùy chọn`,value:f,onChange:e=>p(e.target.value),"aria-label":`Mô tả ảnh`,disabled:m,className:(0,o.cn)(`mt-1.5 w-full rounded border border-border bg-transparent px-2.5 py-1.5 text-sm text-text-positive`,`outline-none placeholder:text-text-positive-muted`,`focus:border-primary focus:ring-1 focus:ring-primary/30`,`disabled:pointer-events-none disabled:opacity-60`)})]})]})}function P({editor:e}){let[t,n]=(0,a.useState)(!1),[s,l]=(0,a.useState)({rows:0,cols:0}),u=(0,a.useCallback)((t,r)=>{e.chain().focus().insertTable({rows:t,cols:r,withHeaderRow:!0}).run(),n(!1)},[e]);return(0,c.jsxs)(r.Popover,{open:t,onOpenChange:e=>{n(e),e||l({rows:0,cols:0})},children:[(0,c.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,c.jsx)(E,{title:`Chèn bảng`,"aria-label":`Chèn bảng`,"data-slot":`toolbar-table-button`,children:(0,c.jsx)(i.Table,{className:`h-3.5 w-3.5`})})}),(0,c.jsxs)(r.PopoverContent,{"data-slot":`table-insert-menu`,sideOffset:6,align:`start`,className:`w-auto p-3`,children:[(0,c.jsx)(`p`,{className:`mb-2 font-medium text-text-positive-strong text-xs`,children:s.rows>0?`Bảng ${s.rows} × ${s.cols}`:`Chọn kích thước bảng`}),(0,c.jsx)(`div`,{className:`grid grid-cols-6 gap-1`,onMouseLeave:()=>l({rows:0,cols:0}),children:Array.from({length:36},(e,t)=>{let n=Math.floor(t/6)+1,r=t%6+1,i=n<=s.rows&&r<=s.cols;return(0,c.jsx)(`button`,{type:`button`,"aria-label":`Bảng ${n} hàng, ${r} cột`,onMouseEnter:()=>l({rows:n,cols:r}),onClick:()=>u(n,r),className:(0,o.cn)(`h-4 w-4 rounded-sm border border-border`,i?`border-primary bg-primary-muted`:`bg-muted-muted/40`)},`${n}-${r}`)})})]})]})}const ie=[{label:`Yellow`,value:`#fde047`},{label:`Green`,value:`#86efac`},{label:`Blue`,value:`#93c5fd`},{label:`Pink`,value:`#f9a8d4`},{label:`Orange`,value:`#fdba74`},{label:`Purple`,value:`#c4b5fd`},{label:`Red`,value:`#fca5a5`},{label:`Cyan`,value:`#67e8f9`},{label:`Lime`,value:`#bef264`},{label:`Gray`,value:`#d1d5db`}],F=[{label:`Default`,value:``},{label:`Red`,value:`#ef4444`},{label:`Orange`,value:`#f97316`},{label:`Yellow`,value:`#eab308`},{label:`Green`,value:`#22c55e`},{label:`Blue`,value:`#3b82f6`},{label:`Purple`,value:`#a855f7`},{label:`Pink`,value:`#ec4899`},{label:`Gray`,value:`#6b7280`},{label:`Black`,value:`#000000`}],I=[{label:`Plain text`,value:`plaintext`},{label:`JavaScript`,value:`javascript`},{label:`TypeScript`,value:`typescript`},{label:`Python`,value:`python`},{label:`Java`,value:`java`},{label:`C#`,value:`csharp`},{label:`C++`,value:`cpp`},{label:`Go`,value:`go`},{label:`Rust`,value:`rust`},{label:`PHP`,value:`php`},{label:`Ruby`,value:`ruby`},{label:`Swift`,value:`swift`},{label:`Kotlin`,value:`kotlin`},{label:`SQL`,value:`sql`},{label:`Bash`,value:`bash`},{label:`JSON`,value:`json`},{label:`YAML`,value:`yaml`},{label:`CSS`,value:`css`},{label:`HTML/XML`,value:`xml`},{label:`Markdown`,value:`markdown`}];function L({editor:e,className:n,enableLink:a,enableTaskList:s,enableHighlight:u,enableColor:d,enableImage:f,enableTable:p,onImageUpload:m}){let h=(0,l.useEditorState)({editor:e,selector:e=>e.editor.isActive(`heading`,{level:1})?1:e.editor.isActive(`heading`,{level:2})?2:e.editor.isActive(`heading`,{level:3})?3:null}),g=(0,l.useEditorState)({editor:e,selector:e=>({bold:e.editor.isActive(`bold`),italic:e.editor.isActive(`italic`),underline:e.editor.isActive(`underline`),strike:e.editor.isActive(`strike`),code:e.editor.isActive(`code`)})}),_=(0,l.useEditorState)({editor:e,selector:e=>({bulletList:e.editor.isActive(`bulletList`),orderedList:e.editor.isActive(`orderedList`),taskList:e.editor.isActive(`taskList`),blockquote:e.editor.isActive(`blockquote`),codeBlock:e.editor.isActive(`codeBlock`),codeBlockLanguage:e.editor.getAttributes(`codeBlock`).language??`plaintext`,table:e.editor.isActive(`table`)})}),v=(0,l.useEditorState)({editor:e,selector:e=>({left:e.editor.isActive({textAlign:`left`}),center:e.editor.isActive({textAlign:`center`}),right:e.editor.isActive({textAlign:`right`}),justify:e.editor.isActive({textAlign:`justify`})})}),y=h?`H${h}`:`P`;return(0,c.jsxs)(`div`,{"data-slot":`text-editor-toolbar`,role:`toolbar`,"aria-label":`Định dạng văn bản`,className:(0,o.cn)(`sticky top-0 z-10 flex flex-wrap items-center gap-0.5 border-border border-b bg-muted-muted p-1.5`,n),children:[(0,c.jsx)(E,{onClick:()=>e.chain().focus().undo().run(),disabled:!e.can().undo(),"aria-label":`Hoàn tác`,title:`Undo (Ctrl+Z)`,children:(0,c.jsx)(i.Undo,{className:`h-3.5 w-3.5`})}),(0,c.jsx)(E,{onClick:()=>e.chain().focus().redo().run(),disabled:!e.can().redo(),"aria-label":`Làm lại`,title:`Redo (Ctrl+Y)`,children:(0,c.jsx)(i.Redo,{className:`h-3.5 w-3.5`})}),(0,c.jsx)(D,{}),(0,c.jsxs)(t.DropdownMenu,{children:[(0,c.jsx)(t.DropdownMenuTrigger,{asChild:!0,children:(0,c.jsxs)(`button`,{type:`button`,"data-slot":`toolbar-heading-trigger`,"aria-label":`Kiểu đoạn văn`,"aria-haspopup":`menu`,className:(0,o.cn)(`inline-flex h-8 items-center gap-1 rounded px-1.5 font-medium text-xs transition-colors`,`hover:bg-muted-muted hover:text-text-positive-strong`,`disabled:pointer-events-none disabled:opacity-40`,h!==null&&`bg-primary-muted text-primary hover:bg-primary-muted/80 hover:text-primary`),children:[(0,c.jsx)(`span`,{className:`w-5 text-center`,children:y}),(0,c.jsx)(i.ChevronDown,{className:`h-3 w-3 opacity-60`})]})}),(0,c.jsxs)(t.DropdownMenuContent,{align:`start`,className:`min-w-32`,children:[(0,c.jsx)(t.DropdownMenuItem,{className:`px-2 py-1.5`,onClick:()=>e.chain().focus().setParagraph().run(),children:(0,c.jsx)(`span`,{className:`text-sm`,children:`Paragraph`})}),(0,c.jsx)(t.DropdownMenuItem,{className:`px-2 py-1.5`,onClick:()=>e.chain().focus().toggleHeading({level:1}).run(),children:(0,c.jsx)(`span`,{className:`font-extrabold text-sm`,children:`Heading 1`})}),(0,c.jsx)(t.DropdownMenuItem,{className:`px-2 py-1.5`,onClick:()=>e.chain().focus().toggleHeading({level:2}).run(),children:(0,c.jsx)(`span`,{className:`font-semibold text-sm`,children:`Heading 2`})}),(0,c.jsx)(t.DropdownMenuItem,{className:`px-2 py-1.5`,onClick:()=>e.chain().focus().toggleHeading({level:3}).run(),children:(0,c.jsx)(`span`,{className:`font-medium text-sm`,children:`Heading 3`})})]})]}),(0,c.jsx)(D,{}),(0,c.jsx)(E,{onClick:()=>e.chain().focus().toggleBold().run(),isActive:g.bold,"aria-label":`In đậm`,title:`Bold (Ctrl+B)`,children:(0,c.jsx)(i.Bold,{className:`h-3.5 w-3.5`})}),(0,c.jsx)(E,{onClick:()=>e.chain().focus().toggleItalic().run(),isActive:g.italic,"aria-label":`In nghiêng`,title:`Italic (Ctrl+I)`,children:(0,c.jsx)(i.Italic,{className:`h-3.5 w-3.5`})}),(0,c.jsx)(E,{onClick:()=>e.chain().focus().toggleUnderline().run(),isActive:g.underline,"aria-label":`Gạch chân`,title:`Underline (Ctrl+U)`,children:(0,c.jsx)(i.Underline,{className:`h-3.5 w-3.5`})}),(0,c.jsx)(E,{onClick:()=>e.chain().focus().toggleStrike().run(),isActive:g.strike,"aria-label":`Gạch ngang`,title:`Strikethrough`,children:(0,c.jsx)(i.Strikethrough,{className:`h-3.5 w-3.5`})}),(0,c.jsx)(E,{onClick:()=>e.chain().focus().toggleCode().run(),isActive:g.code,"aria-label":`Mã inline`,title:`Inline Code`,children:(0,c.jsx)(i.Code,{className:`h-3.5 w-3.5`})}),(0,c.jsx)(D,{}),(0,c.jsx)(E,{onClick:()=>e.chain().focus().toggleBulletList().run(),isActive:_.bulletList,"aria-label":`Danh sách chấm`,title:`Bullet List`,children:(0,c.jsx)(i.List,{className:`h-3.5 w-3.5`})}),(0,c.jsx)(E,{onClick:()=>e.chain().focus().toggleOrderedList().run(),isActive:_.orderedList,"aria-label":`Danh sách số`,title:`Ordered List`,children:(0,c.jsx)(i.ListOrdered,{className:`h-3.5 w-3.5`})}),s&&(0,c.jsx)(E,{onClick:()=>e.chain().focus().toggleTaskList().run(),isActive:_.taskList,"aria-label":`Danh sách công việc`,title:`Task List`,children:(0,c.jsx)(i.ListChecks,{className:`h-3.5 w-3.5`})}),(0,c.jsx)(D,{}),(0,c.jsx)(E,{onClick:()=>e.chain().focus().toggleBlockquote().run(),isActive:_.blockquote,"aria-label":`Trích dẫn`,title:`Blockquote`,children:(0,c.jsx)(i.Quote,{className:`h-3.5 w-3.5`})}),(0,c.jsx)(E,{onClick:()=>e.chain().focus().toggleCodeBlock().run(),isActive:_.codeBlock,"aria-label":`Khối mã`,title:`Code Block`,children:(0,c.jsx)(i.Code2,{className:`h-3.5 w-3.5`})}),_.codeBlock&&(0,c.jsxs)(t.DropdownMenu,{children:[(0,c.jsx)(t.DropdownMenuTrigger,{asChild:!0,children:(0,c.jsxs)(`button`,{type:`button`,"data-slot":`toolbar-code-language-trigger`,"aria-label":`Ngôn ngữ lập trình`,"aria-haspopup":`menu`,className:(0,o.cn)(`inline-flex h-7 items-center gap-1 rounded px-1.5 text-text-positive-weak text-xs transition-colors`,`hover:bg-muted-muted hover:text-text-positive-strong`),children:[(0,c.jsx)(`span`,{children:I.find(e=>e.value===_.codeBlockLanguage)?.label??`Plain text`}),(0,c.jsx)(i.ChevronDown,{className:`h-3 w-3 opacity-60`})]})}),(0,c.jsx)(t.DropdownMenuContent,{align:`start`,className:`max-h-72 min-w-40 overflow-y-auto`,children:I.map(n=>(0,c.jsx)(t.DropdownMenuItem,{onClick:()=>e.chain().focus().updateAttributes(`codeBlock`,{language:n.value}).run(),children:(0,c.jsx)(`span`,{className:`text-sm`,children:n.label})},n.value))})]}),(0,c.jsx)(E,{onClick:()=>e.chain().focus().setHorizontalRule().run(),"aria-label":`Đường kẻ ngang`,title:`Horizontal Rule`,children:(0,c.jsx)(i.Minus,{className:`h-3.5 w-3.5`})}),(0,c.jsx)(D,{}),(0,c.jsx)(E,{onClick:()=>e.chain().focus().setTextAlign(`left`).run(),isActive:v.left,"aria-label":`Căn trái`,title:`Align Left`,children:(0,c.jsx)(i.AlignLeft,{className:`h-3.5 w-3.5`})}),(0,c.jsx)(E,{onClick:()=>e.chain().focus().setTextAlign(`center`).run(),isActive:v.center,"aria-label":`Căn giữa`,title:`Align Center`,children:(0,c.jsx)(i.AlignCenter,{className:`h-3.5 w-3.5`})}),(0,c.jsx)(E,{onClick:()=>e.chain().focus().setTextAlign(`right`).run(),isActive:v.right,"aria-label":`Căn phải`,title:`Align Right`,children:(0,c.jsx)(i.AlignRight,{className:`h-3.5 w-3.5`})}),(0,c.jsx)(E,{onClick:()=>e.chain().focus().setTextAlign(`justify`).run(),isActive:v.justify,"aria-label":`Căn đều`,title:`Align Justify`,children:(0,c.jsx)(i.AlignJustify,{className:`h-3.5 w-3.5`})}),a&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(D,{}),(0,c.jsx)(O,{editor:e})]}),f&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(D,{}),(0,c.jsx)(N,{editor:e,onImageUpload:m})]}),p&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(D,{}),(0,c.jsx)(P,{editor:e}),_.table&&(0,c.jsxs)(t.DropdownMenu,{children:[(0,c.jsx)(t.DropdownMenuTrigger,{asChild:!0,children:(0,c.jsx)(E,{title:`Sửa bảng`,"aria-label":`Sửa bảng`,children:(0,c.jsx)(i.TableCellsMerge,{className:`h-3.5 w-3.5`})})}),(0,c.jsxs)(t.DropdownMenuContent,{align:`start`,className:`min-w-44`,children:[(0,c.jsxs)(t.DropdownMenuItem,{onClick:()=>e.chain().focus().addRowBefore().run(),children:[(0,c.jsx)(i.Rows3,{className:`mr-2 h-3.5 w-3.5`}),` Thêm hàng phía trên`]}),(0,c.jsxs)(t.DropdownMenuItem,{onClick:()=>e.chain().focus().addRowAfter().run(),children:[(0,c.jsx)(i.Rows3,{className:`mr-2 h-3.5 w-3.5`}),` Thêm hàng phía dưới`]}),(0,c.jsxs)(t.DropdownMenuItem,{onClick:()=>e.chain().focus().deleteRow().run(),children:[(0,c.jsx)(i.Trash2,{className:`mr-2 h-3.5 w-3.5`}),` Xóa hàng`]}),(0,c.jsx)(t.DropdownMenuSeparator,{}),(0,c.jsxs)(t.DropdownMenuItem,{onClick:()=>e.chain().focus().addColumnBefore().run(),children:[(0,c.jsx)(i.Columns3,{className:`mr-2 h-3.5 w-3.5`}),` Thêm cột bên trái`]}),(0,c.jsxs)(t.DropdownMenuItem,{onClick:()=>e.chain().focus().addColumnAfter().run(),children:[(0,c.jsx)(i.Columns3,{className:`mr-2 h-3.5 w-3.5`}),` Thêm cột bên phải`]}),(0,c.jsxs)(t.DropdownMenuItem,{onClick:()=>e.chain().focus().deleteColumn().run(),children:[(0,c.jsx)(i.Trash2,{className:`mr-2 h-3.5 w-3.5`}),` Xóa cột`]}),(0,c.jsx)(t.DropdownMenuSeparator,{}),(0,c.jsxs)(t.DropdownMenuItem,{onClick:()=>e.chain().focus().deleteTable().run(),className:`text-danger-strong`,children:[(0,c.jsx)(i.Trash2,{className:`mr-2 h-3.5 w-3.5`}),` Xóa bảng`]})]})]})]}),(d||u)&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(D,{}),d&&(0,c.jsxs)(r.Popover,{children:[(0,c.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,c.jsx)(E,{title:`Text Color`,"aria-label":`Màu chữ`,children:(0,c.jsx)(i.Palette,{className:`h-3.5 w-3.5`})})}),(0,c.jsxs)(r.PopoverContent,{align:`start`,className:`w-44 p-2`,children:[(0,c.jsx)(`p`,{className:`mb-1.5 font-medium text-text-positive-weak text-xs`,children:`Text Color`}),(0,c.jsx)(`div`,{className:`grid grid-cols-5 gap-1`,children:F.map(t=>(0,c.jsx)(`button`,{type:`button`,title:t.label,onClick:()=>{t.value?e.chain().focus().setColor(t.value).run():e.chain().focus().unsetColor().run()},className:(0,o.cn)(`h-6 w-6 rounded border border-border transition-transform hover:scale-110`,!t.value&&`bg-background text-[10px] text-text-positive leading-none`),style:t.value?{backgroundColor:t.value}:void 0,children:!t.value&&`∅`},t.label))})]})]}),u&&(0,c.jsxs)(r.Popover,{children:[(0,c.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,c.jsx)(E,{title:`Highlight`,"aria-label":`Tô sáng`,children:(0,c.jsx)(i.Highlighter,{className:`h-3.5 w-3.5`})})}),(0,c.jsxs)(r.PopoverContent,{align:`start`,className:`w-44 p-2`,children:[(0,c.jsx)(`p`,{className:`mb-1.5 font-medium text-text-positive-weak text-xs`,children:`Highlight`}),(0,c.jsx)(`div`,{className:`grid grid-cols-5 gap-1`,children:ie.map(t=>(0,c.jsx)(`button`,{type:`button`,title:t.label,onClick:()=>e.chain().focus().toggleHighlight({color:t.value}).run(),className:`h-6 w-6 rounded border border-border transition-transform hover:scale-110`,style:{backgroundColor:t.value}},t.label))}),(0,c.jsx)(`button`,{type:`button`,onClick:()=>e.chain().focus().unsetHighlight().run(),className:`mt-1.5 w-full rounded border border-border py-0.5 text-center text-text-positive-weak text-xs hover:bg-muted-muted`,children:`Clear highlight`})]})]})]})]})}const ae=(0,T.createLowlight)(T.common),oe=p.default.extend({addNodeView(){return(0,l.ReactNodeViewRenderer)(A)}}),R=[`p`,`h1`,`h2`,`h3`,`strong`,`em`,`s`,`u`,`code`,`pre`,`blockquote`,`ul`,`ol`,`li`,`hr`,`br`],z=[`class`,`style`];function se(e){let t=new Set(R),n=new Set(z);if(e.enableLink&&(t.add(`a`),n.add(`href`).add(`target`).add(`rel`)),e.enableHighlight&&(t.add(`mark`),n.add(`data-color`)),e.enableColor&&t.add(`span`),e.enableTaskList){for(let e of[`label`,`input`,`div`,`span`])t.add(e);for(let e of[`data-type`,`data-checked`,`type`,`checked`,`disabled`])n.add(e)}if(e.enableImage){t.add(`img`);for(let e of[`src`,`alt`,`title`])n.add(e)}if(e.enableTable){for(let e of[`table`,`tbody`,`thead`,`tr`,`td`,`th`,`colgroup`,`col`])t.add(e);for(let e of[`colspan`,`rowspan`,`colwidth`])n.add(e)}return{ALLOWED_TAGS:Array.from(t),ALLOWED_ATTR:Array.from(n)}}function B(e,t){return typeof window>`u`?e:w.default.sanitize(e,t)}function V(e){return e.name.replace(/\.[^./]+$/,``)}function H({value:e,defaultValue:t,onChange:n,placeholder:r=`Start writing...`,readOnly:s=!1,showToolbar:p=!0,variant:w,size:T,className:te,toolbarClassName:k,editorClassName:A,maxLength:j,showCharacterCount:M,onCharacterCount:N,enableLink:P,enableBubbleMenu:ie,enableTaskList:F,enableHighlight:I,enableColor:R,enableImage:z,enableTable:H,enableSlashCommand:U,onImageUpload:W}){let G=j!==void 0||M||N!==void 0,K=R||I,q=(0,a.useMemo)(()=>se({enableLink:P,enableHighlight:I,enableColor:R,enableTaskList:F,enableImage:z,enableTable:H}),[P,I,R,F,z,H]),ce=(0,a.useMemo)(()=>{let e=[C.default.configure({link:!1,underline:!1,codeBlock:!1,listKeymap:!1}),S.default,g.default.configure({placeholder:r}),b.default.configure({types:[`heading`,`paragraph`]}),h.ListKeymap,d.default.configure({lowlight:ae,defaultLanguage:`plaintext`})];return K&&e.push(x.TextStyle),P&&e.push(m.Link.configure({openOnClick:!1,linkOnPaste:!0,defaultProtocol:`https`})),F&&e.push(y.TaskList,v.TaskItem.configure({nested:!0})),I&&e.push(f.Highlight.configure({multicolor:!0})),R&&e.push(x.Color),z&&e.push(oe.configure({inline:!1,allowBase64:!1})),H&&e.push(_.Table.configure({resizable:!0}),_.TableRow,_.TableHeader,_.TableCell),U&&e.push(ne({enableTaskList:F,enableTable:H,enableImage:z,onImageUpload:W})),G&&e.push(u.CharacterCount.configure({limit:j})),e},[G,r,j,I,K,F,P,R,z,H,U,W]),[le]=(0,a.useState)(()=>{let n=e??t;return n&&B(n,q)}),J=(0,a.useRef)(n);J.current=n;let Y=(0,a.useRef)(null),X=e=>{Y.current&&(clearTimeout(Y.current),Y.current=null,J.current?.(B(e,q)))},ue=(0,a.useRef)(X);ue.current=X;let Z=(0,l.useEditor)({extensions:ce,content:le,editable:!s,shouldRerenderOnTransaction:!1,editorProps:{handleDrop:(e,t)=>{if(!z||!W)return!1;let n=t.dataTransfer?.files?.[0];return n?.type.startsWith(`image/`)?(t.preventDefault(),W(n).then(e=>Z?.chain().focus().setImage({src:e,alt:V(n)}).run()),!0):!1},handlePaste:(e,t)=>{if(!z||!W)return!1;let n=Array.from(t.clipboardData?.items??[]).find(e=>e.type.startsWith(`image/`))?.getAsFile();return n?(t.preventDefault(),W(n).then(e=>Z?.chain().focus().setImage({src:e,alt:V(n)}).run()),!0):!1}},onUpdate:({editor:e})=>{if(N){let t=e.storage.characterCount;N({characters:t.characters(),words:t.words()})}J.current&&(Y.current&&clearTimeout(Y.current),Y.current=setTimeout(()=>X(e.getHTML()),200))},onBlur:({editor:e})=>X(e.getHTML())}),Q=(0,a.useRef)(Z);Q.current=Z,(0,a.useEffect)(()=>()=>{Q.current&&ue.current(Q.current.getHTML())},[]),(0,a.useEffect)(()=>{if(!Z||e===void 0)return;let t=B(e,q);Z.getHTML()!==t&&Z.commands.setContent(t)},[Z,e,q]),(0,a.useEffect)(()=>{Z&&Z.setEditable(!s)},[Z,s]);let de=(0,l.useEditorState)({editor:Z,selector:e=>{let t=e.editor?.storage?.characterCount;return t?t.characters():0}}),fe=(0,l.useEditorState)({editor:Z,selector:e=>{let t=e.editor?.storage?.characterCount;return t?t.words():0}}),pe=M||j!==void 0,me=j!==void 0&&de>j*.9,$=(0,l.useEditorState)({editor:Z,selector:e=>e.editor?{bold:e.editor.isActive(`bold`),italic:e.editor.isActive(`italic`),underline:e.editor.isActive(`underline`),strike:e.editor.isActive(`strike`)}:{bold:!1,italic:!1,underline:!1,strike:!1}});return(0,c.jsxs)(`div`,{"data-slot":`text-editor`,className:(0,o.cn)(`lunas-text-editor`,re({variant:w,size:T}),te),children:[p&&!s&&Z&&(0,c.jsx)(L,{editor:Z,className:k,enableLink:P,enableTaskList:F,enableHighlight:I,enableColor:R,enableImage:z,enableTable:H,onImageUpload:W}),ie&&!s&&Z&&(0,c.jsxs)(ee.BubbleMenu,{editor:Z,options:{placement:`top`},className:(0,o.cn)(`z-50 flex items-center gap-0.5 rounded-md border border-border bg-popover p-1 shadow-dropdown`),children:[(0,c.jsx)(E,{onClick:()=>Z.chain().focus().toggleBold().run(),isActive:$.bold,"aria-label":`In đậm`,title:`Bold (Ctrl+B)`,children:(0,c.jsx)(i.Bold,{className:`h-3.5 w-3.5`})}),(0,c.jsx)(E,{onClick:()=>Z.chain().focus().toggleItalic().run(),isActive:$.italic,"aria-label":`In nghiêng`,title:`Italic (Ctrl+I)`,children:(0,c.jsx)(i.Italic,{className:`h-3.5 w-3.5`})}),(0,c.jsx)(E,{onClick:()=>Z.chain().focus().toggleUnderline().run(),isActive:$.underline,"aria-label":`Gạch chân`,title:`Underline (Ctrl+U)`,children:(0,c.jsx)(i.Underline,{className:`h-3.5 w-3.5`})}),(0,c.jsx)(E,{onClick:()=>Z.chain().focus().toggleStrike().run(),isActive:$.strike,"aria-label":`Gạch ngang`,title:`Strikethrough`,children:(0,c.jsx)(i.Strikethrough,{className:`h-3.5 w-3.5`})}),P&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(D,{}),(0,c.jsx)(O,{editor:Z})]})]}),(0,c.jsx)(l.EditorContent,{editor:Z,"data-slot":`text-editor-content`,className:(0,o.cn)(`flex-1 bg-white text-text-positive`,A)}),pe&&G&&(0,c.jsxs)(`div`,{"data-slot":`text-editor-footer`,className:`flex items-center justify-between border-border border-t bg-muted-muted/30 px-3 py-1 text-text-positive-weak text-xs`,children:[(0,c.jsxs)(`span`,{children:[fe,` words`]}),(0,c.jsxs)(`span`,{"data-warning":me||void 0,className:`data-warning:text-warning-strong`,children:[de,j?` / ${j}`:``,` characters`]})]})]})}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return H}});
|
|
2
|
+
//# sourceMappingURL=text-editor-DWZf3yrW.cjs.map
|