@customafk/lunas-ui 0.2.83 → 0.2.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/dist/LoginPage-DGgThT3s.mjs +2 -0
  2. package/dist/LoginPage-DGgThT3s.mjs.map +1 -0
  3. package/dist/LoginPage-DPUdRD0r.cjs +2 -0
  4. package/dist/LoginPage-DPUdRD0r.cjs.map +1 -0
  5. package/dist/action-submit-B2qFdfi6.cjs +2 -0
  6. package/dist/{action-submit-B9vHpLoN.cjs.map → action-submit-B2qFdfi6.cjs.map} +1 -1
  7. package/dist/action-submit-DyNvI-F2.mjs +2 -0
  8. package/dist/{action-submit-BQdkz4mS.mjs.map → action-submit-DyNvI-F2.mjs.map} +1 -1
  9. package/dist/actions-form-CB0lZlE6.mjs +2 -0
  10. package/dist/{actions-form-D4n1W3-X.mjs.map → actions-form-CB0lZlE6.mjs.map} +1 -1
  11. package/dist/actions-form-DnlpVrgF.cjs +2 -0
  12. package/dist/{actions-form-DF2eYxGQ.cjs.map → actions-form-DnlpVrgF.cjs.map} +1 -1
  13. package/dist/checkbox-field-CFPHAcwN.cjs +2 -0
  14. package/dist/{checkbox-field-ldZRSCca.cjs.map → checkbox-field-CFPHAcwN.cjs.map} +1 -1
  15. package/dist/checkbox-field-DodKeFS_.mjs +2 -0
  16. package/dist/{checkbox-field-BRGTLOjq.mjs.map → checkbox-field-DodKeFS_.mjs.map} +1 -1
  17. package/dist/{cms-layout-BGsf1E4E.cjs → cms-layout-DYEmSqzx.cjs} +2 -2
  18. package/dist/{cms-layout-BGsf1E4E.cjs.map → cms-layout-DYEmSqzx.cjs.map} +1 -1
  19. package/dist/combobox-field-D7cZ8fhZ.cjs +2 -0
  20. package/dist/{combobox-field-ZYr7636s.cjs.map → combobox-field-D7cZ8fhZ.cjs.map} +1 -1
  21. package/dist/combobox-field-ebIvbhJn.mjs +2 -0
  22. package/dist/{combobox-field-CvkdZkQE.mjs.map → combobox-field-ebIvbhJn.mjs.map} +1 -1
  23. package/dist/data-display/country.cjs +1 -1
  24. package/dist/date-field-CNkxebta.mjs +2 -0
  25. package/dist/{date-field-DGMTG_hu.mjs.map → date-field-CNkxebta.mjs.map} +1 -1
  26. package/dist/date-field-Dm367ro9.cjs +2 -0
  27. package/dist/{date-field-1Hmcv8Zp.cjs.map → date-field-Dm367ro9.cjs.map} +1 -1
  28. package/dist/dialog-form-D9Bifsx6.cjs +2 -0
  29. package/dist/{dialog-form-C1qpltYx.cjs.map → dialog-form-D9Bifsx6.cjs.map} +1 -1
  30. package/dist/dialog-form-zK6Gk9Gk.mjs +2 -0
  31. package/dist/{dialog-form-BRSZpRTC.mjs.map → dialog-form-zK6Gk9Gk.mjs.map} +1 -1
  32. package/dist/{dist-DzA--RwW.cjs → dist-CIdWHwhj.cjs} +2 -2
  33. package/dist/{dist-DzA--RwW.cjs.map → dist-CIdWHwhj.cjs.map} +1 -1
  34. package/dist/email-field-BVl7u9pR.mjs +2 -0
  35. package/dist/{email-field-C2Lvl_rQ.mjs.map → email-field-BVl7u9pR.mjs.map} +1 -1
  36. package/dist/email-field-CqXXRG3w.cjs +2 -0
  37. package/dist/{email-field-D3nSkHj2.cjs.map → email-field-CqXXRG3w.cjs.map} +1 -1
  38. package/dist/features/tables/index.d.cts +1 -1
  39. package/dist/features/tables/index.d.mts +1 -1
  40. package/dist/features/tanstack-form/index.cjs +1 -1
  41. package/dist/features/tanstack-form/index.d.cts +1 -1
  42. package/dist/features/tanstack-form/index.d.mts +1 -1
  43. package/dist/features/tanstack-form/index.mjs +1 -1
  44. package/dist/features/text-editor/index.cjs +1 -1
  45. package/dist/features/text-editor/index.d.cts +1 -1
  46. package/dist/features/text-editor/index.d.mts +1 -1
  47. package/dist/features/text-editor/index.mjs +1 -1
  48. package/dist/{flex-C63_IqSY.d.cts → flex-D6RCsrv1.d.cts} +2 -2
  49. package/dist/{flex-C63_IqSY.d.mts → flex-D6RCsrv1.d.mts} +2 -2
  50. package/dist/group-field-8nINgAeO.mjs +2 -0
  51. package/dist/{group-field-gejvx_Td.mjs.map → group-field-8nINgAeO.mjs.map} +1 -1
  52. package/dist/group-field-DfGPDLyp.cjs +2 -0
  53. package/dist/{group-field-sVykO2JZ.cjs.map → group-field-DfGPDLyp.cjs.map} +1 -1
  54. package/dist/{index-DvC1inRy.d.cts → index-0HuXxgjQ.d.cts} +13 -10
  55. package/dist/index-6_zytlWu.d.cts +70 -0
  56. package/dist/index-6_zytlWu.d.mts +70 -0
  57. package/dist/{index-CrkOhm--.d.mts → index-BCBEYTyA.d.mts} +5 -5
  58. package/dist/{index--wNkNzCB.d.cts → index-CQPyC0Q2.d.cts} +5 -5
  59. package/dist/{index-DvC1inRy.d.mts → index-CZ_2KVir.d.mts} +13 -10
  60. package/dist/{index-DRAyYm8g.d.mts → index-CvFEJoon.d.cts} +12 -3
  61. package/dist/{index-DRAyYm8g.d.cts → index-CvFEJoon.d.mts} +12 -3
  62. package/dist/index.cjs +1 -1
  63. package/dist/index.d.cts +6 -6
  64. package/dist/index.d.mts +6 -6
  65. package/dist/index.mjs +1 -1
  66. package/dist/layouts/cms-layout/index.cjs +1 -1
  67. package/dist/layouts/flex.d.cts +1 -1
  68. package/dist/layouts/flex.d.mts +1 -1
  69. package/dist/layouts/payment-layout/index.cjs +1 -1
  70. package/dist/number-field-BjGl_IiN.cjs +2 -0
  71. package/dist/{number-field-CWDYA3La.cjs.map → number-field-BjGl_IiN.cjs.map} +1 -1
  72. package/dist/number-field-CVemIwIg.mjs +2 -0
  73. package/dist/{number-field-CR5PLX6H.mjs.map → number-field-CVemIwIg.mjs.map} +1 -1
  74. package/dist/pages/LoginPage/index.cjs +1 -0
  75. package/dist/pages/LoginPage/index.d.cts +2 -0
  76. package/dist/pages/LoginPage/index.d.mts +2 -0
  77. package/dist/pages/LoginPage/index.mjs +1 -0
  78. package/dist/password-field-Be0Ltlxh.cjs +2 -0
  79. package/dist/{password-field-BHRhVyZ0.cjs.map → password-field-Be0Ltlxh.cjs.map} +1 -1
  80. package/dist/password-field-BxYaT8lO.mjs +2 -0
  81. package/dist/{password-field-B2_kzss6.mjs.map → password-field-BxYaT8lO.mjs.map} +1 -1
  82. package/dist/{payment-layout-BZtIcu-3.cjs → payment-layout-C38xIc2X.cjs} +2 -2
  83. package/dist/{payment-layout-BZtIcu-3.cjs.map → payment-layout-C38xIc2X.cjs.map} +1 -1
  84. package/dist/popover-form-Ba_Nw79b.cjs +2 -0
  85. package/dist/{popover-form-Ch_iMMSm.cjs.map → popover-form-Ba_Nw79b.cjs.map} +1 -1
  86. package/dist/popover-form-C9mNInr2.mjs +2 -0
  87. package/dist/{popover-form-CeRVpy1B.mjs.map → popover-form-C9mNInr2.mjs.map} +1 -1
  88. package/dist/radio-group-field-BCJWamjd.cjs +2 -0
  89. package/dist/{radio-group-field-BFhBfzoT.cjs.map → radio-group-field-BCJWamjd.cjs.map} +1 -1
  90. package/dist/radio-group-field-DYqU_6hW.mjs +2 -0
  91. package/dist/{radio-group-field-Iwo2Q2Ig.mjs.map → radio-group-field-DYqU_6hW.mjs.map} +1 -1
  92. package/dist/{resizable-CNqPu4Ck.d.cts → resizable-DTnfCua-.d.cts} +2 -2
  93. package/dist/{resizable-CNqPu4Ck.d.mts → resizable-DTnfCua-.d.mts} +2 -2
  94. package/dist/rolldown-runtime-DWNI8pZO.cjs +1 -0
  95. package/dist/select-field-D7Ny2Qne.mjs +2 -0
  96. package/dist/{select-field-NJgDDCO2.mjs.map → select-field-D7Ny2Qne.mjs.map} +1 -1
  97. package/dist/select-field-UWnBMAzL.cjs +2 -0
  98. package/dist/{select-field-CvDBZQTl.cjs.map → select-field-UWnBMAzL.cjs.map} +1 -1
  99. package/dist/simple-array-field-BSMxRilE.cjs +2 -0
  100. package/dist/{simple-array-field-aGXkDZXD.cjs.map → simple-array-field-BSMxRilE.cjs.map} +1 -1
  101. package/dist/simple-array-field-DJXa_vST.mjs +2 -0
  102. package/dist/{simple-array-field-BwNCeUnn.mjs.map → simple-array-field-DJXa_vST.mjs.map} +1 -1
  103. package/dist/simple-boolean-field-CVNT8NBk.mjs +2 -0
  104. package/dist/{simple-boolean-field-t_XDXqYs.mjs.map → simple-boolean-field-CVNT8NBk.mjs.map} +1 -1
  105. package/dist/simple-boolean-field-CxAyVQ1w.cjs +2 -0
  106. package/dist/{simple-boolean-field-BeVkn3c4.cjs.map → simple-boolean-field-CxAyVQ1w.cjs.map} +1 -1
  107. package/dist/simple-combobox-field-BP4IeDkA.cjs +2 -0
  108. package/dist/{simple-combobox-field-U0ZAl7VQ.cjs.map → simple-combobox-field-BP4IeDkA.cjs.map} +1 -1
  109. package/dist/simple-combobox-field-BnAUDfQU.mjs +2 -0
  110. package/dist/{simple-combobox-field-HCB4A33-.mjs.map → simple-combobox-field-BnAUDfQU.mjs.map} +1 -1
  111. package/dist/simple-date-field-DIa6UBF2.mjs +2 -0
  112. package/dist/{simple-date-field-Dj4bJoji.mjs.map → simple-date-field-DIa6UBF2.mjs.map} +1 -1
  113. package/dist/simple-date-field-NSawlSff.cjs +2 -0
  114. package/dist/{simple-date-field-DtxEpEZj.cjs.map → simple-date-field-NSawlSff.cjs.map} +1 -1
  115. package/dist/simple-email-field-2Abh3qZw.cjs +2 -0
  116. package/dist/{simple-email-field-DK9I_Tc_.cjs.map → simple-email-field-2Abh3qZw.cjs.map} +1 -1
  117. package/dist/simple-email-field-CKDQgzh5.mjs +2 -0
  118. package/dist/{simple-email-field-BDyhkmHV.mjs.map → simple-email-field-CKDQgzh5.mjs.map} +1 -1
  119. package/dist/simple-number-field-BjEYE54F.cjs +2 -0
  120. package/dist/{simple-number-field-BspqWU-3.cjs.map → simple-number-field-BjEYE54F.cjs.map} +1 -1
  121. package/dist/simple-number-field-SDbxL6L7.mjs +2 -0
  122. package/dist/{simple-number-field-hneXMhfJ.mjs.map → simple-number-field-SDbxL6L7.mjs.map} +1 -1
  123. package/dist/simple-password-field-Cjp6yzWd.cjs +2 -0
  124. package/dist/{simple-password-field-BEEcleom.cjs.map → simple-password-field-Cjp6yzWd.cjs.map} +1 -1
  125. package/dist/simple-password-field-Cnj-hf5g.mjs +2 -0
  126. package/dist/{simple-password-field-vsLRHDk4.mjs.map → simple-password-field-Cnj-hf5g.mjs.map} +1 -1
  127. package/dist/simple-radio-group-field-4-eWSXY7.mjs +2 -0
  128. package/dist/{simple-radio-group-field-BURm_BSA.mjs.map → simple-radio-group-field-4-eWSXY7.mjs.map} +1 -1
  129. package/dist/simple-radio-group-field-CuA0Q-XI.cjs +2 -0
  130. package/dist/{simple-radio-group-field-Wm8xB0fN.cjs.map → simple-radio-group-field-CuA0Q-XI.cjs.map} +1 -1
  131. package/dist/simple-select-field-C0ecQx68.mjs +2 -0
  132. package/dist/{simple-select-field-8cY51U4d.mjs.map → simple-select-field-C0ecQx68.mjs.map} +1 -1
  133. package/dist/simple-select-field-CXYJcRY2.cjs +2 -0
  134. package/dist/{simple-select-field-QQ65caBf.cjs.map → simple-select-field-CXYJcRY2.cjs.map} +1 -1
  135. package/dist/simple-text-field-DJl5SIGn.mjs +2 -0
  136. package/dist/{simple-text-field-DK72_OA_.mjs.map → simple-text-field-DJl5SIGn.mjs.map} +1 -1
  137. package/dist/simple-text-field-DPXqNCXh.cjs +2 -0
  138. package/dist/{simple-text-field-BHkCPiE5.cjs.map → simple-text-field-DPXqNCXh.cjs.map} +1 -1
  139. package/dist/simple-textarea-field-BcHdUMTK.mjs +2 -0
  140. package/dist/{simple-textarea-field-B72nNQHv.mjs.map → simple-textarea-field-BcHdUMTK.mjs.map} +1 -1
  141. package/dist/simple-textarea-field-ZpXPwYz-.cjs +2 -0
  142. package/dist/{simple-textarea-field-Bu5h7sfH.cjs.map → simple-textarea-field-ZpXPwYz-.cjs.map} +1 -1
  143. package/dist/switch-field-CCDuDdpf.cjs +2 -0
  144. package/dist/{switch-field-eLVlQZSI.cjs.map → switch-field-CCDuDdpf.cjs.map} +1 -1
  145. package/dist/switch-field-DBGFsmEZ.mjs +2 -0
  146. package/dist/{switch-field-DoPUWb9d.mjs.map → switch-field-DBGFsmEZ.mjs.map} +1 -1
  147. package/dist/tanstack-form-BhKAn9I0.mjs +2 -0
  148. package/dist/tanstack-form-BhKAn9I0.mjs.map +1 -0
  149. package/dist/tanstack-form-DCB2addt.cjs +2 -0
  150. package/dist/tanstack-form-DCB2addt.cjs.map +1 -0
  151. package/dist/text-editor-DWZf3yrW.cjs +2 -0
  152. package/dist/text-editor-DWZf3yrW.cjs.map +1 -0
  153. package/dist/text-editor-XBOAwJk-.mjs +2 -0
  154. package/dist/text-editor-XBOAwJk-.mjs.map +1 -0
  155. package/dist/text-field-Bx_vnc4O.mjs +2 -0
  156. package/dist/{text-field-Bm-k6Jr7.mjs.map → text-field-Bx_vnc4O.mjs.map} +1 -1
  157. package/dist/text-field-DMZZ6CND.cjs +2 -0
  158. package/dist/{text-field-DT50dOVI.cjs.map → text-field-DMZZ6CND.cjs.map} +1 -1
  159. package/dist/textarea-field-BmImMdg-.cjs +2 -0
  160. package/dist/{textarea-field-BhqX29CS.cjs.map → textarea-field-BmImMdg-.cjs.map} +1 -1
  161. package/dist/textarea-field-Cim3l0y8.mjs +2 -0
  162. package/dist/{textarea-field-DNLyrRH7.mjs.map → textarea-field-Cim3l0y8.mjs.map} +1 -1
  163. package/dist/title-field-2dABwspv.mjs +2 -0
  164. package/dist/{title-field-oAqHRw59.mjs.map → title-field-2dABwspv.mjs.map} +1 -1
  165. package/dist/title-field-CFnSgTGH.cjs +2 -0
  166. package/dist/{title-field-B2hM3S_S.cjs.map → title-field-CFnSgTGH.cjs.map} +1 -1
  167. package/dist/ui/breadcrumb.cjs +1 -1
  168. package/dist/ui/button-group.cjs +1 -1
  169. package/dist/ui/button.cjs +1 -1
  170. package/dist/ui/carousel.cjs +1 -1
  171. package/dist/ui/dropdown-menu.cjs +1 -1
  172. package/dist/ui/dropdown-menu.cjs.map +1 -1
  173. package/dist/ui/dropdown-menu.mjs +1 -1
  174. package/dist/ui/dropdown-menu.mjs.map +1 -1
  175. package/dist/ui/file-uploader.cjs +1 -1
  176. package/dist/ui/item.cjs +1 -1
  177. package/dist/ui/resizable.cjs +1 -1
  178. package/dist/ui/resizable.d.cts +1 -1
  179. package/dist/ui/resizable.d.mts +1 -1
  180. package/package.json +9 -4
  181. package/styles/text-editor.css +205 -38
  182. package/dist/LoginPage-DDljzV6A.d.cts +0 -43
  183. package/dist/LoginPage-DDljzV6A.d.mts +0 -43
  184. package/dist/action-submit-B9vHpLoN.cjs +0 -2
  185. package/dist/action-submit-BQdkz4mS.mjs +0 -2
  186. package/dist/actions-form-D4n1W3-X.mjs +0 -2
  187. package/dist/actions-form-DF2eYxGQ.cjs +0 -2
  188. package/dist/checkbox-field-BRGTLOjq.mjs +0 -2
  189. package/dist/checkbox-field-ldZRSCca.cjs +0 -2
  190. package/dist/combobox-field-CvkdZkQE.mjs +0 -2
  191. package/dist/combobox-field-ZYr7636s.cjs +0 -2
  192. package/dist/date-field-1Hmcv8Zp.cjs +0 -2
  193. package/dist/date-field-DGMTG_hu.mjs +0 -2
  194. package/dist/dialog-form-BRSZpRTC.mjs +0 -2
  195. package/dist/dialog-form-C1qpltYx.cjs +0 -2
  196. package/dist/email-field-C2Lvl_rQ.mjs +0 -2
  197. package/dist/email-field-D3nSkHj2.cjs +0 -2
  198. package/dist/field-BSLi-P0Q.cjs +0 -2
  199. package/dist/field-BSLi-P0Q.cjs.map +0 -1
  200. package/dist/field-V2DoD8qL.mjs +0 -2
  201. package/dist/field-V2DoD8qL.mjs.map +0 -1
  202. package/dist/group-field-gejvx_Td.mjs +0 -2
  203. package/dist/group-field-sVykO2JZ.cjs +0 -2
  204. package/dist/number-field-CR5PLX6H.mjs +0 -2
  205. package/dist/number-field-CWDYA3La.cjs +0 -2
  206. package/dist/pages/LoginPage.cjs +0 -2
  207. package/dist/pages/LoginPage.cjs.map +0 -1
  208. package/dist/pages/LoginPage.d.cts +0 -2
  209. package/dist/pages/LoginPage.d.mts +0 -2
  210. package/dist/pages/LoginPage.mjs +0 -2
  211. package/dist/pages/LoginPage.mjs.map +0 -1
  212. package/dist/password-field-B2_kzss6.mjs +0 -2
  213. package/dist/password-field-BHRhVyZ0.cjs +0 -2
  214. package/dist/popover-form-CeRVpy1B.mjs +0 -2
  215. package/dist/popover-form-Ch_iMMSm.cjs +0 -2
  216. package/dist/radio-group-field-BFhBfzoT.cjs +0 -2
  217. package/dist/radio-group-field-Iwo2Q2Ig.mjs +0 -2
  218. package/dist/rolldown-runtime-CMqjfN_6.cjs +0 -1
  219. package/dist/select-field-CvDBZQTl.cjs +0 -2
  220. package/dist/select-field-NJgDDCO2.mjs +0 -2
  221. package/dist/simple-array-field-BwNCeUnn.mjs +0 -2
  222. package/dist/simple-array-field-aGXkDZXD.cjs +0 -2
  223. package/dist/simple-boolean-field-BeVkn3c4.cjs +0 -2
  224. package/dist/simple-boolean-field-t_XDXqYs.mjs +0 -2
  225. package/dist/simple-combobox-field-HCB4A33-.mjs +0 -2
  226. package/dist/simple-combobox-field-U0ZAl7VQ.cjs +0 -2
  227. package/dist/simple-date-field-Dj4bJoji.mjs +0 -2
  228. package/dist/simple-date-field-DtxEpEZj.cjs +0 -2
  229. package/dist/simple-email-field-BDyhkmHV.mjs +0 -2
  230. package/dist/simple-email-field-DK9I_Tc_.cjs +0 -2
  231. package/dist/simple-number-field-BspqWU-3.cjs +0 -2
  232. package/dist/simple-number-field-hneXMhfJ.mjs +0 -2
  233. package/dist/simple-password-field-BEEcleom.cjs +0 -2
  234. package/dist/simple-password-field-vsLRHDk4.mjs +0 -2
  235. package/dist/simple-radio-group-field-BURm_BSA.mjs +0 -2
  236. package/dist/simple-radio-group-field-Wm8xB0fN.cjs +0 -2
  237. package/dist/simple-select-field-8cY51U4d.mjs +0 -2
  238. package/dist/simple-select-field-QQ65caBf.cjs +0 -2
  239. package/dist/simple-text-field-BHkCPiE5.cjs +0 -2
  240. package/dist/simple-text-field-DK72_OA_.mjs +0 -2
  241. package/dist/simple-textarea-field-B72nNQHv.mjs +0 -2
  242. package/dist/simple-textarea-field-Bu5h7sfH.cjs +0 -2
  243. package/dist/switch-field-DoPUWb9d.mjs +0 -2
  244. package/dist/switch-field-eLVlQZSI.cjs +0 -2
  245. package/dist/tanstack-form-C0ab8EEl.cjs +0 -2
  246. package/dist/tanstack-form-C0ab8EEl.cjs.map +0 -1
  247. package/dist/tanstack-form-fkaBh9RO.mjs +0 -2
  248. package/dist/tanstack-form-fkaBh9RO.mjs.map +0 -1
  249. package/dist/text-editor-BtfyZSgR.cjs +0 -2
  250. package/dist/text-editor-BtfyZSgR.cjs.map +0 -1
  251. package/dist/text-editor-CtR27_PR.mjs +0 -2
  252. package/dist/text-editor-CtR27_PR.mjs.map +0 -1
  253. package/dist/text-editor-field-B6HEsAHt.mjs +0 -2
  254. package/dist/text-editor-field-B6HEsAHt.mjs.map +0 -1
  255. package/dist/text-editor-field-DcEUC0iH.cjs +0 -2
  256. package/dist/text-editor-field-DcEUC0iH.cjs.map +0 -1
  257. package/dist/text-field-Bm-k6Jr7.mjs +0 -2
  258. package/dist/text-field-DT50dOVI.cjs +0 -2
  259. package/dist/textarea-field-BhqX29CS.cjs +0 -2
  260. package/dist/textarea-field-DNLyrRH7.mjs +0 -2
  261. package/dist/title-field-B2hM3S_S.cjs +0 -2
  262. package/dist/title-field-oAqHRw59.mjs +0 -2
@@ -1,10 +1,19 @@
1
- /* ProseMirror editor content styles */
1
+ /* ProseMirror editor content styles
2
+ Font sizes/margins below use `em` (not `rem`) so the whole type scale — headings,
3
+ paragraphs, lists — scales together with the `size` variant (sm/md/lg sets the
4
+ component's own font-size; `rem` would ignore that and always read the page root). */
2
5
  .lunas-text-editor .ProseMirror {
3
6
  outline: none;
4
7
  min-height: 8rem;
5
8
  padding: 0.5rem 0.75rem;
6
9
  }
7
10
 
11
+ /* First block shouldn't carry its normal top margin — avoids a lopsided gap before the
12
+ very first heading/paragraph in the document. */
13
+ .lunas-text-editor .ProseMirror > :first-child {
14
+ margin-top: 0 !important;
15
+ }
16
+
8
17
  /* Placeholder */
9
18
  .lunas-text-editor .ProseMirror p.is-editor-empty:first-child::before {
10
19
  color: var(--text-positive-muted);
@@ -14,46 +23,58 @@
14
23
  pointer-events: none;
15
24
  }
16
25
 
17
- /* Headings */
26
+ /* Headings — tighter line-height and slight negative tracking at large sizes reads as
27
+ more "designed", the way editorial/essay typography usually looks; generous margin-top
28
+ separates sections while margin-bottom stays tight so a heading visually "owns" the
29
+ paragraph that follows it. */
18
30
  .lunas-text-editor .ProseMirror h1 {
19
- font-size: 1.875rem;
20
- font-weight: 700;
21
- line-height: 2.25rem;
31
+ font-size: 2em;
32
+ font-weight: 800;
33
+ line-height: 1.25;
34
+ letter-spacing: -0.02em;
22
35
  color: var(--text-positive-strong);
23
- margin-top: 1.25rem;
24
- margin-bottom: 0.5rem;
36
+ margin-top: 1.6em;
37
+ margin-bottom: 0.6em;
38
+ text-wrap: pretty;
25
39
  }
26
40
 
27
41
  .lunas-text-editor .ProseMirror h2 {
28
- font-size: 1.5rem;
29
- font-weight: 600;
30
- line-height: 2rem;
42
+ font-size: 1.5em;
43
+ font-weight: 700;
44
+ line-height: 1.3;
45
+ letter-spacing: -0.015em;
31
46
  color: var(--text-positive-strong);
32
- margin-top: 1rem;
33
- margin-bottom: 0.5rem;
47
+ margin-top: 1.5em;
48
+ margin-bottom: 0.6em;
49
+ text-wrap: pretty;
34
50
  }
35
51
 
36
52
  .lunas-text-editor .ProseMirror h3 {
37
- font-size: 1.25rem;
53
+ font-size: 1.25em;
38
54
  font-weight: 600;
39
- line-height: 1.75rem;
55
+ line-height: 1.4;
40
56
  color: var(--text-positive-strong);
41
- margin-top: 0.875rem;
42
- margin-bottom: 0.375rem;
57
+ margin-top: 1.3em;
58
+ margin-bottom: 0.5em;
59
+ text-wrap: pretty;
43
60
  }
44
61
 
45
- /* Paragraph */
62
+ /* Paragraph — 1.75 line-height and bottom-only margin is the standard "comfortable long-form
63
+ reading" combination (matches what most editorial/blog typesetting uses); `text-wrap: pretty`
64
+ avoids single short words getting orphaned onto their own line. */
46
65
  .lunas-text-editor .ProseMirror p {
47
- margin: 0.25rem 0;
66
+ font-size: 1em;
67
+ margin: 0 0 1.15em;
48
68
  color: var(--text-positive);
49
- line-height: 1.625;
69
+ line-height: 1.75;
70
+ text-wrap: pretty;
50
71
  }
51
72
 
52
73
  /* Lists */
53
74
  .lunas-text-editor .ProseMirror ul,
54
75
  .lunas-text-editor .ProseMirror ol {
55
- padding-left: 1.5rem;
56
- margin: 0.5rem 0;
76
+ padding-left: 1.5em;
77
+ margin: 0 0 1.15em;
57
78
  color: var(--text-positive);
58
79
  }
59
80
 
@@ -61,24 +82,67 @@
61
82
  list-style-type: disc;
62
83
  }
63
84
 
85
+ .lunas-text-editor .ProseMirror ul ul {
86
+ list-style-type: circle;
87
+ }
88
+
89
+ .lunas-text-editor .ProseMirror ul ul ul {
90
+ list-style-type: square;
91
+ }
92
+
93
+ /* Nested lists sit inside a parent `<li>` — reset that inherited bottom margin so the
94
+ nested block hugs its parent item instead of adding extra gap before the next sibling. */
95
+ .lunas-text-editor .ProseMirror li > ul,
96
+ .lunas-text-editor .ProseMirror li > ol {
97
+ margin: 0.4em 0 0;
98
+ }
99
+
100
+ /* Ordered lists use CSS counters (not `list-style-type`) so nested levels chain the
101
+ parent's number — 1, 2 → 1.1, 1.2 → 1.1.1, 1.1.2 — instead of restarting at a/b/c. */
64
102
  .lunas-text-editor .ProseMirror ol {
65
- list-style-type: decimal;
103
+ list-style: none;
104
+ counter-reset: list-item;
105
+ padding-left: 2.25em;
106
+ }
107
+
108
+ .lunas-text-editor .ProseMirror ol > li {
109
+ counter-increment: list-item;
110
+ position: relative;
111
+ }
112
+
113
+ .lunas-text-editor .ProseMirror ol > li::before {
114
+ /* `right: 100%` anchors the marker's right edge to the left edge of `li` (its
115
+ containing block) — the box then auto-sizes to content, so it works at any nesting
116
+ depth without a fixed width. Non-breaking spaces (regular trailing spaces get
117
+ trimmed by normal CSS whitespace rules) guarantee a real gap before the item text. */
118
+ content: counters(list-item, '.') '.\00a0\00a0';
119
+ position: absolute;
120
+ right: 100%;
121
+ color: var(--text-positive-weak);
122
+ font-variant-numeric: tabular-nums;
123
+ white-space: nowrap;
66
124
  }
67
125
 
68
126
  .lunas-text-editor .ProseMirror li {
69
- margin: 0.125rem 0;
70
- line-height: 1.625;
127
+ margin: 0.35em 0;
128
+ line-height: 1.75;
71
129
  }
72
130
 
73
131
  /* Blockquote */
74
132
  .lunas-text-editor .ProseMirror blockquote {
75
133
  border-left: 3px solid var(--primary-weak);
76
- padding-left: 1rem;
77
- margin: 0.75rem 0;
134
+ padding-left: 1.1em;
135
+ margin: 1.3em 0;
78
136
  color: var(--text-positive-weak);
137
+ font-size: 1.05em;
138
+ line-height: 1.7;
79
139
  font-style: italic;
80
140
  }
81
141
 
142
+ .lunas-text-editor .ProseMirror blockquote p {
143
+ margin: 0;
144
+ }
145
+
82
146
  /* Inline code */
83
147
  .lunas-text-editor .ProseMirror code {
84
148
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
@@ -95,10 +159,11 @@
95
159
  background-color: var(--muted-intense);
96
160
  color: var(--text-negative);
97
161
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
98
- font-size: 0.875rem;
162
+ font-size: 0.9em;
163
+ line-height: 1.6;
99
164
  border-radius: 0.375rem;
100
- padding: 0.75rem 1rem;
101
- margin: 0.75rem 0;
165
+ padding: 0.9em 1.1em;
166
+ margin: 1.15em 0;
102
167
  overflow-x: auto;
103
168
  }
104
169
 
@@ -114,12 +179,12 @@
114
179
  .lunas-text-editor .ProseMirror hr {
115
180
  border: none;
116
181
  border-top: 1px solid var(--border);
117
- margin: 1rem 0;
182
+ margin: 2em 0;
118
183
  }
119
184
 
120
185
  /* Strong / Bold */
121
186
  .lunas-text-editor .ProseMirror strong {
122
- font-weight: 600;
187
+ font-weight: 700;
123
188
  color: var(--text-positive-strong);
124
189
  }
125
190
 
@@ -161,36 +226,138 @@
161
226
  .lunas-text-editor .ProseMirror ul[data-type='taskList'] {
162
227
  list-style: none;
163
228
  padding-left: 0;
164
- margin: 0.5rem 0;
229
+ margin: 0 0 1.15em;
165
230
  }
166
231
 
167
232
  .lunas-text-editor .ProseMirror ul[data-type='taskList'] li {
168
233
  display: flex;
169
234
  align-items: flex-start;
170
- gap: 0.5rem;
171
- padding: 0.125rem 0;
235
+ gap: 0.5em;
236
+ padding: 0.2em 0;
172
237
  margin: 0;
173
238
  }
174
239
 
175
240
  .lunas-text-editor .ProseMirror ul[data-type='taskList'] li > label {
176
241
  flex: 0 0 auto;
177
242
  user-select: none;
178
- margin-top: 0.2rem;
243
+ margin-top: 0.25em;
179
244
  }
180
245
 
181
246
  .lunas-text-editor .ProseMirror ul[data-type='taskList'] li > label input[type='checkbox'] {
182
247
  cursor: pointer;
183
248
  accent-color: var(--primary);
184
- width: 0.875rem;
185
- height: 0.875rem;
249
+ width: 0.875em;
250
+ height: 0.875em;
186
251
  }
187
252
 
188
253
  .lunas-text-editor .ProseMirror ul[data-type='taskList'] li > div {
189
254
  flex: 1;
190
- line-height: 1.625;
255
+ line-height: 1.75;
191
256
  }
192
257
 
193
258
  .lunas-text-editor .ProseMirror ul[data-type='taskList'] li[data-checked='true'] > div {
194
259
  color: var(--text-positive-weak);
195
260
  text-decoration: line-through;
196
261
  }
262
+
263
+ /* Image — centering, spacing, selected-state, and the caption link are all handled by
264
+ `ImageNodeView` (Tailwind classes) since the image is rendered via a React node view,
265
+ not plain HTML. Nothing to style here. */
266
+
267
+ /* Table */
268
+ .lunas-text-editor .ProseMirror table {
269
+ border-collapse: collapse;
270
+ table-layout: fixed;
271
+ width: 100%;
272
+ margin: 1.3em 0;
273
+ font-size: 0.95em;
274
+ overflow: hidden;
275
+ }
276
+
277
+ .lunas-text-editor .ProseMirror th,
278
+ .lunas-text-editor .ProseMirror td {
279
+ border: 1px solid var(--border);
280
+ padding: 0.6em 0.75em;
281
+ line-height: 1.5;
282
+ vertical-align: top;
283
+ color: var(--text-positive);
284
+ position: relative;
285
+ }
286
+
287
+ .lunas-text-editor .ProseMirror th {
288
+ background-color: var(--muted-muted);
289
+ color: var(--text-positive-strong);
290
+ font-weight: 600;
291
+ text-align: left;
292
+ }
293
+
294
+ .lunas-text-editor .ProseMirror .selectedCell::after {
295
+ content: '';
296
+ position: absolute;
297
+ inset: 0;
298
+ background-color: var(--primary-muted);
299
+ opacity: 0.5;
300
+ pointer-events: none;
301
+ }
302
+
303
+ .lunas-text-editor .ProseMirror .column-resize-handle {
304
+ position: absolute;
305
+ top: 0;
306
+ bottom: -2px;
307
+ right: -2px;
308
+ width: 4px;
309
+ background-color: var(--primary);
310
+ pointer-events: none;
311
+ }
312
+
313
+ /* Code block syntax highlighting (lowlight/highlight.js token classes) */
314
+ .lunas-text-editor .ProseMirror pre .hljs-comment,
315
+ .lunas-text-editor .ProseMirror pre .hljs-quote {
316
+ color: #5c6370;
317
+ font-style: italic;
318
+ }
319
+
320
+ .lunas-text-editor .ProseMirror pre .hljs-keyword,
321
+ .lunas-text-editor .ProseMirror pre .hljs-selector-tag,
322
+ .lunas-text-editor .ProseMirror pre .hljs-tag {
323
+ color: #c678dd;
324
+ }
325
+
326
+ .lunas-text-editor .ProseMirror pre .hljs-string,
327
+ .lunas-text-editor .ProseMirror pre .hljs-symbol,
328
+ .lunas-text-editor .ProseMirror pre .hljs-bullet,
329
+ .lunas-text-editor .ProseMirror pre .hljs-addition {
330
+ color: #98c379;
331
+ }
332
+
333
+ .lunas-text-editor .ProseMirror pre .hljs-number,
334
+ .lunas-text-editor .ProseMirror pre .hljs-literal {
335
+ color: #d19a66;
336
+ }
337
+
338
+ .lunas-text-editor .ProseMirror pre .hljs-title,
339
+ .lunas-text-editor .ProseMirror pre .hljs-title.function_,
340
+ .lunas-text-editor .ProseMirror pre .hljs-built_in {
341
+ color: #61afef;
342
+ }
343
+
344
+ .lunas-text-editor .ProseMirror pre .hljs-attr,
345
+ .lunas-text-editor .ProseMirror pre .hljs-attribute,
346
+ .lunas-text-editor .ProseMirror pre .hljs-variable,
347
+ .lunas-text-editor .ProseMirror pre .hljs-params,
348
+ .lunas-text-editor .ProseMirror pre .hljs-name,
349
+ .lunas-text-editor .ProseMirror pre .hljs-deletion {
350
+ color: #e06c75;
351
+ }
352
+
353
+ .lunas-text-editor .ProseMirror pre .hljs-meta {
354
+ color: #56b6c2;
355
+ }
356
+
357
+ .lunas-text-editor .ProseMirror pre .hljs-emphasis {
358
+ font-style: italic;
359
+ }
360
+
361
+ .lunas-text-editor .ProseMirror pre .hljs-strong {
362
+ font-weight: 700;
363
+ }
@@ -1,43 +0,0 @@
1
- //#region packages/components/pages/LoginPage.d.ts
2
- interface LoginPageProps {
3
- /** Controls whether the dialog is open */
4
- open: boolean;
5
- /** Called when the dialog open state changes */
6
- onOpenChange: (open: boolean) => void;
7
- /** Called when the user submits login credentials */
8
- onLogin: (email: string, password: string) => Promise<void> | void;
9
- /** Called when the "Quên mật khẩu?" link is clicked */
10
- onForgotPassword?: () => void;
11
- /** Called when the "Đăng ký" link is clicked */
12
- onRegister?: () => void;
13
- /** Disables the form and shows a spinner on the submit button */
14
- isLoading?: boolean;
15
- /** Server-side error message rendered in a destructive Alert */
16
- errorMessage?: string;
17
- /** Dialog heading. Default: "Đăng nhập" */
18
- title?: string;
19
- /** Dialog subheading. Default: "Nhập thông tin để tiếp tục" */
20
- subtitle?: string;
21
- }
22
- /**
23
- * Modal login dialog for the client authentication flow.
24
- *
25
- * @example
26
- * ```tsx
27
- * import { LoginPage } from '@customafk/lunas-ui/pages/LoginPage';
28
- *
29
- * <LoginPage
30
- * open={open}
31
- * onOpenChange={setOpen}
32
- * onLogin={async (email, password) => {
33
- * await authService.login(email, password);
34
- * setOpen(false);
35
- * }}
36
- * onRegister={() => { setOpen(false); setRegisterOpen(true); }}
37
- * />
38
- * ```
39
- */
40
- declare const LoginPage: ({ open, onOpenChange, onLogin, onForgotPassword, onRegister, isLoading, errorMessage, title, subtitle }: LoginPageProps) => import("react").JSX.Element;
41
- //#endregion
42
- export { LoginPageProps as n, LoginPage as t };
43
- //# sourceMappingURL=LoginPage-DDljzV6A.d.cts.map
@@ -1,43 +0,0 @@
1
- //#region packages/components/pages/LoginPage.d.ts
2
- interface LoginPageProps {
3
- /** Controls whether the dialog is open */
4
- open: boolean;
5
- /** Called when the dialog open state changes */
6
- onOpenChange: (open: boolean) => void;
7
- /** Called when the user submits login credentials */
8
- onLogin: (email: string, password: string) => Promise<void> | void;
9
- /** Called when the "Quên mật khẩu?" link is clicked */
10
- onForgotPassword?: () => void;
11
- /** Called when the "Đăng ký" link is clicked */
12
- onRegister?: () => void;
13
- /** Disables the form and shows a spinner on the submit button */
14
- isLoading?: boolean;
15
- /** Server-side error message rendered in a destructive Alert */
16
- errorMessage?: string;
17
- /** Dialog heading. Default: "Đăng nhập" */
18
- title?: string;
19
- /** Dialog subheading. Default: "Nhập thông tin để tiếp tục" */
20
- subtitle?: string;
21
- }
22
- /**
23
- * Modal login dialog for the client authentication flow.
24
- *
25
- * @example
26
- * ```tsx
27
- * import { LoginPage } from '@customafk/lunas-ui/pages/LoginPage';
28
- *
29
- * <LoginPage
30
- * open={open}
31
- * onOpenChange={setOpen}
32
- * onLogin={async (email, password) => {
33
- * await authService.login(email, password);
34
- * setOpen(false);
35
- * }}
36
- * onRegister={() => { setOpen(false); setRegisterOpen(true); }}
37
- * />
38
- * ```
39
- */
40
- declare const LoginPage: ({ open, onOpenChange, onLogin, onForgotPassword, onRegister, isLoading, errorMessage, title, subtitle }: LoginPageProps) => import("react").JSX.Element;
41
- //#endregion
42
- export { LoginPageProps as n, LoginPage as t };
43
- //# sourceMappingURL=LoginPage-DDljzV6A.d.mts.map
@@ -1,2 +0,0 @@
1
- const e=require("./ui/button.cjs"),t=require("./tanstack-form-C0ab8EEl.cjs");let n=require("react"),r=require("@customafk/react-toolkit/utils"),i=require("react/jsx-runtime");const a=({label:a,className:o})=>{let s=t.K(),c=(0,n.useCallback)(async()=>{await s.handleSubmit({submitAction:`submit`}),s.state.isSubmitSuccessful&&s.reset()},[s]);return(0,i.jsx)(s.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:n})=>(0,i.jsx)(e.Button,{type:`button`,size:`md`,disabled:t,isLoading:n,className:(0,r.cn)(`min-h-8 min-w-32`,o),onClick:c,children:a??`Xác nhận`})})};exports.TanStackActionSubmit=a;
2
- //# sourceMappingURL=action-submit-B9vHpLoN.cjs.map
@@ -1,2 +0,0 @@
1
- import{Button as e}from"./ui/button.mjs";import{K as t}from"./tanstack-form-fkaBh9RO.mjs";import{useCallback as n}from"react";import{cn as r}from"@customafk/react-toolkit/utils";import{jsx as i}from"react/jsx-runtime";const a=({label:a,className:o})=>{let s=t(),c=n(async()=>{await s.handleSubmit({submitAction:`submit`}),s.state.isSubmitSuccessful&&s.reset()},[s]);return i(s.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:n})=>i(e,{type:`button`,size:`md`,disabled:t,isLoading:n,className:r(`min-h-8 min-w-32`,o),onClick:c,children:a??`Xác nhận`})})};export{a as TanStackActionSubmit};
2
- //# sourceMappingURL=action-submit-BQdkz4mS.mjs.map
@@ -1,2 +0,0 @@
1
- import{Button as e}from"./ui/button.mjs";import{K as t}from"./tanstack-form-fkaBh9RO.mjs";import{ArrowDownToLine as n,PlusIcon as r}from"lucide-react";import{jsx as i,jsxs as a}from"react/jsx-runtime";const o=({type:o=`create`})=>{let s=t();return a(`div`,{className:`flex h-8 items-center justify-between`,children:[i(s.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:t})=>i(e,{color:`muted`,variant:`outline`,type:`button`,size:`md`,disabled:t,className:`h-full min-w-32`,onClick:()=>s.reset(),children:`Hủy bỏ`})}),o===`create`&&i(s.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:n})=>a(e,{type:`submit`,size:`md`,disabled:t,isLoading:n,className:`h-full min-w-32`,onClick:async()=>{await s.handleSubmit({submitAction:`create`}),s.state.isSubmitSuccessful&&s.reset()},children:[i(r,{}),`Thêm mới`]})}),o===`update`&&i(s.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:r})=>a(e,{type:`submit`,size:`md`,disabled:t,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await s.handleSubmit({submitAction:`update`}),s.state.isSubmitSuccessful&&s.reset()},children:[i(n,{}),`Cập nhật`]})})]})};export{o as TanStackActionsForm};
2
- //# sourceMappingURL=actions-form-D4n1W3-X.mjs.map
@@ -1,2 +0,0 @@
1
- const e=require("./ui/button.cjs"),t=require("./tanstack-form-C0ab8EEl.cjs");let n=require("lucide-react"),r=require("react/jsx-runtime");const i=({type:i=`create`})=>{let a=t.K();return(0,r.jsxs)(`div`,{className:`flex h-8 items-center justify-between`,children:[(0,r.jsx)(a.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:t})=>(0,r.jsx)(e.Button,{color:`muted`,variant:`outline`,type:`button`,size:`md`,disabled:t,className:`h-full min-w-32`,onClick:()=>a.reset(),children:`Hủy bỏ`})}),i===`create`&&(0,r.jsx)(a.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:i})=>(0,r.jsxs)(e.Button,{type:`submit`,size:`md`,disabled:t,isLoading:i,className:`h-full min-w-32`,onClick:async()=>{await a.handleSubmit({submitAction:`create`}),a.state.isSubmitSuccessful&&a.reset()},children:[(0,r.jsx)(n.PlusIcon,{}),`Thêm mới`]})}),i===`update`&&(0,r.jsx)(a.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:i})=>(0,r.jsxs)(e.Button,{type:`submit`,size:`md`,disabled:t,isLoading:i,className:`h-full min-w-32`,onClick:async()=>{await a.handleSubmit({submitAction:`update`}),a.state.isSubmitSuccessful&&a.reset()},children:[(0,r.jsx)(n.ArrowDownToLine,{}),`Cập nhật`]})})]})};exports.TanStackActionsForm=i;
2
- //# sourceMappingURL=actions-form-DF2eYxGQ.cjs.map
@@ -1,2 +0,0 @@
1
- import{Checkbox as e}from"./ui/checkbox.mjs";import{G as t}from"./tanstack-form-fkaBh9RO.mjs";import{Field as n,FieldContent as r,FieldContentMain as i,FieldDescription as a,FieldGroup as o,FieldLabel as s,FieldNote as c,FieldSeparator as l,FieldTooltip as u}from"./field-V2DoD8qL.mjs";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{useStore as p}from"@tanstack/react-form";const m=({label:m,description:h,options:g,tooltip:_,helperText:v,orientation:y})=>{let b=t(),x=p(b.form.store,({isSubmitting:e})=>e);return f(o,{className:`gap-y-4 px-4`,children:[f(n,{orientation:y,children:[f(r,{children:[f(s,{children:[m,_&&d(u,{tooltip:_})]}),d(a,{children:h}),d(c,{isShow:!!v,children:v})]}),d(i,{children:d(o,{className:`flex flex-col gap-y-2`,children:g.map(t=>f(n,{orientation:`horizontal`,children:[d(e,{id:`${b.name}-${t.value}`,name:b.name,checked:b.state.value?.includes(t.value)??!1,disabled:x,onCheckedChange:e=>{if(e&&b.state.value!==null)b.pushValue(t.value);else if(e&&b.state.value===null)b.setValue([t.value]);else if(!e&&b.state.value!==null){let e=b.state.value.indexOf(t.value);e>-1&&b.removeValue(e)}else b.setValue(null)}}),d(s,{htmlFor:`${b.name}-${t.value}`,className:`text-text-positive`,children:t.label})]},t.value))})})]}),d(l,{})]})};export{m as CheckboxField};
2
- //# sourceMappingURL=checkbox-field-BRGTLOjq.mjs.map
@@ -1,2 +0,0 @@
1
- const e=require("./ui/checkbox.cjs"),t=require("./tanstack-form-C0ab8EEl.cjs"),n=require("./field-BSLi-P0Q.cjs");let r=require("react/jsx-runtime"),i=require("@tanstack/react-form");const a=({label:a,description:o,options:s,tooltip:c,helperText:l,orientation:u})=>{let d=t.G(),f=(0,i.useStore)(d.form.store,({isSubmitting:e})=>e);return(0,r.jsxs)(n.FieldGroup,{className:`gap-y-4 px-4`,children:[(0,r.jsxs)(n.Field,{orientation:u,children:[(0,r.jsxs)(n.FieldContent,{children:[(0,r.jsxs)(n.FieldLabel,{children:[a,c&&(0,r.jsx)(n.FieldTooltip,{tooltip:c})]}),(0,r.jsx)(n.FieldDescription,{children:o}),(0,r.jsx)(n.FieldNote,{isShow:!!l,children:l})]}),(0,r.jsx)(n.FieldContentMain,{children:(0,r.jsx)(n.FieldGroup,{className:`flex flex-col gap-y-2`,children:s.map(t=>(0,r.jsxs)(n.Field,{orientation:`horizontal`,children:[(0,r.jsx)(e.Checkbox,{id:`${d.name}-${t.value}`,name:d.name,checked:d.state.value?.includes(t.value)??!1,disabled:f,onCheckedChange:e=>{if(e&&d.state.value!==null)d.pushValue(t.value);else if(e&&d.state.value===null)d.setValue([t.value]);else if(!e&&d.state.value!==null){let e=d.state.value.indexOf(t.value);e>-1&&d.removeValue(e)}else d.setValue(null)}}),(0,r.jsx)(n.FieldLabel,{htmlFor:`${d.name}-${t.value}`,className:`text-text-positive`,children:t.label})]},t.value))})})]}),(0,r.jsx)(n.FieldSeparator,{})]})};exports.CheckboxField=a;
2
- //# sourceMappingURL=checkbox-field-ldZRSCca.cjs.map
@@ -1,2 +0,0 @@
1
- import{Button as e}from"./ui/button.mjs";import{Dialog as t,DialogClose as n,DialogOverlay as ee,DialogPortal as te}from"./ui/dialog.mjs";import{Command as r,CommandEmpty as i,CommandGroup as a,CommandInput as o,CommandItem as s,CommandList as ne}from"./ui/command.mjs";import{G as re}from"./tanstack-form-fkaBh9RO.mjs";import{Popover as ie,PopoverContent as c,PopoverTrigger as l}from"./ui/popover.mjs";import{Field as u,FieldContent as d,FieldContentMain as f,FieldDescription as p,FieldError as m,FieldGroup as h,FieldLabel as g,FieldNote as ae,FieldSeparator as oe,FieldTooltip as se}from"./field-V2DoD8qL.mjs";import{XIcon as _}from"lucide-react";import{memo as v,useId as y,useState as b}from"react";import{cn as x}from"@customafk/react-toolkit/utils";import{Fragment as S,jsx as C,jsxs as w}from"react/jsx-runtime";import{Dialog as T}from"radix-ui";import{useStore as E}from"@tanstack/react-form";import{useIsMobile as D}from"@customafk/react-toolkit/hooks/useMobile";const O=v(({label:v,description:O,placeholder:k,tooltip:A,helperText:j,orientation:M=`responsive`,options:N,required:P=!1,disabled:ce=!1,clearable:F=!1,showErrorMessage:I=!0,modal:L})=>{let R=y(),z=re(),B=D(),[V,H]=b(!1),[U,W]=b(!1),G=E(z.form.store,({isSubmitting:e})=>e),K=ce||G,q=z.state.meta.isDirty||z.state.meta.isTouched,J=q&&!z.state.meta.isValid,le=P&&z.state.value===null,Y=F&&!!z.state.value&&!K,ue=z.state.meta.errors.length>0,X=N.find(({value:e})=>e===z.state.value)?.label,Z=()=>{z.handleChange(null),z.handleBlur()},Q=t=>C(e,{variant:`outline`,color:`muted`,size:`lg`,disabled:K,"aria-invalid":J?!0:void 0,"aria-describedby":R,className:x(`flex w-full items-center justify-start rounded outline-border`,`hover:bg-transparent`,`focus-visible:outline-1 focus-visible:outline-primary-strong focus-visible:ring-4 focus-visible:ring-primary-weak`,`data-[state=open]:text-text-positive-muted data-[state=open]:outline-1 data-[state=open]:outline-primary-strong data-[state=open]:ring-4 data-[state=open]:ring-primary-weak`,Y&&`pr-8`,!z.state.value&&`text-text-positive-muted`,J&&`outline-danger bg-danger-bg-subtle ring-4 ring-danger-weak`),onClick:t,children:X?C(`p`,{className:`flex min-w-0 flex-1 items-center gap-2 truncate text-start`,children:X}):C(`p`,{className:`flex-1 text-start text-text-positive-muted`,children:k})}),$=e=>w(r,{className:`border-none`,children:[C(o,{placeholder:k??`Tìm kiếm…`}),w(ne,{children:[C(i,{className:`flex min-h-30 items-center justify-center text-sm text-text-positive-weak`,children:`Không tìm thấy kết quả nào phù hợp.`}),C(a,{className:`max-h-60 overflow-y-auto`,children:N.map(({value:t,label:n})=>C(s,{value:n,onSelect:()=>e(t),children:n},t))})]})]});return w(h,{className:`gap-y-4 px-4`,children:[w(u,{orientation:M,"data-invalid":J,children:[w(d,{children:[w(g,{"aria-required":le,htmlFor:z.name,children:[v,A&&C(se,{tooltip:A})]}),C(p,{children:O})]}),C(f,{className:`flex justify-end`,children:w(`div`,{className:`flex w-full flex-col`,children:[w(`div`,{className:`relative`,children:[B?w(S,{children:[Q(()=>H(!0)),C(t,{open:V,onOpenChange:e=>{H(e),e||z.handleBlur()},children:w(te,{children:[C(ee,{}),w(T.Content,{onOpenAutoFocus:e=>e.preventDefault(),className:x(`fixed inset-x-0 bottom-0 z-50`,`flex flex-col bg-background rounded-t-2xl outline-none`,`max-h-[80dvh] shadow-[0_-4px_24px_rgba(0,0,0,0.08)]`,`data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom data-[state=open]:fade-in-0`,`data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=closed]:fade-out-0`,`duration-300`),children:[w(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-border shrink-0`,children:[C(`span`,{className:`font-semibold text-sm text-text-positive`,children:v}),C(n,{asChild:!0,children:C(`button`,{type:`button`,"aria-label":`Đóng`,className:`flex size-7 items-center justify-center rounded-md text-text-positive-weak transition-colors hover:bg-muted-muted hover:text-text-positive`,children:C(_,{size:16})})})]}),w(`div`,{className:`flex flex-col overflow-y-auto`,children:[Y&&C(n,{asChild:!0,children:w(`button`,{type:`button`,className:`flex w-full items-center gap-x-2 px-4 py-3 text-left text-sm text-danger-strong transition-colors hover:bg-danger-bg-subtle`,onClick:Z,children:[C(_,{size:14}),`Xóa lựa chọn`]})}),$(e=>{z.handleChange(e),H(!1),z.handleBlur()})]}),C(`div`,{className:`shrink-0 h-safe-bottom`})]})]})})]}):w(ie,{open:U,modal:L,onOpenChange:e=>{W(e),e||z.handleBlur()},children:[C(l,{asChild:!0,children:Q()}),C(c,{align:`end`,side:`bottom`,className:`flex w-fit rounded p-0`,children:$(e=>{z.handleChange(e),W(!1),z.handleBlur()})})]}),Y&&C(`button`,{type:`button`,"aria-label":`Xóa lựa chọn`,className:`absolute right-2 top-1/2 -translate-y-1/2 flex size-4 cursor-pointer items-center justify-center rounded-md text-text-positive-weak outline-none transition-[color,transform] hover:text-text-positive focus-visible:text-primary-strong focus-visible:[&>svg]:scale-125 [&>svg]:size-3.5 [&>svg]:transition-transform`,onClick:Z,children:C(_,{"aria-hidden":`true`})})]}),q&&I&&ue&&C(m,{id:R,className:`mt-1`,errors:z.state.meta.errors}),C(ae,{isShow:!!j,children:j})]})})]}),C(oe,{})]})});O.displayName=`ComboboxField`;export{O as ComboboxField};
2
- //# sourceMappingURL=combobox-field-CvkdZkQE.mjs.map
@@ -1,2 +0,0 @@
1
- const e=require("./ui/button.cjs"),t=require("./ui/dialog.cjs"),n=require("./ui/command.cjs"),r=require("./tanstack-form-C0ab8EEl.cjs"),i=require("./ui/popover.cjs"),a=require("./field-BSLi-P0Q.cjs");let o=require("lucide-react"),s=require("react"),c=require("@customafk/react-toolkit/utils"),l=require("react/jsx-runtime"),u=require("radix-ui"),d=require("@tanstack/react-form"),f=require("@customafk/react-toolkit/hooks/useMobile");const p=(0,s.memo)(({label:p,description:m,placeholder:h,tooltip:g,helperText:_,orientation:v=`responsive`,options:y,required:b=!1,disabled:x=!1,clearable:S=!1,showErrorMessage:C=!0,modal:w})=>{let T=(0,s.useId)(),E=r.G(),D=(0,f.useIsMobile)(),[O,k]=(0,s.useState)(!1),[A,j]=(0,s.useState)(!1),M=(0,d.useStore)(E.form.store,({isSubmitting:e})=>e),N=x||M,P=E.state.meta.isDirty||E.state.meta.isTouched,F=P&&!E.state.meta.isValid,I=b&&E.state.value===null,L=S&&!!E.state.value&&!N,R=E.state.meta.errors.length>0,z=y.find(({value:e})=>e===E.state.value)?.label,B=()=>{E.handleChange(null),E.handleBlur()},V=t=>(0,l.jsx)(e.Button,{variant:`outline`,color:`muted`,size:`lg`,disabled:N,"aria-invalid":F?!0:void 0,"aria-describedby":T,className:(0,c.cn)(`flex w-full items-center justify-start rounded outline-border`,`hover:bg-transparent`,`focus-visible:outline-1 focus-visible:outline-primary-strong focus-visible:ring-4 focus-visible:ring-primary-weak`,`data-[state=open]:text-text-positive-muted data-[state=open]:outline-1 data-[state=open]:outline-primary-strong data-[state=open]:ring-4 data-[state=open]:ring-primary-weak`,L&&`pr-8`,!E.state.value&&`text-text-positive-muted`,F&&`outline-danger bg-danger-bg-subtle ring-4 ring-danger-weak`),onClick:t,children:z?(0,l.jsx)(`p`,{className:`flex min-w-0 flex-1 items-center gap-2 truncate text-start`,children:z}):(0,l.jsx)(`p`,{className:`flex-1 text-start text-text-positive-muted`,children:h})}),H=e=>(0,l.jsxs)(n.Command,{className:`border-none`,children:[(0,l.jsx)(n.CommandInput,{placeholder:h??`Tìm kiếm…`}),(0,l.jsxs)(n.CommandList,{children:[(0,l.jsx)(n.CommandEmpty,{className:`flex min-h-30 items-center justify-center text-sm text-text-positive-weak`,children:`Không tìm thấy kết quả nào phù hợp.`}),(0,l.jsx)(n.CommandGroup,{className:`max-h-60 overflow-y-auto`,children:y.map(({value:t,label:r})=>(0,l.jsx)(n.CommandItem,{value:r,onSelect:()=>e(t),children:r},t))})]})]});return(0,l.jsxs)(a.FieldGroup,{className:`gap-y-4 px-4`,children:[(0,l.jsxs)(a.Field,{orientation:v,"data-invalid":F,children:[(0,l.jsxs)(a.FieldContent,{children:[(0,l.jsxs)(a.FieldLabel,{"aria-required":I,htmlFor:E.name,children:[p,g&&(0,l.jsx)(a.FieldTooltip,{tooltip:g})]}),(0,l.jsx)(a.FieldDescription,{children:m})]}),(0,l.jsx)(a.FieldContentMain,{className:`flex justify-end`,children:(0,l.jsxs)(`div`,{className:`flex w-full flex-col`,children:[(0,l.jsxs)(`div`,{className:`relative`,children:[D?(0,l.jsxs)(l.Fragment,{children:[V(()=>k(!0)),(0,l.jsx)(t.Dialog,{open:O,onOpenChange:e=>{k(e),e||E.handleBlur()},children:(0,l.jsxs)(t.DialogPortal,{children:[(0,l.jsx)(t.DialogOverlay,{}),(0,l.jsxs)(u.Dialog.Content,{onOpenAutoFocus:e=>e.preventDefault(),className:(0,c.cn)(`fixed inset-x-0 bottom-0 z-50`,`flex flex-col bg-background rounded-t-2xl outline-none`,`max-h-[80dvh] shadow-[0_-4px_24px_rgba(0,0,0,0.08)]`,`data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom data-[state=open]:fade-in-0`,`data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=closed]:fade-out-0`,`duration-300`),children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-border shrink-0`,children:[(0,l.jsx)(`span`,{className:`font-semibold text-sm text-text-positive`,children:p}),(0,l.jsx)(t.DialogClose,{asChild:!0,children:(0,l.jsx)(`button`,{type:`button`,"aria-label":`Đóng`,className:`flex size-7 items-center justify-center rounded-md text-text-positive-weak transition-colors hover:bg-muted-muted hover:text-text-positive`,children:(0,l.jsx)(o.XIcon,{size:16})})})]}),(0,l.jsxs)(`div`,{className:`flex flex-col overflow-y-auto`,children:[L&&(0,l.jsx)(t.DialogClose,{asChild:!0,children:(0,l.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-x-2 px-4 py-3 text-left text-sm text-danger-strong transition-colors hover:bg-danger-bg-subtle`,onClick:B,children:[(0,l.jsx)(o.XIcon,{size:14}),`Xóa lựa chọn`]})}),H(e=>{E.handleChange(e),k(!1),E.handleBlur()})]}),(0,l.jsx)(`div`,{className:`shrink-0 h-safe-bottom`})]})]})})]}):(0,l.jsxs)(i.Popover,{open:A,modal:w,onOpenChange:e=>{j(e),e||E.handleBlur()},children:[(0,l.jsx)(i.PopoverTrigger,{asChild:!0,children:V()}),(0,l.jsx)(i.PopoverContent,{align:`end`,side:`bottom`,className:`flex w-fit rounded p-0`,children:H(e=>{E.handleChange(e),j(!1),E.handleBlur()})})]}),L&&(0,l.jsx)(`button`,{type:`button`,"aria-label":`Xóa lựa chọn`,className:`absolute right-2 top-1/2 -translate-y-1/2 flex size-4 cursor-pointer items-center justify-center rounded-md text-text-positive-weak outline-none transition-[color,transform] hover:text-text-positive focus-visible:text-primary-strong focus-visible:[&>svg]:scale-125 [&>svg]:size-3.5 [&>svg]:transition-transform`,onClick:B,children:(0,l.jsx)(o.XIcon,{"aria-hidden":`true`})})]}),P&&C&&R&&(0,l.jsx)(a.FieldError,{id:T,className:`mt-1`,errors:E.state.meta.errors}),(0,l.jsx)(a.FieldNote,{isShow:!!_,children:_})]})})]}),(0,l.jsx)(a.FieldSeparator,{})]})});p.displayName=`ComboboxField`,exports.ComboboxField=p;
2
- //# sourceMappingURL=combobox-field-ZYr7636s.cjs.map
@@ -1,2 +0,0 @@
1
- const e=require("./ui/button.cjs"),t=require("./tanstack-form-C0ab8EEl.cjs"),n=require("./ui/popover.cjs"),r=require("./ui/calendar.cjs"),i=require("./field-BSLi-P0Q.cjs");let a=require("lucide-react"),o=require("react"),s=require("@customafk/react-toolkit/utils"),c=require("react/jsx-runtime"),l=require("@customafk/react-toolkit/date-fns"),u=require("@tanstack/react-form");const d=(0,o.memo)(({label:d,description:f,placeholder:p,orientation:m=`responsive`,tooltip:h,helperText:g,showErrorMessage:_=!0,required:v=!1,disabled:y=!1,minDate:b,maxDate:x})=>{let S=(0,o.useId)(),C=t.G(),[w,T]=(0,o.useState)(!1),E=(0,u.useStore)(C.form.store,({isSubmitting:e})=>e),D=y||E,O=C.state.meta.isDirty||C.state.meta.isTouched,k=O&&!C.state.meta.isValid,A=v&&C.state.value===null,j=O&&C.state.meta.errors.length>0,M=e=>{C.handleChange(e),T(!1)};return(0,c.jsxs)(i.FieldGroup,{className:`px-4`,children:[(0,c.jsxs)(i.Field,{orientation:m,"data-invalid":k,children:[(0,c.jsxs)(i.FieldContent,{children:[(0,c.jsxs)(i.FieldLabel,{htmlFor:C.name,"aria-required":A,children:[d,h&&(0,c.jsx)(i.FieldTooltip,{tooltip:h})]}),(0,c.jsx)(i.FieldDescription,{children:f})]}),(0,c.jsx)(i.FieldContentMain,{className:`flex flex-col space-y-1`,children:(0,c.jsxs)(`div`,{className:`flex w-full flex-col`,children:[(0,c.jsxs)(n.Popover,{open:w,onOpenChange:e=>{T(e),e||C.handleBlur()},children:[(0,c.jsx)(n.PopoverTrigger,{asChild:!0,children:(0,c.jsxs)(e.Button,{variant:`outline`,color:`muted`,size:`lg`,disabled:D,"aria-invalid":k?!0:void 0,"aria-describedby":S,className:(0,s.cn)(`flex items-center justify-between rounded font-normal outline-border`,`hover:bg-transparent`,`focus:outline-1 focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`data-[state=open]:outline-1 data-[state=open]:outline-primary-strong data-[state=open]:ring-4 data-[state=open]:ring-primary-weak`,C.state.value===null&&`text-text-positive-muted`,k&&`outline-danger bg-danger-bg-subtle ring-4 ring-danger-weak`),children:[(0,c.jsx)(`p`,{children:C.state.value===null?p??`Select date`:(0,l.format)(C.state.value,`PPPP`)}),(0,c.jsx)(a.CalendarDaysIcon,{strokeWidth:1})]})}),(0,c.jsxs)(n.PopoverContent,{align:`start`,side:`bottom`,className:`flex w-fit min-w-0 overflow-y-auto rounded p-0`,children:[(0,c.jsxs)(`div`,{className:`flex h-full flex-col space-y-2 border-r border-r-border p-2 [&>button]:justify-start [&>button]:text-sm`,children:[(0,c.jsx)(e.Button,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>M((0,l.endOfToday)()),children:`Hôm nay`}),(0,c.jsx)(e.Button,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>M((0,l.endOfTomorrow)()),children:`Ngày mai`}),(0,c.jsx)(e.Button,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>M((0,l.endOfYesterday)()),children:`Hôm qua`}),(0,c.jsx)(e.Button,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>M((0,l.subDays)((0,l.endOfToday)(),3)),children:`3 ngày qua`}),(0,c.jsx)(e.Button,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>M((0,l.subDays)((0,l.endOfToday)(),7)),children:`7 ngày qua`}),(0,c.jsx)(e.Button,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>M((0,l.subDays)((0,l.endOfToday)(),30)),children:`30 ngày qua`}),(0,c.jsx)(e.Button,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>M((0,l.startOfMonth)((0,l.endOfToday)())),children:`Tháng này`}),(0,c.jsx)(e.Button,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>M((0,l.lastDayOfMonth)((0,l.endOfToday)())),children:`Tháng trước`})]}),(0,c.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,c.jsx)(`div`,{className:`min-w-73 border-b border-b-border p-2`,children:(0,c.jsx)(r.Calendar,{mode:`single`,selected:C.state.value??void 0,hidden:{before:b??new Date(1900,0,1),after:x??new Date(2100,11,31)},onSelect:e=>{e&&M(e)}})})})]})]}),O&&_&&j&&(0,c.jsx)(i.FieldError,{id:S,className:`mt-1`,errors:C.state.meta.errors}),(0,c.jsx)(i.FieldNote,{isShow:!!g,children:g})]})})]}),(0,c.jsx)(i.FieldSeparator,{})]})});d.displayName=`DateField`,exports.DateField=d;
2
- //# sourceMappingURL=date-field-1Hmcv8Zp.cjs.map
@@ -1,2 +0,0 @@
1
- import{Button as e}from"./ui/button.mjs";import{G as t}from"./tanstack-form-fkaBh9RO.mjs";import{Popover as n,PopoverContent as r,PopoverTrigger as i}from"./ui/popover.mjs";import{Calendar as a}from"./ui/calendar.mjs";import{Field as o,FieldContent as s,FieldContentMain as c,FieldDescription as l,FieldError as u,FieldGroup as d,FieldLabel as f,FieldNote as p,FieldSeparator as m,FieldTooltip as h}from"./field-V2DoD8qL.mjs";import{CalendarDaysIcon as g}from"lucide-react";import{memo as _,useId as v,useState as y}from"react";import{cn as b}from"@customafk/react-toolkit/utils";import{jsx as x,jsxs as S}from"react/jsx-runtime";import{endOfToday as C,endOfTomorrow as w,endOfYesterday as T,format as E,lastDayOfMonth as D,startOfMonth as O,subDays as k}from"@customafk/react-toolkit/date-fns";import{useStore as A}from"@tanstack/react-form";const j=_(({label:_,description:j,placeholder:M,orientation:N=`responsive`,tooltip:P,helperText:F,showErrorMessage:I=!0,required:L=!1,disabled:R=!1,minDate:z,maxDate:B})=>{let V=v(),H=t(),[U,W]=y(!1),G=A(H.form.store,({isSubmitting:e})=>e),K=R||G,q=H.state.meta.isDirty||H.state.meta.isTouched,J=q&&!H.state.meta.isValid,Y=L&&H.state.value===null,X=q&&H.state.meta.errors.length>0,Z=e=>{H.handleChange(e),W(!1)};return S(d,{className:`px-4`,children:[S(o,{orientation:N,"data-invalid":J,children:[S(s,{children:[S(f,{htmlFor:H.name,"aria-required":Y,children:[_,P&&x(h,{tooltip:P})]}),x(l,{children:j})]}),x(c,{className:`flex flex-col space-y-1`,children:S(`div`,{className:`flex w-full flex-col`,children:[S(n,{open:U,onOpenChange:e=>{W(e),e||H.handleBlur()},children:[x(i,{asChild:!0,children:S(e,{variant:`outline`,color:`muted`,size:`lg`,disabled:K,"aria-invalid":J?!0:void 0,"aria-describedby":V,className:b(`flex items-center justify-between rounded font-normal outline-border`,`hover:bg-transparent`,`focus:outline-1 focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`data-[state=open]:outline-1 data-[state=open]:outline-primary-strong data-[state=open]:ring-4 data-[state=open]:ring-primary-weak`,H.state.value===null&&`text-text-positive-muted`,J&&`outline-danger bg-danger-bg-subtle ring-4 ring-danger-weak`),children:[x(`p`,{children:H.state.value===null?M??`Select date`:E(H.state.value,`PPPP`)}),x(g,{strokeWidth:1})]})}),S(r,{align:`start`,side:`bottom`,className:`flex w-fit min-w-0 overflow-y-auto rounded p-0`,children:[S(`div`,{className:`flex h-full flex-col space-y-2 border-r border-r-border p-2 [&>button]:justify-start [&>button]:text-sm`,children:[x(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>Z(C()),children:`Hôm nay`}),x(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>Z(w()),children:`Ngày mai`}),x(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>Z(T()),children:`Hôm qua`}),x(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>Z(k(C(),3)),children:`3 ngày qua`}),x(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>Z(k(C(),7)),children:`7 ngày qua`}),x(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>Z(k(C(),30)),children:`30 ngày qua`}),x(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>Z(O(C())),children:`Tháng này`}),x(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>Z(D(C())),children:`Tháng trước`})]}),x(`div`,{className:`flex flex-1 flex-col`,children:x(`div`,{className:`min-w-73 border-b border-b-border p-2`,children:x(a,{mode:`single`,selected:H.state.value??void 0,hidden:{before:z??new Date(1900,0,1),after:B??new Date(2100,11,31)},onSelect:e=>{e&&Z(e)}})})})]})]}),q&&I&&X&&x(u,{id:V,className:`mt-1`,errors:H.state.meta.errors}),x(p,{isShow:!!F,children:F})]})})]}),x(m,{})]})});j.displayName=`DateField`;export{j as DateField};
2
- //# sourceMappingURL=date-field-DGMTG_hu.mjs.map
@@ -1,2 +0,0 @@
1
- import{Dialog as e,DialogContent as t,DialogOverlay as n,DialogPortal as r,DialogTitle as i}from"./ui/dialog.mjs";import{K as a}from"./tanstack-form-fkaBh9RO.mjs";import{Separator as o}from"./ui/separator.mjs";import{n as s,t as c}from"./submit-button-CGBaPzE9.mjs";import{useCallback as l}from"react";import{cn as u}from"@customafk/react-toolkit/utils";import{jsx as d,jsxs as f}from"react/jsx-runtime";const p=({title:p,submitText:m,width:h,maxWidth:g,className:_,open:v,onOpenChange:y,children:b})=>{let x=a(),S=l(e=>{e||x.reset(),y?.(e)},[x.reset,y]);return d(e,{open:v,onOpenChange:S,children:f(r,{"data-slot":`dialog-portal`,children:[d(n,{}),f(t,{style:{"--width":h,"--max-width":g},className:u(`flex size-full max-h-dvh max-w-dvw flex-col gap-0 overflow-y-auto rounded-none p-0 shadow-dialog sm:h-auto sm:max-h-[85dvh] sm:max-w-5xl sm:rounded-md`,h&&`sm:w-(--width)`,g&&`sm:max-w-(--max-width)`,_),onOpenAutoFocus:e=>{e.preventDefault()},onInteractOutside:e=>{e.preventDefault()},children:[d(`div`,{"data-slot":`dialog-header`,className:`flex items-center justify-center gap-2 px-6 py-5 text-center sm:text-left`,children:d(i,{"data-slot":`dialog-title`,className:`font-semibold text-lg tracking-tight`,children:p})}),d(o,{}),d(`div`,{"data-slot":`dialog-content`,className:`relative flex flex-col overflow-y-auto p-0 pt-4 max-sm:flex-1 sm:p-4`,children:b}),d(o,{}),f(`div`,{"data-slot":`dialog-footer`,className:`flex flex-col-reverse items-center justify-end gap-2 px-6 py-4 sm:flex-row max-sm:[&>button]:w-full`,children:[d(x.Subscribe,{selector:e=>({disabled:e.isSubmitting}),children:({disabled:e})=>d(s,{disabled:e,onClick:()=>{x.reset(),S(!1)}})}),d(x.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:t})=>d(c,{isSubmitting:e,disabled:t,submitText:m,onClick:()=>x.handleSubmit()})})]})]})]})})};export{p as TanStackDialogForm};
2
- //# sourceMappingURL=dialog-form-BRSZpRTC.mjs.map
@@ -1,2 +0,0 @@
1
- const e=require("./ui/dialog.cjs"),t=require("./tanstack-form-C0ab8EEl.cjs"),n=require("./ui/separator.cjs"),r=require("./submit-button-CvINfld5.cjs");let i=require("react"),a=require("@customafk/react-toolkit/utils"),o=require("react/jsx-runtime");const s=({title:s,submitText:c,width:l,maxWidth:u,className:d,open:f,onOpenChange:p,children:m})=>{let h=t.K(),g=(0,i.useCallback)(e=>{e||h.reset(),p?.(e)},[h.reset,p]);return(0,o.jsx)(e.Dialog,{open:f,onOpenChange:g,children:(0,o.jsxs)(e.DialogPortal,{"data-slot":`dialog-portal`,children:[(0,o.jsx)(e.DialogOverlay,{}),(0,o.jsxs)(e.DialogContent,{style:{"--width":l,"--max-width":u},className:(0,a.cn)(`flex size-full max-h-dvh max-w-dvw flex-col gap-0 overflow-y-auto rounded-none p-0 shadow-dialog sm:h-auto sm:max-h-[85dvh] sm:max-w-5xl sm:rounded-md`,l&&`sm:w-(--width)`,u&&`sm:max-w-(--max-width)`,d),onOpenAutoFocus:e=>{e.preventDefault()},onInteractOutside:e=>{e.preventDefault()},children:[(0,o.jsx)(`div`,{"data-slot":`dialog-header`,className:`flex items-center justify-center gap-2 px-6 py-5 text-center sm:text-left`,children:(0,o.jsx)(e.DialogTitle,{"data-slot":`dialog-title`,className:`font-semibold text-lg tracking-tight`,children:s})}),(0,o.jsx)(n.Separator,{}),(0,o.jsx)(`div`,{"data-slot":`dialog-content`,className:`relative flex flex-col overflow-y-auto p-0 pt-4 max-sm:flex-1 sm:p-4`,children:m}),(0,o.jsx)(n.Separator,{}),(0,o.jsxs)(`div`,{"data-slot":`dialog-footer`,className:`flex flex-col-reverse items-center justify-end gap-2 px-6 py-4 sm:flex-row max-sm:[&>button]:w-full`,children:[(0,o.jsx)(h.Subscribe,{selector:e=>({disabled:e.isSubmitting}),children:({disabled:e})=>(0,o.jsx)(r.n,{disabled:e,onClick:()=>{h.reset(),g(!1)}})}),(0,o.jsx)(h.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:t})=>(0,o.jsx)(r.t,{isSubmitting:e,disabled:t,submitText:c,onClick:()=>h.handleSubmit()})})]})]})]})})};exports.TanStackDialogForm=s;
2
- //# sourceMappingURL=dialog-form-C1qpltYx.cjs.map
@@ -1,2 +0,0 @@
1
- import{Input as e}from"./ui/input.mjs";import{G as t}from"./tanstack-form-fkaBh9RO.mjs";import{Field as n,FieldContent as r,FieldContentMain as i,FieldDescription as a,FieldError as o,FieldGroup as s,FieldLabel as c,FieldNote as l,FieldSeparator as u,FieldTooltip as d}from"./field-V2DoD8qL.mjs";import{AtSignIcon as f,XIcon as p}from"lucide-react";import{useCallback as m}from"react";import{cn as h}from"@customafk/react-toolkit/utils";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{useStore as v}from"@tanstack/react-form";const y=({label:y,description:b,placeholder:x,tooltip:S,helperText:C,orientation:w=`responsive`,showErrorMessage:T=!0,required:E=!1,maxLength:D})=>{let{form:O,name:k,state:A,handleBlur:j,handleChange:M}=t(),N=v(O.store,({isSubmitting:e})=>e),P=A.meta.isDirty&&A.meta.isTouched&&!A.meta.isValid,F=E&&A.value===null,I=!N&&!!A.value,L=m(({target:{value:e}})=>{N||D&&e.length>D||M(e||null)},[N,D,M]),R=m(()=>{N||M(null)},[N,M]);return _(s,{className:`gap-y-4 px-4`,children:[_(n,{"data-invalid":P,orientation:w,children:[_(r,{children:[_(c,{htmlFor:k,"aria-required":F,children:[y,S&&g(d,{tooltip:S})]}),g(a,{children:b})]}),_(i,{children:[g(e,{id:k,name:k,value:A.value===null?``:A.value,"aria-invalid":P,autoComplete:`email`,placeholder:x,className:h(`pl-9`,I&&`pr-9`,N&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:j,onChange:L}),g(`div`,{className:`absolute top-0 left-0 flex size-9 items-center justify-center text-muted`,children:g(f,{size:14})}),I&&g(`button`,{type:`button`,"aria-label":`Xóa`,className:`absolute inset-e-0 inset-y-0 top-3 flex h-fit w-8 cursor-pointer items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:text-text-positive-strong`,onClick:R,children:g(p,{size:14,"aria-hidden":`true`})}),g(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:T&&A.meta.isDirty&&g(o,{errors:A.meta.errors})}),g(l,{isShow:!!C,children:C})]})]}),g(u,{})]})};export{y as EmailField};
2
- //# sourceMappingURL=email-field-C2Lvl_rQ.mjs.map
@@ -1,2 +0,0 @@
1
- const e=require("./ui/input.cjs"),t=require("./tanstack-form-C0ab8EEl.cjs"),n=require("./field-BSLi-P0Q.cjs");let r=require("lucide-react"),i=require("react"),a=require("@customafk/react-toolkit/utils"),o=require("react/jsx-runtime"),s=require("@tanstack/react-form");const c=({label:c,description:l,placeholder:u,tooltip:d,helperText:f,orientation:p=`responsive`,showErrorMessage:m=!0,required:h=!1,maxLength:g})=>{let{form:_,name:v,state:y,handleBlur:b,handleChange:x}=t.G(),S=(0,s.useStore)(_.store,({isSubmitting:e})=>e),C=y.meta.isDirty&&y.meta.isTouched&&!y.meta.isValid,w=h&&y.value===null,T=!S&&!!y.value,E=(0,i.useCallback)(({target:{value:e}})=>{S||g&&e.length>g||x(e||null)},[S,g,x]),D=(0,i.useCallback)(()=>{S||x(null)},[S,x]);return(0,o.jsxs)(n.FieldGroup,{className:`gap-y-4 px-4`,children:[(0,o.jsxs)(n.Field,{"data-invalid":C,orientation:p,children:[(0,o.jsxs)(n.FieldContent,{children:[(0,o.jsxs)(n.FieldLabel,{htmlFor:v,"aria-required":w,children:[c,d&&(0,o.jsx)(n.FieldTooltip,{tooltip:d})]}),(0,o.jsx)(n.FieldDescription,{children:l})]}),(0,o.jsxs)(n.FieldContentMain,{children:[(0,o.jsx)(e.Input,{id:v,name:v,value:y.value===null?``:y.value,"aria-invalid":C,autoComplete:`email`,placeholder:u,className:(0,a.cn)(`pl-9`,T&&`pr-9`,S&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:b,onChange:E}),(0,o.jsx)(`div`,{className:`absolute top-0 left-0 flex size-9 items-center justify-center text-muted`,children:(0,o.jsx)(r.AtSignIcon,{size:14})}),T&&(0,o.jsx)(`button`,{type:`button`,"aria-label":`Xóa`,className:`absolute inset-e-0 inset-y-0 top-3 flex h-fit w-8 cursor-pointer items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:text-text-positive-strong`,onClick:D,children:(0,o.jsx)(r.XIcon,{size:14,"aria-hidden":`true`})}),(0,o.jsx)(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:m&&y.meta.isDirty&&(0,o.jsx)(n.FieldError,{errors:y.meta.errors})}),(0,o.jsx)(n.FieldNote,{isShow:!!f,children:f})]})]}),(0,o.jsx)(n.FieldSeparator,{})]})};exports.EmailField=c;
2
- //# sourceMappingURL=email-field-D3nSkHj2.cjs.map
@@ -1,2 +0,0 @@
1
- const e=require("./ui/tooltip.cjs"),t=require("./ui/separator.cjs");let n=require("lucide-react"),r=require("react"),i=require("@customafk/react-toolkit/utils"),a=require("class-variance-authority"),o=require("react/jsx-runtime"),s=require("radix-ui");function c({className:e,children:t,...n}){return(0,o.jsxs)(s.Label.Root,{"data-slot":`label`,className:(0,i.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,o.jsx)(`span`,{className:`flex items-center gap-1`,children:t}),(0,o.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`})]})}const l=(0,a.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`}}),u=(0,r.memo)(({className:e,...t})=>(0,o.jsx)(`fieldset`,{"data-slot":`field-set`,className:(0,i.cn)(`flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t}));u.displayName=`FieldSet`;const d=(0,r.memo)(({className:e,variant:t=`legend`,...n})=>(0,o.jsx)(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:(0,i.cn)(`mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,e),...n}));d.displayName=`FieldLegend`;const f=(0,r.memo)(({className:e,...t})=>(0,o.jsx)(`div`,{"data-slot":`field-group`,className:(0,i.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}));f.displayName=`FieldGroup`;const p=(0,r.memo)(({className:e,orientation:t=`vertical`,...n})=>(0,o.jsx)(`div`,{"data-slot":`field`,"data-orientation":t,className:(0,i.cn)(l({orientation:t}),e),...n}));p.displayName=`Field`;const m=(0,r.memo)(({className:e,...t})=>(0,o.jsx)(`div`,{"data-slot":`field-content`,className:(0,i.cn)(`group/field-content flex flex-col gap-1.5 leading-snug`,e),...t}));m.displayName=`FieldContent`;const h=(0,r.memo)(({className:e,...t})=>(0,o.jsx)(`div`,{"data-slot":`field-content-main`,className:(0,i.cn)(`relative`,e),...t}));h.displayName=`FieldContentMain`;const g=(0,r.memo)(({className:e,...t})=>(0,o.jsx)(c,{"data-slot":`field-label`,className:(0,i.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}));g.displayName=`FieldLabel`;const _=(0,r.memo)(({className:e,...t})=>(0,o.jsx)(`div`,{"data-slot":`field-label`,className:(0,i.cn)(`flex w-fit items-center gap-2 font-medium text-sm leading-snug group-data-[disabled=true]/field:opacity-50`,e),...t}));_.displayName=`FieldTitle`;const v=(0,r.memo)(({className:e,...t})=>(0,o.jsx)(`p`,{"data-slot":`field-description`,className:(0,i.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}));v.displayName=`FieldDescription`;const y=(0,r.memo)(({isShow:e=!0,className:t,children:r,...a})=>e===!1?null:(0,o.jsxs)(`div`,{"data-slot":`field-note`,className:(0,i.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),...a,children:[(0,o.jsx)(n.InfoIcon,{size:12,className:`mt-0.5 shrink-0 text-primary/70`}),(0,o.jsx)(`span`,{children:r})]}));y.displayName=`FieldNote`;const b=(0,r.memo)(({tooltip:t})=>(0,o.jsxs)(e.Tooltip,{children:[(0,o.jsx)(e.TooltipTrigger,{asChild:!0,children:(0,o.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,o.jsx)(n.HelpCircleIcon,{size:13,"aria-hidden":`true`}),(0,o.jsx)(`span`,{className:`sr-only`,children:`Thêm thông tin`})]})}),(0,o.jsx)(e.TooltipContent,{side:`top`,className:`max-w-xs text-balance`,children:t})]}));b.displayName=`FieldTooltip`;const x=(0,r.memo)(({children:e,className:n,...r})=>(0,o.jsxs)(`div`,{"data-slot":`field-separator`,"data-content":!!e,className:(0,i.cn)(`relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2`,n),...r,children:[(0,o.jsx)(t.Separator,{className:`absolute inset-0 top-1/2`}),e&&(0,o.jsx)(`span`,{className:`relative mx-auto block w-fit bg-background px-2 text-text-positive-weak`,"data-slot":`field-separator-content`,children:e})]}));x.displayName=`FieldSeparator`;const S=(0,r.memo)(({className:e,children:t,errors:n,requiredMessage:a=`Trường này là bắt buộc`,...s})=>{let c=(0,r.useMemo)(()=>{let e=e=>e.code===`invalid_type`?a:e.message;return t||(n?n?.length===1&&n[0]?.message?(0,o.jsx)(`div`,{className:`flex flex-row items-center justify-start gap-x-0.5`,children:(0,o.jsx)(`p`,{children:e(n[0])})}):(0,o.jsx)(`ul`,{className:`flex list-none flex-col`,children:n.map(t=>typeof t==`string`?(0,o.jsx)(`li`,{children:t},t):t?.message?(0,o.jsx)(`li`,{children:e(t)},t.code??t.message):null)}):null)},[t,n,a]);return c?(0,o.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:(0,i.cn)(`w-full font-medium text-danger-strong text-xs`,e),...s,children:c}):null});S.displayName=`FieldError`,exports.Field=p,exports.FieldContent=m,exports.FieldContentMain=h,exports.FieldDescription=v,exports.FieldError=S,exports.FieldGroup=f,exports.FieldLabel=g,exports.FieldLegend=d,exports.FieldNote=y,exports.FieldSeparator=x,exports.FieldTitle=_,exports.FieldTooltip=b;
2
- //# sourceMappingURL=field-BSLi-P0Q.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"field-BSLi-P0Q.cjs","names":["LabelPrimitive","InfoIcon","Tooltip","TooltipTrigger","HelpCircleIcon","TooltipContent","Separator"],"sources":["../packages/components/features/tanstack-form/components/ui/label.tsx","../packages/components/features/tanstack-form/components/ui/field.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Label as LabelPrimitive } from 'radix-ui';\n\n/**\n * Form field label that automatically renders a \"Required\" badge when the field is marked aria-required.\n *\n * @example\n * import { Label } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <Label htmlFor=\"email\">Email address</Label>\n */\nfunction Label({ className, children, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {\n return (\n <LabelPrimitive.Root\n data-slot=\"label\"\n className={cn(\n 'text-text-positive',\n 'flex w-full items-center justify-between',\n 'select-none font-medium text-sm/6 leading-none',\n 'group-data-[disabled=true]:pointer-events-none',\n 'group-data-[disabled=true]:opacity-50',\n 'peer-disabled:cursor-not-allowed',\n 'peer-disabled:opacity-50',\n 'aria-required:*:data-[slot=required-indicator]:inline-block',\n className\n )}\n {...props}\n >\n <span className=\"flex items-center gap-1\">{children}</span>\n <span\n data-slot=\"required-indicator\"\n className=\"hidden shrink-0 rounded-lg bg-danger-strong px-1.5 py-1 font-semibold text-[11px] leading-none text-white\"\n >\n Bắt buộc\n </span>\n </LabelPrimitive.Root>\n );\n}\n\nexport { Label };\n","'use client';\n\nimport { memo, useMemo } from 'react';\n\nimport { HelpCircleIcon, InfoIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Separator } from '@/components/ui/separator';\nimport { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Label } from './label';\n\nconst fieldVariants = cva('group/field flex w-full gap-2 data-[invalid=true]:text-danger *:data-[slot=field-content]:gap-0', {\n variants: {\n orientation: {\n vertical: ['flex-col *:w-full [&>.sr-only]:w-auto'],\n horizontal: [\n 'flex-row items-center gap-4',\n '*:data-[slot=field-content]:basis-1/2',\n '*:data-[slot=field-content-main]:flex-1',\n '*:data-[slot=field-label]:flex-auto',\n 'has-[>[data-slot=field-content]]:items-start',\n 'has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n ],\n responsive: [\n 'flex-col *:w-full [&>.sr-only]:w-auto',\n '@md/field-group:flex-row',\n '@md/field-group:items-center',\n '@md/field-group:gap-4',\n '@md/field-group:*:w-auto',\n '@md/field-group:*:data-[slot=field-content]:basis-1/2',\n '@md/field-group:*:data-[slot=field-content-main]:basis-1/2',\n '@md/field-group:*:data-[slot=field-label]:flex-auto',\n '@md/field-group:has-[>[data-slot=field-content]]:items-start',\n '@md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n ],\n },\n },\n defaultVariants: {\n orientation: 'vertical',\n },\n});\n\n/**\n * Outermost `<fieldset>` wrapper that stacks multiple `Field` rows with consistent vertical spacing.\n *\n * @example\n * import { FieldSet } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <FieldSet>\n * <Field><FieldLabel>Name</FieldLabel><FieldContent><input /></FieldContent></Field>\n * </FieldSet>\n */\nconst FieldSet = memo(({ className, ...props }: React.ComponentProps<'fieldset'>) => {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn('flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3', className)}\n {...props}\n />\n );\n});\nFieldSet.displayName = 'FieldSet';\n\n/**\n * Props for {@link FieldLegend}.\n */\ntype FieldLegendProps = React.ComponentProps<'legend'> & {\n /**\n * Visual weight of the legend text.\n * - `'legend'` — larger base-size text (section heading).\n * - `'label'` — smaller label-size text (matches field label weight).\n * @default 'legend'\n */\n variant?: 'legend' | 'label';\n};\n\n/**\n * `<legend>` element for a `<fieldset>`, styled as either a section heading or a compact label.\n *\n * @example\n * import { FieldSet, FieldLegend } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <FieldSet>\n * <FieldLegend variant=\"legend\">Personal details</FieldLegend>\n * </FieldSet>\n */\nconst FieldLegend = memo(({ className, variant = 'legend', ...props }: FieldLegendProps) => {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn('mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base', className)}\n {...props}\n />\n );\n});\nFieldLegend.displayName = 'FieldLegend';\n\n/**\n * Container `<div>` that groups a set of `Field` rows with container-query support for responsive layouts.\n *\n * @example\n * import { FieldGroup } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <FieldGroup>\n * <Field>…</Field>\n * <Field>…</Field>\n * </FieldGroup>\n */\nconst FieldGroup = memo(({ className, ...props }: React.ComponentProps<'div'>) => {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n 'group/field-group @container/field-group',\n 'flex flex-col gap-7 pt-4',\n 'data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4',\n className\n )}\n {...props}\n />\n );\n});\nFieldGroup.displayName = 'FieldGroup';\n\n/**\n * Single form field row that arranges label, input, and meta elements with configurable orientation.\n *\n * @example\n * import { Field } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <Field orientation=\"horizontal\">\n * <FieldLabel htmlFor=\"username\">Username</FieldLabel>\n * <FieldContent><input id=\"username\" /></FieldContent>\n * </Field>\n */\nconst Field = memo(({ className, orientation = 'vertical', ...props }: React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>) => {\n return <div data-slot=\"field\" data-orientation={orientation} className={cn(fieldVariants({ orientation }), className)} {...props} />;\n});\nField.displayName = 'Field';\n\n/**\n * Flex column wrapper that houses the primary input control together with description and error slots.\n *\n * @example\n * import { FieldContent } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <FieldContent>\n * <input type=\"text\" />\n * <FieldDescription>Enter your full name.</FieldDescription>\n * </FieldContent>\n */\nconst FieldContent = memo(({ className, ...props }: React.ComponentProps<'div'>) => {\n return <div data-slot=\"field-content\" className={cn('group/field-content flex flex-col gap-1.5 leading-snug', className)} {...props} />;\n});\nFieldContent.displayName = 'FieldContent';\n\n/**\n * Positioned wrapper for the main input element that enables absolutely-placed adornments (icons, spinners).\n *\n * @example\n * import { FieldContentMain } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <FieldContentMain>\n * <input type=\"text\" className=\"pr-8\" />\n * <SearchIcon className=\"absolute right-2 top-2\" />\n * </FieldContentMain>\n */\nconst FieldContentMain = memo(({ className, ...props }: React.ComponentProps<'div'>) => {\n return <div data-slot=\"field-content-main\" className={cn('relative', className)} {...props} />;\n});\nFieldContentMain.displayName = 'FieldContentMain';\n\n/**\n * Styled `<label>` element for a `Field`, extending the base `Label` with field-group-aware spacing and border states.\n *\n * @example\n * import { FieldLabel } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <FieldLabel htmlFor=\"email\" aria-required>Email</FieldLabel>\n */\nconst FieldLabel = memo(({ className, ...props }: React.ComponentProps<typeof Label>) => {\n return (\n <Label\n data-slot=\"field-label\"\n className={cn(\n 'group/field-label peer/field-label min-h-6 gap-1 font-medium leading-snug',\n 'has-[>[data-slot=field]]:w-full',\n 'has-[>[data-slot=field]]:flex-col',\n 'has-[>[data-slot=field]]:rounded-md',\n 'has-[>[data-slot=field]]:border',\n 'has-[>[data-slot=field]]:border-border',\n 'has-data-[state=checked]:border-primary',\n '*:data-[slot=field]:p-4 group-data-[disabled=true]/field:opacity-50',\n className\n )}\n {...props}\n />\n );\n});\nFieldLabel.displayName = 'FieldLabel';\n\n/**\n * Inline title element (non-`<label>`) for fields whose label cannot be a native `<label>`, such as custom checkbox groups.\n *\n * @example\n * import { FieldTitle } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <FieldTitle>Notification preferences</FieldTitle>\n */\nconst FieldTitle = memo(({ className, ...props }: React.ComponentProps<'div'>) => {\n return (\n <div\n data-slot=\"field-label\"\n className={cn('flex w-fit items-center gap-2 font-medium text-sm leading-snug group-data-[disabled=true]/field:opacity-50', className)}\n {...props}\n />\n );\n});\nFieldTitle.displayName = 'FieldTitle';\n\n/**\n * Supplementary hint text rendered below the input to guide the user, with support for inline anchor links.\n *\n * @example\n * import { FieldDescription } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <FieldDescription>Must be at least 8 characters.</FieldDescription>\n */\nconst FieldDescription = memo(({ className, ...props }: React.ComponentProps<'p'>) => {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n // biome-ignore lint/security/noSecrets: true\n 'nth-last-2:-mt-1 font-normal text-text-positive-weak text-xs leading-normal last:mt-0 [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4 [[data-variant=legend]+&]:-mt-1.5',\n className\n )}\n {...props}\n />\n );\n});\nFieldDescription.displayName = 'FieldDescription';\n\n/**\n * Props for {@link FieldNote}.\n */\ntype FieldNoteProps = React.ComponentProps<'div'> & {\n /**\n * When `false` the note is not rendered at all; useful for conditional display without wrapper conditionals.\n * @default true\n */\n isShow?: boolean;\n};\n\n/**\n * Highlighted informational callout box with an info icon, shown below a field to surface contextual guidance.\n *\n * @example\n * import { FieldNote } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <FieldNote isShow={isDraftMode}>Changes are saved automatically in draft mode.</FieldNote>\n */\nconst FieldNote = memo(({ isShow = true, className, children, ...props }: FieldNoteProps) => {\n if (isShow === false) return null;\n return (\n <div\n data-slot=\"field-note\"\n className={cn(\n 'flex items-start gap-1.5 rounded border border-primary-muted/60 bg-primary-bg-subtle/80 px-2.5 py-2 text-text-positive-weak text-xs mt-1',\n className\n )}\n {...props}\n >\n <InfoIcon size={12} className=\"mt-0.5 shrink-0 text-primary/70\" />\n <span>{children}</span>\n </div>\n );\n});\nFieldNote.displayName = 'FieldNote';\n\n/**\n * Props for {@link FieldTooltip}.\n */\ntype FieldTooltipProps = {\n /** Text content displayed inside the tooltip when the help icon is hovered or focused. */\n tooltip: string;\n};\n\n/**\n * Small help-circle icon button that reveals a tooltip with additional field context on hover or focus.\n *\n * @example\n * import { FieldTooltip } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <FieldLabel>\n * Password <FieldTooltip tooltip=\"Use at least one uppercase letter and one number.\" />\n * </FieldLabel>\n */\nconst FieldTooltip = memo(({ tooltip }: FieldTooltipProps) => {\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n tabIndex={-1}\n className=\"inline-flex cursor-default items-center text-text-positive-weak/70 hover:text-text-positive focus:outline-none\"\n >\n <HelpCircleIcon size={13} aria-hidden=\"true\" />\n <span className=\"sr-only\">Thêm thông tin</span>\n </button>\n </TooltipTrigger>\n <TooltipContent side=\"top\" className=\"max-w-xs text-balance\">\n {tooltip}\n </TooltipContent>\n </Tooltip>\n );\n});\nFieldTooltip.displayName = 'FieldTooltip';\n\n/**\n * Visual divider row that optionally displays a centered text label, used to separate logical sections within a `FieldGroup`.\n *\n * @example\n * import { FieldSeparator } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <FieldSeparator>or</FieldSeparator>\n */\nconst FieldSeparator = memo(({ children, className, ...props }: React.PropsWithChildren<React.ComponentProps<'div'>>) => {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn('relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2', className)}\n {...props}\n >\n <Separator className=\"absolute inset-0 top-1/2\" />\n {children && (\n <span className=\"relative mx-auto block w-fit bg-background px-2 text-text-positive-weak\" data-slot=\"field-separator-content\">\n {children}\n </span>\n )}\n </div>\n );\n});\nFieldSeparator.displayName = 'FieldSeparator';\n\n/**\n * Props for {@link FieldError}.\n */\ntype FieldErrorProps = React.ComponentProps<'div'> & {\n errors?: Array<{ code?: string; message?: string } | undefined>;\n requiredMessage?: string;\n};\n\nconst FieldError = memo(({ className, children, errors, requiredMessage = 'Trường này là bắt buộc', ...props }: FieldErrorProps) => {\n const content = useMemo(() => {\n const resolve = (error: { code?: string; message?: string }) => (error.code === 'invalid_type' ? requiredMessage : error.message);\n\n if (children) {\n return children;\n }\n\n if (!errors) {\n return null;\n }\n\n if (errors?.length === 1 && errors[0]?.message) {\n return (\n <div className=\"flex flex-row items-center justify-start gap-x-0.5\">\n <p>{resolve(errors[0])}</p>\n </div>\n );\n }\n\n return (\n <ul className=\"flex list-none flex-col\">\n {errors.map(error => {\n if (typeof error === 'string') return <li key={error}>{error}</li>;\n if (!error?.message) return null;\n return <li key={error.code ?? error.message}>{resolve(error)}</li>;\n })}\n </ul>\n );\n }, [children, errors, requiredMessage]);\n\n if (!content) {\n return null;\n }\n\n return (\n <div role=\"alert\" data-slot=\"field-error\" className={cn('w-full font-medium text-danger-strong text-xs', className)} {...props}>\n {content}\n </div>\n );\n});\nFieldError.displayName = 'FieldError';\n\nexport {\n Field,\n FieldLabel,\n FieldDescription,\n FieldNote,\n FieldError,\n FieldGroup,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldContent,\n FieldContentMain,\n FieldTitle,\n FieldTooltip,\n};\n"],"mappings":"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"}