@customafk/lunas-ui 0.2.82 → 0.2.83

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 (273) hide show
  1. package/dist/{action-submit-kYjq-iPD.cjs → action-submit-B9vHpLoN.cjs} +2 -2
  2. package/dist/{action-submit-kYjq-iPD.cjs.map → action-submit-B9vHpLoN.cjs.map} +1 -1
  3. package/dist/{action-submit-DVNxnW4-.mjs → action-submit-BQdkz4mS.mjs} +2 -2
  4. package/dist/{action-submit-DVNxnW4-.mjs.map → action-submit-BQdkz4mS.mjs.map} +1 -1
  5. package/dist/{actions-form-DRrkiGzh.mjs → actions-form-D4n1W3-X.mjs} +2 -2
  6. package/dist/{actions-form-DRrkiGzh.mjs.map → actions-form-D4n1W3-X.mjs.map} +1 -1
  7. package/dist/{actions-form-CwicJU89.cjs → actions-form-DF2eYxGQ.cjs} +2 -2
  8. package/dist/{actions-form-CwicJU89.cjs.map → actions-form-DF2eYxGQ.cjs.map} +1 -1
  9. package/dist/{analysis-panel-BoKjkPYz.cjs → analysis-panel-B4ynYuwg.cjs} +2 -2
  10. package/dist/{analysis-panel-BoKjkPYz.cjs.map → analysis-panel-B4ynYuwg.cjs.map} +1 -1
  11. package/dist/{analysis-panel-CZ8g9AAO.mjs → analysis-panel-CcM3tBcc.mjs} +2 -2
  12. package/dist/{analysis-panel-CZ8g9AAO.mjs.map → analysis-panel-CcM3tBcc.mjs.map} +1 -1
  13. package/dist/{badge-BPiU1Ss2.d.cts → badge-C_NPjGXe.d.cts} +9 -2
  14. package/dist/{badge-BPiU1Ss2.d.mts → badge-C_NPjGXe.d.mts} +9 -2
  15. package/dist/{badge-display-DHbCN998.cjs → badge-display-C1_Fc3Sj.cjs} +2 -2
  16. package/dist/{badge-display-DHbCN998.cjs.map → badge-display-C1_Fc3Sj.cjs.map} +1 -1
  17. package/dist/{badge-display-B5m09_Hs.mjs → badge-display-DRmVhZ-C.mjs} +2 -2
  18. package/dist/{badge-display-B5m09_Hs.mjs.map → badge-display-DRmVhZ-C.mjs.map} +1 -1
  19. package/dist/{boolean-display-CzHHDfHW.mjs → boolean-display-ByTs3aOa.mjs} +2 -2
  20. package/dist/{boolean-display-CzHHDfHW.mjs.map → boolean-display-ByTs3aOa.mjs.map} +1 -1
  21. package/dist/{boolean-display-D2wjQhNX.cjs → boolean-display-DUA-6Q13.cjs} +2 -2
  22. package/dist/{boolean-display-D2wjQhNX.cjs.map → boolean-display-DUA-6Q13.cjs.map} +1 -1
  23. package/dist/{checkbox-field-BN3Vd9qq.mjs → checkbox-field-BRGTLOjq.mjs} +2 -2
  24. package/dist/{checkbox-field-BN3Vd9qq.mjs.map → checkbox-field-BRGTLOjq.mjs.map} +1 -1
  25. package/dist/{checkbox-field-DBUjQC_4.cjs → checkbox-field-ldZRSCca.cjs} +2 -2
  26. package/dist/{checkbox-field-DBUjQC_4.cjs.map → checkbox-field-ldZRSCca.cjs.map} +1 -1
  27. package/dist/{cms-layout-DCJhB-GY.cjs → cms-layout-BGsf1E4E.cjs} +2 -2
  28. package/dist/{cms-layout-DCJhB-GY.cjs.map → cms-layout-BGsf1E4E.cjs.map} +1 -1
  29. package/dist/{cms-layout-Ba_5wSnr.mjs → cms-layout-BHLo0_L_.mjs} +2 -2
  30. package/dist/{cms-layout-Ba_5wSnr.mjs.map → cms-layout-BHLo0_L_.mjs.map} +1 -1
  31. package/dist/combobox-Bhgo112r.cjs +2 -0
  32. package/dist/{combobox-kp_kPY8o.cjs.map → combobox-Bhgo112r.cjs.map} +1 -1
  33. package/dist/combobox-C0nno01T.mjs +2 -0
  34. package/dist/{combobox-C64Rvd7n.mjs.map → combobox-C0nno01T.mjs.map} +1 -1
  35. package/dist/{combobox-field-Bug1qI5B.mjs → combobox-field-CvkdZkQE.mjs} +2 -2
  36. package/dist/{combobox-field-Bug1qI5B.mjs.map → combobox-field-CvkdZkQE.mjs.map} +1 -1
  37. package/dist/{combobox-field-BE9miJ3D.cjs → combobox-field-ZYr7636s.cjs} +2 -2
  38. package/dist/{combobox-field-BE9miJ3D.cjs.map → combobox-field-ZYr7636s.cjs.map} +1 -1
  39. package/dist/{currency-display-B06kc2IG.cjs → currency-display-DefLJLqL.cjs} +2 -2
  40. package/dist/{currency-display-B06kc2IG.cjs.map → currency-display-DefLJLqL.cjs.map} +1 -1
  41. package/dist/{currency-display-7w-ZjVUw.mjs → currency-display-DpbtUluj.mjs} +2 -2
  42. package/dist/{currency-display-7w-ZjVUw.mjs.map → currency-display-DpbtUluj.mjs.map} +1 -1
  43. package/dist/data-display/phone-number.cjs +1 -1
  44. package/dist/data-display/phone-number.cjs.map +1 -1
  45. package/dist/data-display/phone-number.d.cts +1 -1
  46. package/dist/data-display/phone-number.d.mts +1 -1
  47. package/dist/data-display/phone-number.mjs +1 -1
  48. package/dist/data-display/phone-number.mjs.map +1 -1
  49. package/dist/{date-display-BO7OY_AC.mjs → date-display-ByvkuSk0.mjs} +2 -2
  50. package/dist/{date-display-BO7OY_AC.mjs.map → date-display-ByvkuSk0.mjs.map} +1 -1
  51. package/dist/{date-display-DHnZr_yf.cjs → date-display-CkPBLlWz.cjs} +2 -2
  52. package/dist/{date-display-DHnZr_yf.cjs.map → date-display-CkPBLlWz.cjs.map} +1 -1
  53. package/dist/{date-field-CYoPe74G.cjs → date-field-1Hmcv8Zp.cjs} +2 -2
  54. package/dist/{date-field-CYoPe74G.cjs.map → date-field-1Hmcv8Zp.cjs.map} +1 -1
  55. package/dist/{date-field-D_qpBb-t.mjs → date-field-DGMTG_hu.mjs} +2 -2
  56. package/dist/{date-field-D_qpBb-t.mjs.map → date-field-DGMTG_hu.mjs.map} +1 -1
  57. package/dist/{description-display-CBfoP3Y2.mjs → description-display-BFTBwDmB.mjs} +2 -2
  58. package/dist/{description-display-CBfoP3Y2.mjs.map → description-display-BFTBwDmB.mjs.map} +1 -1
  59. package/dist/{description-display-Cckihd1s.cjs → description-display-DeEwppdC.cjs} +2 -2
  60. package/dist/{description-display-Cckihd1s.cjs.map → description-display-DeEwppdC.cjs.map} +1 -1
  61. package/dist/descriptions-Bw9GSCjo.mjs +3 -0
  62. package/dist/descriptions-Bw9GSCjo.mjs.map +1 -0
  63. package/dist/descriptions-DUsJjqd2.cjs +3 -0
  64. package/dist/descriptions-DUsJjqd2.cjs.map +1 -0
  65. package/dist/{dialog-form-CCIcht28.mjs → dialog-form-BRSZpRTC.mjs} +2 -2
  66. package/dist/{dialog-form-CCIcht28.mjs.map → dialog-form-BRSZpRTC.mjs.map} +1 -1
  67. package/dist/{dialog-form-BTZZwz3T.cjs → dialog-form-C1qpltYx.cjs} +2 -2
  68. package/dist/{dialog-form-BTZZwz3T.cjs.map → dialog-form-C1qpltYx.cjs.map} +1 -1
  69. package/dist/{email-display-w-hRYIeL.cjs → email-display-BXw4IbbW.cjs} +2 -2
  70. package/dist/{email-display-w-hRYIeL.cjs.map → email-display-BXw4IbbW.cjs.map} +1 -1
  71. package/dist/{email-display-Bk_furIx.mjs → email-display-qxdrnYmK.mjs} +2 -2
  72. package/dist/{email-display-Bk_furIx.mjs.map → email-display-qxdrnYmK.mjs.map} +1 -1
  73. package/dist/{email-field-DxSNJ6tf.mjs → email-field-C2Lvl_rQ.mjs} +2 -2
  74. package/dist/{email-field-DxSNJ6tf.mjs.map → email-field-C2Lvl_rQ.mjs.map} +1 -1
  75. package/dist/{email-field-DJa7iASY.cjs → email-field-D3nSkHj2.cjs} +2 -2
  76. package/dist/{email-field-DJa7iASY.cjs.map → email-field-D3nSkHj2.cjs.map} +1 -1
  77. package/dist/features/descriptions/index.cjs +1 -2
  78. package/dist/features/descriptions/index.d.cts +2 -2
  79. package/dist/features/descriptions/index.d.mts +2 -2
  80. package/dist/features/descriptions/index.mjs +1 -2
  81. package/dist/features/tables/index.cjs +1 -1
  82. package/dist/features/tables/index.d.cts +1 -1
  83. package/dist/features/tables/index.d.mts +1 -1
  84. package/dist/features/tables/index.mjs +1 -1
  85. package/dist/features/tanstack-form/index.cjs +1 -1
  86. package/dist/features/tanstack-form/index.mjs +1 -1
  87. package/dist/{filter-BO7ISTIR.mjs → filter-DM4QLW77.mjs} +2 -2
  88. package/dist/{filter-BO7ISTIR.mjs.map → filter-DM4QLW77.mjs.map} +1 -1
  89. package/dist/{filter-CQ9BD0MV.cjs → filter-DQEjSnOP.cjs} +2 -2
  90. package/dist/{filter-CQ9BD0MV.cjs.map → filter-DQEjSnOP.cjs.map} +1 -1
  91. package/dist/{flex-CrxTaAXE.d.cts → flex-C63_IqSY.d.cts} +6 -4
  92. package/dist/{flex-CrxTaAXE.d.mts → flex-C63_IqSY.d.mts} +6 -4
  93. package/dist/{index-DaLpXe5l.d.cts → index--wNkNzCB.d.cts} +5 -5
  94. package/dist/index-Cp4Db57w.d.cts +598 -0
  95. package/dist/index-CqE3mOHo.d.mts +598 -0
  96. package/dist/{index-BPo-Lg3p.d.mts → index-CrkOhm--.d.mts} +5 -5
  97. package/dist/index.cjs +1 -1
  98. package/dist/index.d.cts +8 -8
  99. package/dist/index.d.mts +8 -8
  100. package/dist/index.mjs +1 -1
  101. package/dist/layouts/cms-layout/index.cjs +1 -1
  102. package/dist/layouts/cms-layout/index.mjs +1 -1
  103. package/dist/layouts/flex.cjs +1 -1
  104. package/dist/layouts/flex.cjs.map +1 -1
  105. package/dist/layouts/flex.d.cts +1 -1
  106. package/dist/layouts/flex.d.mts +1 -1
  107. package/dist/layouts/flex.mjs +1 -1
  108. package/dist/layouts/flex.mjs.map +1 -1
  109. package/dist/layouts/payment-layout/index.cjs +1 -1
  110. package/dist/layouts/payment-layout/index.mjs +1 -1
  111. package/dist/layouts/ui-grid.cjs +1 -1
  112. package/dist/layouts/ui-grid.cjs.map +1 -1
  113. package/dist/layouts/ui-grid.d.cts +1 -1
  114. package/dist/layouts/ui-grid.d.mts +1 -1
  115. package/dist/layouts/ui-grid.mjs +1 -1
  116. package/dist/layouts/ui-grid.mjs.map +1 -1
  117. package/dist/{list-display-DLsm8uAh.mjs → list-display-4tTkV29U.mjs} +2 -2
  118. package/dist/{list-display-DLsm8uAh.mjs.map → list-display-4tTkV29U.mjs.map} +1 -1
  119. package/dist/{list-display-DDeJoneW.cjs → list-display-CJvQ-wwT.cjs} +2 -2
  120. package/dist/{list-display-DDeJoneW.cjs.map → list-display-CJvQ-wwT.cjs.map} +1 -1
  121. package/dist/{name-display-H5HFH1fU.mjs → name-display-BFoDcvt2.mjs} +2 -2
  122. package/dist/{name-display-H5HFH1fU.mjs.map → name-display-BFoDcvt2.mjs.map} +1 -1
  123. package/dist/{name-display-CKnyugrP.cjs → name-display-Br7rcdqi.cjs} +2 -2
  124. package/dist/{name-display-CKnyugrP.cjs.map → name-display-Br7rcdqi.cjs.map} +1 -1
  125. package/dist/{number-field-5INgdUUv.mjs → number-field-CR5PLX6H.mjs} +2 -2
  126. package/dist/{number-field-5INgdUUv.mjs.map → number-field-CR5PLX6H.mjs.map} +1 -1
  127. package/dist/{number-field-DKZz-27X.cjs → number-field-CWDYA3La.cjs} +2 -2
  128. package/dist/{number-field-DKZz-27X.cjs.map → number-field-CWDYA3La.cjs.map} +1 -1
  129. package/dist/{password-field-DOIe6wTv.mjs → password-field-B2_kzss6.mjs} +2 -2
  130. package/dist/{password-field-DOIe6wTv.mjs.map → password-field-B2_kzss6.mjs.map} +1 -1
  131. package/dist/{password-field-BuWARi35.cjs → password-field-BHRhVyZ0.cjs} +2 -2
  132. package/dist/{password-field-BuWARi35.cjs.map → password-field-BHRhVyZ0.cjs.map} +1 -1
  133. package/dist/{payment-layout-BSl9DYQA.mjs → payment-layout--b7bhmR1.mjs} +2 -2
  134. package/dist/{payment-layout-BSl9DYQA.mjs.map → payment-layout--b7bhmR1.mjs.map} +1 -1
  135. package/dist/payment-layout-BZtIcu-3.cjs +2 -0
  136. package/dist/{payment-layout-DDcLanA0.cjs.map → payment-layout-BZtIcu-3.cjs.map} +1 -1
  137. package/dist/{permalink-CaCx9fi6.mjs → permalink-BPCF_npZ.mjs} +2 -2
  138. package/dist/{permalink-CaCx9fi6.mjs.map → permalink-BPCF_npZ.mjs.map} +1 -1
  139. package/dist/{permalink-azuGQg2b.cjs → permalink-DCvWlrAT.cjs} +2 -2
  140. package/dist/{permalink-azuGQg2b.cjs.map → permalink-DCvWlrAT.cjs.map} +1 -1
  141. package/dist/phone-CTTjc3mv.mjs +2 -0
  142. package/dist/phone-CTTjc3mv.mjs.map +1 -0
  143. package/dist/phone-CUxXVTg6.cjs +2 -0
  144. package/dist/phone-CUxXVTg6.cjs.map +1 -0
  145. package/dist/{phone-number-D9j5xYDW.d.cts → phone-number-B1bLIt8i.d.cts} +3 -3
  146. package/dist/{phone-number-D9j5xYDW.d.mts → phone-number-B1bLIt8i.d.mts} +3 -3
  147. package/dist/{phone-number-Ba-f4s1Y.mjs → phone-number-DHFLnHWO.mjs} +2 -2
  148. package/dist/{phone-number-Ba-f4s1Y.mjs.map → phone-number-DHFLnHWO.mjs.map} +1 -1
  149. package/dist/{phone-number-BqRhKQdr.cjs → phone-number-YzmDmFBU.cjs} +2 -2
  150. package/dist/{phone-number-BqRhKQdr.cjs.map → phone-number-YzmDmFBU.cjs.map} +1 -1
  151. package/dist/{popover-form-BsapHJck.mjs → popover-form-CeRVpy1B.mjs} +2 -2
  152. package/dist/{popover-form-BsapHJck.mjs.map → popover-form-CeRVpy1B.mjs.map} +1 -1
  153. package/dist/{popover-form-Bq2GcuZu.cjs → popover-form-Ch_iMMSm.cjs} +2 -2
  154. package/dist/{popover-form-Bq2GcuZu.cjs.map → popover-form-Ch_iMMSm.cjs.map} +1 -1
  155. package/dist/{progress-display-CiYWPOnq.cjs → progress-display-57LT7U37.cjs} +2 -2
  156. package/dist/{progress-display-CiYWPOnq.cjs.map → progress-display-57LT7U37.cjs.map} +1 -1
  157. package/dist/{progress-display-0UsBzt_r.mjs → progress-display-AfoHitiE.mjs} +2 -2
  158. package/dist/{progress-display-0UsBzt_r.mjs.map → progress-display-AfoHitiE.mjs.map} +1 -1
  159. package/dist/{radio-group-field-kTgtvp1p.cjs → radio-group-field-BFhBfzoT.cjs} +2 -2
  160. package/dist/{radio-group-field-kTgtvp1p.cjs.map → radio-group-field-BFhBfzoT.cjs.map} +1 -1
  161. package/dist/{radio-group-field-DOJ4jVSr.mjs → radio-group-field-Iwo2Q2Ig.mjs} +2 -2
  162. package/dist/{radio-group-field-DOJ4jVSr.mjs.map → radio-group-field-Iwo2Q2Ig.mjs.map} +1 -1
  163. package/dist/{resizable-C3uADYIg.d.mts → resizable-CNqPu4Ck.d.cts} +2 -2
  164. package/dist/{resizable-C3uADYIg.d.cts → resizable-CNqPu4Ck.d.mts} +2 -2
  165. package/dist/{select-field-CURv37h4.cjs → select-field-CvDBZQTl.cjs} +2 -2
  166. package/dist/{select-field-CURv37h4.cjs.map → select-field-CvDBZQTl.cjs.map} +1 -1
  167. package/dist/{select-field-BcsFBbNJ.mjs → select-field-NJgDDCO2.mjs} +2 -2
  168. package/dist/{select-field-BcsFBbNJ.mjs.map → select-field-NJgDDCO2.mjs.map} +1 -1
  169. package/dist/{simple-array-field-wFE_DUOV.mjs → simple-array-field-BwNCeUnn.mjs} +2 -2
  170. package/dist/{simple-array-field-wFE_DUOV.mjs.map → simple-array-field-BwNCeUnn.mjs.map} +1 -1
  171. package/dist/{simple-array-field-bCUuPMgT.cjs → simple-array-field-aGXkDZXD.cjs} +2 -2
  172. package/dist/{simple-array-field-bCUuPMgT.cjs.map → simple-array-field-aGXkDZXD.cjs.map} +1 -1
  173. package/dist/{simple-boolean-field-DRapzNrB.cjs → simple-boolean-field-BeVkn3c4.cjs} +2 -2
  174. package/dist/{simple-boolean-field-DRapzNrB.cjs.map → simple-boolean-field-BeVkn3c4.cjs.map} +1 -1
  175. package/dist/{simple-boolean-field-GQJyeyVS.mjs → simple-boolean-field-t_XDXqYs.mjs} +2 -2
  176. package/dist/{simple-boolean-field-GQJyeyVS.mjs.map → simple-boolean-field-t_XDXqYs.mjs.map} +1 -1
  177. package/dist/{simple-combobox-field-D6IaMJKl.mjs → simple-combobox-field-HCB4A33-.mjs} +2 -2
  178. package/dist/{simple-combobox-field-D6IaMJKl.mjs.map → simple-combobox-field-HCB4A33-.mjs.map} +1 -1
  179. package/dist/{simple-combobox-field-Cp5dfQv3.cjs → simple-combobox-field-U0ZAl7VQ.cjs} +2 -2
  180. package/dist/{simple-combobox-field-Cp5dfQv3.cjs.map → simple-combobox-field-U0ZAl7VQ.cjs.map} +1 -1
  181. package/dist/{simple-date-field-dszQs7Ik.mjs → simple-date-field-Dj4bJoji.mjs} +2 -2
  182. package/dist/{simple-date-field-dszQs7Ik.mjs.map → simple-date-field-Dj4bJoji.mjs.map} +1 -1
  183. package/dist/{simple-date-field-_PSkIXAt.cjs → simple-date-field-DtxEpEZj.cjs} +2 -2
  184. package/dist/{simple-date-field-_PSkIXAt.cjs.map → simple-date-field-DtxEpEZj.cjs.map} +1 -1
  185. package/dist/{simple-email-field-CwyoXqWo.mjs → simple-email-field-BDyhkmHV.mjs} +2 -2
  186. package/dist/{simple-email-field-CwyoXqWo.mjs.map → simple-email-field-BDyhkmHV.mjs.map} +1 -1
  187. package/dist/{simple-email-field-DIHwYrhk.cjs → simple-email-field-DK9I_Tc_.cjs} +2 -2
  188. package/dist/{simple-email-field-DIHwYrhk.cjs.map → simple-email-field-DK9I_Tc_.cjs.map} +1 -1
  189. package/dist/{simple-number-field-VdEeaIiC.cjs → simple-number-field-BspqWU-3.cjs} +2 -2
  190. package/dist/{simple-number-field-VdEeaIiC.cjs.map → simple-number-field-BspqWU-3.cjs.map} +1 -1
  191. package/dist/{simple-number-field-Id1kV5yR.mjs → simple-number-field-hneXMhfJ.mjs} +2 -2
  192. package/dist/{simple-number-field-Id1kV5yR.mjs.map → simple-number-field-hneXMhfJ.mjs.map} +1 -1
  193. package/dist/{simple-password-field-7xbVB1H3.cjs → simple-password-field-BEEcleom.cjs} +2 -2
  194. package/dist/{simple-password-field-7xbVB1H3.cjs.map → simple-password-field-BEEcleom.cjs.map} +1 -1
  195. package/dist/{simple-password-field-DIO9FwQy.mjs → simple-password-field-vsLRHDk4.mjs} +2 -2
  196. package/dist/{simple-password-field-DIO9FwQy.mjs.map → simple-password-field-vsLRHDk4.mjs.map} +1 -1
  197. package/dist/{simple-radio-group-field-BmHWRnns.mjs → simple-radio-group-field-BURm_BSA.mjs} +2 -2
  198. package/dist/{simple-radio-group-field-BmHWRnns.mjs.map → simple-radio-group-field-BURm_BSA.mjs.map} +1 -1
  199. package/dist/{simple-radio-group-field-CxVAr6yW.cjs → simple-radio-group-field-Wm8xB0fN.cjs} +2 -2
  200. package/dist/{simple-radio-group-field-CxVAr6yW.cjs.map → simple-radio-group-field-Wm8xB0fN.cjs.map} +1 -1
  201. package/dist/{simple-select-field-DfZk0zPa.mjs → simple-select-field-8cY51U4d.mjs} +2 -2
  202. package/dist/{simple-select-field-DfZk0zPa.mjs.map → simple-select-field-8cY51U4d.mjs.map} +1 -1
  203. package/dist/{simple-select-field-C9u7Pg9u.cjs → simple-select-field-QQ65caBf.cjs} +2 -2
  204. package/dist/{simple-select-field-C9u7Pg9u.cjs.map → simple-select-field-QQ65caBf.cjs.map} +1 -1
  205. package/dist/{simple-text-field-BxPjcB4c.cjs → simple-text-field-BHkCPiE5.cjs} +2 -2
  206. package/dist/{simple-text-field-BxPjcB4c.cjs.map → simple-text-field-BHkCPiE5.cjs.map} +1 -1
  207. package/dist/{simple-text-field-CT9KFUSK.mjs → simple-text-field-DK72_OA_.mjs} +2 -2
  208. package/dist/{simple-text-field-CT9KFUSK.mjs.map → simple-text-field-DK72_OA_.mjs.map} +1 -1
  209. package/dist/{simple-textarea-field-B22rT6zS.mjs → simple-textarea-field-B72nNQHv.mjs} +2 -2
  210. package/dist/{simple-textarea-field-B22rT6zS.mjs.map → simple-textarea-field-B72nNQHv.mjs.map} +1 -1
  211. package/dist/{simple-textarea-field-DG9oPtP-.cjs → simple-textarea-field-Bu5h7sfH.cjs} +2 -2
  212. package/dist/{simple-textarea-field-DG9oPtP-.cjs.map → simple-textarea-field-Bu5h7sfH.cjs.map} +1 -1
  213. package/dist/{statistic-CE_Jg8SN.cjs → statistic-CXBTEgKI.cjs} +2 -2
  214. package/dist/{statistic-CE_Jg8SN.cjs.map → statistic-CXBTEgKI.cjs.map} +1 -1
  215. package/dist/{statistic-639yMA2d.mjs → statistic-CvgurN5Z.mjs} +2 -2
  216. package/dist/{statistic-639yMA2d.mjs.map → statistic-CvgurN5Z.mjs.map} +1 -1
  217. package/dist/{status-display-BCYpNJmd.mjs → status-display-Caae2aYf.mjs} +2 -2
  218. package/dist/{status-display-BCYpNJmd.mjs.map → status-display-Caae2aYf.mjs.map} +1 -1
  219. package/dist/{status-display-xcCCGpGS.cjs → status-display-EVwkPrm6.cjs} +2 -2
  220. package/dist/{status-display-xcCCGpGS.cjs.map → status-display-EVwkPrm6.cjs.map} +1 -1
  221. package/dist/{summary-bar-C3NAnI3V.mjs → summary-bar-B6B_wmZA.mjs} +2 -2
  222. package/dist/{summary-bar-C3NAnI3V.mjs.map → summary-bar-B6B_wmZA.mjs.map} +1 -1
  223. package/dist/{summary-bar-C08g8bb1.cjs → summary-bar-D36n4fox.cjs} +2 -2
  224. package/dist/{summary-bar-C08g8bb1.cjs.map → summary-bar-D36n4fox.cjs.map} +1 -1
  225. package/dist/{switch-field-Cz4lDf1D.mjs → switch-field-DoPUWb9d.mjs} +2 -2
  226. package/dist/{switch-field-Cz4lDf1D.mjs.map → switch-field-DoPUWb9d.mjs.map} +1 -1
  227. package/dist/{switch-field-yE4A6EoF.cjs → switch-field-eLVlQZSI.cjs} +2 -2
  228. package/dist/{switch-field-yE4A6EoF.cjs.map → switch-field-eLVlQZSI.cjs.map} +1 -1
  229. package/dist/{tables-Dg3KMBKA.mjs → tables-CuoBQNqx.mjs} +2 -2
  230. package/dist/{tables-Dg3KMBKA.mjs.map → tables-CuoBQNqx.mjs.map} +1 -1
  231. package/dist/{tables-BqZ4Zs6e.cjs → tables-DdLEj1dI.cjs} +2 -2
  232. package/dist/{tables-BqZ4Zs6e.cjs.map → tables-DdLEj1dI.cjs.map} +1 -1
  233. package/dist/{tanstack-form-BxqS40rB.cjs → tanstack-form-C0ab8EEl.cjs} +2 -2
  234. package/dist/{tanstack-form-BxqS40rB.cjs.map → tanstack-form-C0ab8EEl.cjs.map} +1 -1
  235. package/dist/{tanstack-form-q9hDCc0Y.mjs → tanstack-form-fkaBh9RO.mjs} +2 -2
  236. package/dist/{tanstack-form-q9hDCc0Y.mjs.map → tanstack-form-fkaBh9RO.mjs.map} +1 -1
  237. package/dist/{text-editor-field-CQ8tnZFw.mjs → text-editor-field-B6HEsAHt.mjs} +2 -2
  238. package/dist/{text-editor-field-CQ8tnZFw.mjs.map → text-editor-field-B6HEsAHt.mjs.map} +1 -1
  239. package/dist/{text-editor-field-CxU-KMMn.cjs → text-editor-field-DcEUC0iH.cjs} +2 -2
  240. package/dist/{text-editor-field-CxU-KMMn.cjs.map → text-editor-field-DcEUC0iH.cjs.map} +1 -1
  241. package/dist/{text-field-B3xlvEUN.mjs → text-field-Bm-k6Jr7.mjs} +2 -2
  242. package/dist/{text-field-B3xlvEUN.mjs.map → text-field-Bm-k6Jr7.mjs.map} +1 -1
  243. package/dist/{text-field-BQovKYN-.cjs → text-field-DT50dOVI.cjs} +2 -2
  244. package/dist/{text-field-BQovKYN-.cjs.map → text-field-DT50dOVI.cjs.map} +1 -1
  245. package/dist/{textarea-field-B38SnNv4.cjs → textarea-field-BhqX29CS.cjs} +2 -2
  246. package/dist/{textarea-field-B38SnNv4.cjs.map → textarea-field-BhqX29CS.cjs.map} +1 -1
  247. package/dist/{textarea-field-u2UUwtr_.mjs → textarea-field-DNLyrRH7.mjs} +2 -2
  248. package/dist/{textarea-field-u2UUwtr_.mjs.map → textarea-field-DNLyrRH7.mjs.map} +1 -1
  249. package/dist/{tooltip-BVzKgxrZ.cjs → tooltip-CUyGXE9e.cjs} +3 -3
  250. package/dist/{tooltip-BVzKgxrZ.cjs.map → tooltip-CUyGXE9e.cjs.map} +1 -1
  251. package/dist/{tooltip-D7U_Nl5c.mjs → tooltip-DSxSeIak.mjs} +3 -3
  252. package/dist/{tooltip-D7U_Nl5c.mjs.map → tooltip-DSxSeIak.mjs.map} +1 -1
  253. package/dist/ui/badge.cjs +1 -1
  254. package/dist/ui/badge.cjs.map +1 -1
  255. package/dist/ui/badge.d.cts +2 -2
  256. package/dist/ui/badge.d.mts +2 -2
  257. package/dist/ui/badge.mjs +1 -1
  258. package/dist/ui/badge.mjs.map +1 -1
  259. package/dist/ui/combobox.cjs +1 -1
  260. package/dist/ui/combobox.mjs +1 -1
  261. package/dist/ui/resizable.d.cts +1 -1
  262. package/dist/ui/resizable.d.mts +1 -1
  263. package/dist/{ui-grid-CzL5J7cm.d.cts → ui-grid-D1-Ponqs.d.cts} +5 -5
  264. package/dist/{ui-grid-CzL5J7cm.d.mts → ui-grid-D1-Ponqs.d.mts} +5 -5
  265. package/package.json +2 -3
  266. package/ai-docs.md +0 -419
  267. package/dist/combobox-C64Rvd7n.mjs +0 -2
  268. package/dist/combobox-kp_kPY8o.cjs +0 -2
  269. package/dist/features/descriptions/index.cjs.map +0 -1
  270. package/dist/features/descriptions/index.mjs.map +0 -1
  271. package/dist/index-BMuVmm7f.d.mts +0 -236
  272. package/dist/index-CLx89ATZ.d.cts +0 -236
  273. package/dist/payment-layout-DDcLanA0.cjs +0 -2
@@ -1,2 +1,2 @@
1
- import{Q as e}from"./tables-Dg3KMBKA.mjs";import{ExternalLinkIcon as t}from"lucide-react";import{jsx as n,jsxs as r}from"react/jsx-runtime";const i=({href:i,label:a})=>i?r(`a`,{href:i,target:`_blank`,className:`inline-flex items-center gap-1 truncate text-primary text-sm underline`,rel:`noopener noreferrer`,children:[n(`span`,{children:a||i}),n(t,{size:14})]}):n(e,{});export{i as UITablePermalink};
2
- //# sourceMappingURL=permalink-CaCx9fi6.mjs.map
1
+ import{Q as e}from"./tables-CuoBQNqx.mjs";import{ExternalLinkIcon as t}from"lucide-react";import{jsx as n,jsxs as r}from"react/jsx-runtime";const i=({href:i,label:a})=>i?r(`a`,{href:i,target:`_blank`,className:`inline-flex items-center gap-1 truncate text-primary text-sm underline`,rel:`noopener noreferrer`,children:[n(`span`,{children:a||i}),n(t,{size:14})]}):n(e,{});export{i as UITablePermalink};
2
+ //# sourceMappingURL=permalink-BPCF_npZ.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"permalink-CaCx9fi6.mjs","names":[],"sources":["../packages/components/features/tables/components/atoms/permalink.tsx"],"sourcesContent":["import { ExternalLinkIcon } from 'lucide-react';\n\nimport { UITableEmpty } from './empty';\n\n/**\n * Renders an external-link anchor with an icon for use in table cells, opening\n * the target URL in a new tab with safe `rel` attributes. Renders\n * {@link UITableEmpty} when `href` is absent.\n *\n * @example\n * import { UITablePermalink } from '@customafk/lunas-ui/features/tables';\n *\n * <UITablePermalink href=\"https://example.com/records/42\" label=\"View record\" />\n */\nexport const UITablePermalink: React.FC<{\n /** The destination URL the anchor navigates to; `null`/`undefined`/empty renders an empty state. */\n href: string | null | undefined;\n /** Optional display text; falls back to the raw `href` when omitted. */\n label?: string;\n}> = ({ href, label }) => {\n if (!href) return <UITableEmpty />;\n\n return (\n <a href={href} target=\"_blank\" className=\"inline-flex items-center gap-1 truncate text-primary text-sm underline\" rel=\"noopener noreferrer\">\n <span>{label || href}</span>\n <ExternalLinkIcon size={14} />\n </a>\n );\n};\n"],"mappings":"4IAcA,MAAa,GAKP,CAAE,OAAM,WACP,EAGH,EAAC,IAAD,CAAS,OAAM,OAAO,SAAS,UAAU,yEAAyE,IAAI,sBAAtH,SAAA,CACE,EAAC,OAAD,CAAA,SAAO,GAAS,CAAW,CAAA,EAC3B,EAAC,EAAD,CAAkB,KAAM,EAAK,CAAA,CAC5B,IANa,EAAC,EAAD,CAAe,CAAA"}
1
+ {"version":3,"file":"permalink-BPCF_npZ.mjs","names":[],"sources":["../packages/components/features/tables/components/atoms/permalink.tsx"],"sourcesContent":["import { ExternalLinkIcon } from 'lucide-react';\n\nimport { UITableEmpty } from './empty';\n\n/**\n * Renders an external-link anchor with an icon for use in table cells, opening\n * the target URL in a new tab with safe `rel` attributes. Renders\n * {@link UITableEmpty} when `href` is absent.\n *\n * @example\n * import { UITablePermalink } from '@customafk/lunas-ui/features/tables';\n *\n * <UITablePermalink href=\"https://example.com/records/42\" label=\"View record\" />\n */\nexport const UITablePermalink: React.FC<{\n /** The destination URL the anchor navigates to; `null`/`undefined`/empty renders an empty state. */\n href: string | null | undefined;\n /** Optional display text; falls back to the raw `href` when omitted. */\n label?: string;\n}> = ({ href, label }) => {\n if (!href) return <UITableEmpty />;\n\n return (\n <a href={href} target=\"_blank\" className=\"inline-flex items-center gap-1 truncate text-primary text-sm underline\" rel=\"noopener noreferrer\">\n <span>{label || href}</span>\n <ExternalLinkIcon size={14} />\n </a>\n );\n};\n"],"mappings":"4IAcA,MAAa,GAKP,CAAE,OAAM,WACP,EAGH,EAAC,IAAD,CAAS,OAAM,OAAO,SAAS,UAAU,yEAAyE,IAAI,sBAAtH,SAAA,CACE,EAAC,OAAD,CAAA,SAAO,GAAS,CAAW,CAAA,EAC3B,EAAC,EAAD,CAAkB,KAAM,EAAK,CAAA,CAC5B,IANa,EAAC,EAAD,CAAe,CAAA"}
@@ -1,2 +1,2 @@
1
- const e=require("./tables-BqZ4Zs6e.cjs");let t=require("lucide-react"),n=require("react/jsx-runtime");const r=({href:r,label:i})=>r?(0,n.jsxs)(`a`,{href:r,target:`_blank`,className:`inline-flex items-center gap-1 truncate text-primary text-sm underline`,rel:`noopener noreferrer`,children:[(0,n.jsx)(`span`,{children:i||r}),(0,n.jsx)(t.ExternalLinkIcon,{size:14})]}):(0,n.jsx)(e.Q,{});exports.UITablePermalink=r;
2
- //# sourceMappingURL=permalink-azuGQg2b.cjs.map
1
+ const e=require("./tables-DdLEj1dI.cjs");let t=require("lucide-react"),n=require("react/jsx-runtime");const r=({href:r,label:i})=>r?(0,n.jsxs)(`a`,{href:r,target:`_blank`,className:`inline-flex items-center gap-1 truncate text-primary text-sm underline`,rel:`noopener noreferrer`,children:[(0,n.jsx)(`span`,{children:i||r}),(0,n.jsx)(t.ExternalLinkIcon,{size:14})]}):(0,n.jsx)(e.Q,{});exports.UITablePermalink=r;
2
+ //# sourceMappingURL=permalink-DCvWlrAT.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"permalink-azuGQg2b.cjs","names":["UITableEmpty","ExternalLinkIcon"],"sources":["../packages/components/features/tables/components/atoms/permalink.tsx"],"sourcesContent":["import { ExternalLinkIcon } from 'lucide-react';\n\nimport { UITableEmpty } from './empty';\n\n/**\n * Renders an external-link anchor with an icon for use in table cells, opening\n * the target URL in a new tab with safe `rel` attributes. Renders\n * {@link UITableEmpty} when `href` is absent.\n *\n * @example\n * import { UITablePermalink } from '@customafk/lunas-ui/features/tables';\n *\n * <UITablePermalink href=\"https://example.com/records/42\" label=\"View record\" />\n */\nexport const UITablePermalink: React.FC<{\n /** The destination URL the anchor navigates to; `null`/`undefined`/empty renders an empty state. */\n href: string | null | undefined;\n /** Optional display text; falls back to the raw `href` when omitted. */\n label?: string;\n}> = ({ href, label }) => {\n if (!href) return <UITableEmpty />;\n\n return (\n <a href={href} target=\"_blank\" className=\"inline-flex items-center gap-1 truncate text-primary text-sm underline\" rel=\"noopener noreferrer\">\n <span>{label || href}</span>\n <ExternalLinkIcon size={14} />\n </a>\n );\n};\n"],"mappings":"sGAcA,MAAa,GAKP,CAAE,OAAM,WACP,GAGH,EAAA,EAAA,KAAA,CAAC,IAAD,CAAS,OAAM,OAAO,SAAS,UAAU,yEAAyE,IAAI,sBAAtH,SAAA,EACE,EAAA,EAAA,IAAA,CAAC,OAAD,CAAA,SAAO,GAAS,CAAW,CAAA,GAC3B,EAAA,EAAA,IAAA,CAACC,EAAAA,iBAAD,CAAkB,KAAM,EAAK,CAAA,CAC5B,KANa,EAAA,EAAA,IAAA,CAACD,EAAAA,EAAD,CAAe,CAAA"}
1
+ {"version":3,"file":"permalink-DCvWlrAT.cjs","names":["UITableEmpty","ExternalLinkIcon"],"sources":["../packages/components/features/tables/components/atoms/permalink.tsx"],"sourcesContent":["import { ExternalLinkIcon } from 'lucide-react';\n\nimport { UITableEmpty } from './empty';\n\n/**\n * Renders an external-link anchor with an icon for use in table cells, opening\n * the target URL in a new tab with safe `rel` attributes. Renders\n * {@link UITableEmpty} when `href` is absent.\n *\n * @example\n * import { UITablePermalink } from '@customafk/lunas-ui/features/tables';\n *\n * <UITablePermalink href=\"https://example.com/records/42\" label=\"View record\" />\n */\nexport const UITablePermalink: React.FC<{\n /** The destination URL the anchor navigates to; `null`/`undefined`/empty renders an empty state. */\n href: string | null | undefined;\n /** Optional display text; falls back to the raw `href` when omitted. */\n label?: string;\n}> = ({ href, label }) => {\n if (!href) return <UITableEmpty />;\n\n return (\n <a href={href} target=\"_blank\" className=\"inline-flex items-center gap-1 truncate text-primary text-sm underline\" rel=\"noopener noreferrer\">\n <span>{label || href}</span>\n <ExternalLinkIcon size={14} />\n </a>\n );\n};\n"],"mappings":"sGAcA,MAAa,GAKP,CAAE,OAAM,WACP,GAGH,EAAA,EAAA,KAAA,CAAC,IAAD,CAAS,OAAM,OAAO,SAAS,UAAU,yEAAyE,IAAI,sBAAtH,SAAA,EACE,EAAA,EAAA,IAAA,CAAC,OAAD,CAAA,SAAO,GAAS,CAAW,CAAA,GAC3B,EAAA,EAAA,IAAA,CAACC,EAAAA,iBAAD,CAAkB,KAAM,EAAK,CAAA,CAC5B,KANa,EAAA,EAAA,IAAA,CAACD,EAAAA,EAAD,CAAe,CAAA"}
@@ -0,0 +1,2 @@
1
+ function e(e){if(!e?.trim())return null;let t=e.replace(/\D/g,``),n=t.length>9&&t.startsWith(`84`)?t.slice(2):t.startsWith(`0`)?t.slice(1):t,r=/^\d{9,10}$/.test(n);if(!r)return{nsn:n,national:t,international:t,valid:r};let i=n.length===9?[n.slice(0,3),n.slice(3,6),n.slice(6,9)]:[n.slice(0,4),n.slice(4,7),n.slice(7,10)];return{nsn:n,national:`0${i[0]} ${i[1]} ${i[2]}`,international:`+84 ${i[0]} ${i[1]} ${i[2]}`,valid:r}}export{e as t};
2
+ //# sourceMappingURL=phone-CTTjc3mv.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phone-CTTjc3mv.mjs","names":[],"sources":["../packages/libs/phone.ts"],"sourcesContent":["export type TVietnamesePhone = {\n /** Digits only, national significant number with the trunk `0` and any `84`/`+84` prefix removed. */\n nsn: string;\n /** National display form, e.g. `'0987 654 321'`. Falls back to the sanitized digits when `valid` is `false`. */\n national: string;\n /** International display form, e.g. `'+84 987 654 321'`. Falls back to the sanitized digits when `valid` is `false`. */\n international: string;\n /** `false` when the input's national significant number isn't 9–10 digits (not a recognizable VN phone number). */\n valid: boolean;\n};\n\n/**\n * Parses a Vietnamese phone number in any common input shape (`0987654321`, `+84987654321`,\n * `84987654321`, with or without spaces/dashes) into national and international display forms.\n * Never throws — returns `null` for empty/blank input, and falls back to sanitized digits\n * (with `valid: false`) for anything that doesn't look like a 9–10 digit VN number.\n */\nexport function formatVietnamesePhone(raw: string | null | undefined): TVietnamesePhone | null {\n if (!raw?.trim()) return null;\n\n const digits = raw.replace(/\\D/g, '');\n const nsn = digits.length > 9 && digits.startsWith('84') ? digits.slice(2) : digits.startsWith('0') ? digits.slice(1) : digits;\n const valid = /^\\d{9,10}$/.test(nsn);\n\n if (!valid) return { nsn, national: digits, international: digits, valid };\n\n const groups = nsn.length === 9 ? [nsn.slice(0, 3), nsn.slice(3, 6), nsn.slice(6, 9)] : [nsn.slice(0, 4), nsn.slice(4, 7), nsn.slice(7, 10)];\n\n return {\n nsn,\n national: `0${groups[0]} ${groups[1]} ${groups[2]}`,\n international: `+84 ${groups[0]} ${groups[1]} ${groups[2]}`,\n valid,\n };\n}\n"],"mappings":"AAiBA,SAAgB,EAAsB,EAAyD,CAC7F,GAAI,CAAC,GAAK,KAAK,EAAG,OAAO,KAEzB,IAAM,EAAS,EAAI,QAAQ,MAAO,EAAE,EAC9B,EAAM,EAAO,OAAS,GAAK,EAAO,WAAW,IAAI,EAAI,EAAO,MAAM,CAAC,EAAI,EAAO,WAAW,GAAG,EAAI,EAAO,MAAM,CAAC,EAAI,EAClH,EAAQ,aAAa,KAAK,CAAG,EAEnC,GAAI,CAAC,EAAO,MAAO,CAAE,MAAK,SAAU,EAAQ,cAAe,EAAQ,OAAM,EAEzE,IAAM,EAAS,EAAI,SAAW,EAAI,CAAC,EAAI,MAAM,EAAG,CAAC,EAAG,EAAI,MAAM,EAAG,CAAC,EAAG,EAAI,MAAM,EAAG,CAAC,CAAC,EAAI,CAAC,EAAI,MAAM,EAAG,CAAC,EAAG,EAAI,MAAM,EAAG,CAAC,EAAG,EAAI,MAAM,EAAG,EAAE,CAAC,EAE3I,MAAO,CACL,MACA,SAAU,IAAI,EAAO,GAAG,GAAG,EAAO,GAAG,GAAG,EAAO,KAC/C,cAAe,OAAO,EAAO,GAAG,GAAG,EAAO,GAAG,GAAG,EAAO,KACvD,OACF,CACF"}
@@ -0,0 +1,2 @@
1
+ function e(e){if(!e?.trim())return null;let t=e.replace(/\D/g,``),n=t.length>9&&t.startsWith(`84`)?t.slice(2):t.startsWith(`0`)?t.slice(1):t,r=/^\d{9,10}$/.test(n);if(!r)return{nsn:n,national:t,international:t,valid:r};let i=n.length===9?[n.slice(0,3),n.slice(3,6),n.slice(6,9)]:[n.slice(0,4),n.slice(4,7),n.slice(7,10)];return{nsn:n,national:`0${i[0]} ${i[1]} ${i[2]}`,international:`+84 ${i[0]} ${i[1]} ${i[2]}`,valid:r}}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return e}});
2
+ //# sourceMappingURL=phone-CUxXVTg6.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phone-CUxXVTg6.cjs","names":[],"sources":["../packages/libs/phone.ts"],"sourcesContent":["export type TVietnamesePhone = {\n /** Digits only, national significant number with the trunk `0` and any `84`/`+84` prefix removed. */\n nsn: string;\n /** National display form, e.g. `'0987 654 321'`. Falls back to the sanitized digits when `valid` is `false`. */\n national: string;\n /** International display form, e.g. `'+84 987 654 321'`. Falls back to the sanitized digits when `valid` is `false`. */\n international: string;\n /** `false` when the input's national significant number isn't 9–10 digits (not a recognizable VN phone number). */\n valid: boolean;\n};\n\n/**\n * Parses a Vietnamese phone number in any common input shape (`0987654321`, `+84987654321`,\n * `84987654321`, with or without spaces/dashes) into national and international display forms.\n * Never throws — returns `null` for empty/blank input, and falls back to sanitized digits\n * (with `valid: false`) for anything that doesn't look like a 9–10 digit VN number.\n */\nexport function formatVietnamesePhone(raw: string | null | undefined): TVietnamesePhone | null {\n if (!raw?.trim()) return null;\n\n const digits = raw.replace(/\\D/g, '');\n const nsn = digits.length > 9 && digits.startsWith('84') ? digits.slice(2) : digits.startsWith('0') ? digits.slice(1) : digits;\n const valid = /^\\d{9,10}$/.test(nsn);\n\n if (!valid) return { nsn, national: digits, international: digits, valid };\n\n const groups = nsn.length === 9 ? [nsn.slice(0, 3), nsn.slice(3, 6), nsn.slice(6, 9)] : [nsn.slice(0, 4), nsn.slice(4, 7), nsn.slice(7, 10)];\n\n return {\n nsn,\n national: `0${groups[0]} ${groups[1]} ${groups[2]}`,\n international: `+84 ${groups[0]} ${groups[1]} ${groups[2]}`,\n valid,\n };\n}\n"],"mappings":"AAiBA,SAAgB,EAAsB,EAAyD,CAC7F,GAAI,CAAC,GAAK,KAAK,EAAG,OAAO,KAEzB,IAAM,EAAS,EAAI,QAAQ,MAAO,EAAE,EAC9B,EAAM,EAAO,OAAS,GAAK,EAAO,WAAW,IAAI,EAAI,EAAO,MAAM,CAAC,EAAI,EAAO,WAAW,GAAG,EAAI,EAAO,MAAM,CAAC,EAAI,EAClH,EAAQ,aAAa,KAAK,CAAG,EAEnC,GAAI,CAAC,EAAO,MAAO,CAAE,MAAK,SAAU,EAAQ,cAAe,EAAQ,OAAM,EAEzE,IAAM,EAAS,EAAI,SAAW,EAAI,CAAC,EAAI,MAAM,EAAG,CAAC,EAAG,EAAI,MAAM,EAAG,CAAC,EAAG,EAAI,MAAM,EAAG,CAAC,CAAC,EAAI,CAAC,EAAI,MAAM,EAAG,CAAC,EAAG,EAAI,MAAM,EAAG,CAAC,EAAG,EAAI,MAAM,EAAG,EAAE,CAAC,EAE3I,MAAO,CACL,MACA,SAAU,IAAI,EAAO,GAAG,GAAG,EAAO,GAAG,GAAG,EAAO,KAC/C,cAAe,OAAO,EAAO,GAAG,GAAG,EAAO,GAAG,GAAG,EAAO,KACvD,OACF,CACF"}
@@ -1,7 +1,7 @@
1
1
  //#region packages/components/data-display/phone-number.d.ts
2
2
  type PhoneNumberDisplayProps = {
3
- /** The raw phone number string (e.g. `'0901234567'`); automatically formatted as `(090) 123-4567` with a +84 tooltip. */
4
- value: string;
3
+ /** The raw phone number string (e.g. `'0901234567'`); automatically formatted as `0901 234 567` with a `+84` tooltip. */
4
+ value: string | null | undefined;
5
5
  };
6
6
  /**
7
7
  * Formats and displays a Vietnamese phone number with a tooltip showing the international dialling format.
@@ -16,4 +16,4 @@ type PhoneNumberDisplayProps = {
16
16
  declare const PhoneNumberDisplay: React.FC<PhoneNumberDisplayProps>;
17
17
  //#endregion
18
18
  export { PhoneNumberDisplay as t };
19
- //# sourceMappingURL=phone-number-D9j5xYDW.d.cts.map
19
+ //# sourceMappingURL=phone-number-B1bLIt8i.d.cts.map
@@ -1,7 +1,7 @@
1
1
  //#region packages/components/data-display/phone-number.d.ts
2
2
  type PhoneNumberDisplayProps = {
3
- /** The raw phone number string (e.g. `'0901234567'`); automatically formatted as `(090) 123-4567` with a +84 tooltip. */
4
- value: string;
3
+ /** The raw phone number string (e.g. `'0901234567'`); automatically formatted as `0901 234 567` with a `+84` tooltip. */
4
+ value: string | null | undefined;
5
5
  };
6
6
  /**
7
7
  * Formats and displays a Vietnamese phone number with a tooltip showing the international dialling format.
@@ -16,4 +16,4 @@ type PhoneNumberDisplayProps = {
16
16
  declare const PhoneNumberDisplay: React.FC<PhoneNumberDisplayProps>;
17
17
  //#endregion
18
18
  export { PhoneNumberDisplay as t };
19
- //# sourceMappingURL=phone-number-D9j5xYDW.d.mts.map
19
+ //# sourceMappingURL=phone-number-B1bLIt8i.d.mts.map
@@ -1,2 +1,2 @@
1
- import{Tooltip as e,TooltipContent as t,TooltipTrigger as n}from"./ui/tooltip.mjs";import{Q as r}from"./tables-Dg3KMBKA.mjs";import{jsx as i,jsxs as a}from"react/jsx-runtime";const o=({value:o})=>o?a(e,{children:[i(n,{asChild:!0,children:i(`p`,{className:`font-number text-text-positive text-sm tabular-nums`,children:o.replace(/(\d{3})(\d{3})(\d{4})/,`($1) $2-$3`)})}),i(t,{align:`start`,children:i(`p`,{className:`tabular-nums`,children:o.slice(1).replace(/(\d{2})(\d{3})(\d{4})/,`+84 $1 $2 $3`)})})]}):i(r,{});export{o as UITablePhoneNumberDisplay};
2
- //# sourceMappingURL=phone-number-Ba-f4s1Y.mjs.map
1
+ import{Tooltip as e,TooltipContent as t,TooltipTrigger as n}from"./ui/tooltip.mjs";import{Q as r}from"./tables-CuoBQNqx.mjs";import{jsx as i,jsxs as a}from"react/jsx-runtime";const o=({value:o})=>o?a(e,{children:[i(n,{asChild:!0,children:i(`p`,{className:`font-number text-text-positive text-sm tabular-nums`,children:o.replace(/(\d{3})(\d{3})(\d{4})/,`($1) $2-$3`)})}),i(t,{align:`start`,children:i(`p`,{className:`tabular-nums`,children:o.slice(1).replace(/(\d{2})(\d{3})(\d{4})/,`+84 $1 $2 $3`)})})]}):i(r,{});export{o as UITablePhoneNumberDisplay};
2
+ //# sourceMappingURL=phone-number-DHFLnHWO.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"phone-number-Ba-f4s1Y.mjs","names":[],"sources":["../packages/components/features/tables/components/atoms/phone-number.tsx"],"sourcesContent":["import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { UITableEmpty } from './empty';\n\n/**\n * Formats and displays a phone number string in a table cell using the\n * `(NXX) NXX-XXXX` pattern, with a tooltip that shows the full international\n * dialling representation. Renders {@link UITableEmpty} when `value` is absent.\n *\n * @example\n * import { UITablePhoneNumberDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITablePhoneNumberDisplay value=\"0843456789\" />\n */\nexport const UITablePhoneNumberDisplay: React.FC<{\n /** The raw phone number string to format and display; `null`/`undefined`/empty renders an empty state. */\n value: string | null | undefined;\n}> = ({ value }) => {\n if (!value) return <UITableEmpty />;\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <p className=\"font-number text-text-positive text-sm tabular-nums\">{value.replace(/(\\d{3})(\\d{3})(\\d{4})/, '($1) $2-$3')}</p>\n </TooltipTrigger>\n <TooltipContent align=\"start\">\n <p className=\"tabular-nums\">{value.slice(1).replace(/(\\d{2})(\\d{3})(\\d{4})/, '+84 $1 $2 $3')}</p>\n </TooltipContent>\n </Tooltip>\n );\n};\n"],"mappings":"+KAcA,MAAa,GAGP,CAAE,WACD,EAGH,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAgB,QAAA,GACd,SAAA,EAAC,IAAD,CAAG,UAAU,sDAAuD,SAAA,EAAM,QAAQ,wBAAyB,YAAY,CAAK,CAAA,CAC9G,CAAA,EAChB,EAAC,EAAD,CAAgB,MAAM,QACpB,SAAA,EAAC,IAAD,CAAG,UAAU,eAAgB,SAAA,EAAM,MAAM,CAAC,CAAC,CAAC,QAAQ,wBAAyB,cAAc,CAAK,CAAA,CAClF,CAAA,CACT,CAAA,CAAA,EAVQ,EAAC,EAAD,CAAe,CAAA"}
1
+ {"version":3,"file":"phone-number-DHFLnHWO.mjs","names":[],"sources":["../packages/components/features/tables/components/atoms/phone-number.tsx"],"sourcesContent":["import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { UITableEmpty } from './empty';\n\n/**\n * Formats and displays a phone number string in a table cell using the\n * `(NXX) NXX-XXXX` pattern, with a tooltip that shows the full international\n * dialling representation. Renders {@link UITableEmpty} when `value` is absent.\n *\n * @example\n * import { UITablePhoneNumberDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITablePhoneNumberDisplay value=\"0843456789\" />\n */\nexport const UITablePhoneNumberDisplay: React.FC<{\n /** The raw phone number string to format and display; `null`/`undefined`/empty renders an empty state. */\n value: string | null | undefined;\n}> = ({ value }) => {\n if (!value) return <UITableEmpty />;\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <p className=\"font-number text-text-positive text-sm tabular-nums\">{value.replace(/(\\d{3})(\\d{3})(\\d{4})/, '($1) $2-$3')}</p>\n </TooltipTrigger>\n <TooltipContent align=\"start\">\n <p className=\"tabular-nums\">{value.slice(1).replace(/(\\d{2})(\\d{3})(\\d{4})/, '+84 $1 $2 $3')}</p>\n </TooltipContent>\n </Tooltip>\n );\n};\n"],"mappings":"+KAcA,MAAa,GAGP,CAAE,WACD,EAGH,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAgB,QAAA,GACd,SAAA,EAAC,IAAD,CAAG,UAAU,sDAAuD,SAAA,EAAM,QAAQ,wBAAyB,YAAY,CAAK,CAAA,CAC9G,CAAA,EAChB,EAAC,EAAD,CAAgB,MAAM,QACpB,SAAA,EAAC,IAAD,CAAG,UAAU,eAAgB,SAAA,EAAM,MAAM,CAAC,CAAC,CAAC,QAAQ,wBAAyB,cAAc,CAAK,CAAA,CAClF,CAAA,CACT,CAAA,CAAA,EAVQ,EAAC,EAAD,CAAe,CAAA"}
@@ -1,2 +1,2 @@
1
- const e=require("./ui/tooltip.cjs"),t=require("./tables-BqZ4Zs6e.cjs");let n=require("react/jsx-runtime");const r=({value:r})=>r?(0,n.jsxs)(e.Tooltip,{children:[(0,n.jsx)(e.TooltipTrigger,{asChild:!0,children:(0,n.jsx)(`p`,{className:`font-number text-text-positive text-sm tabular-nums`,children:r.replace(/(\d{3})(\d{3})(\d{4})/,`($1) $2-$3`)})}),(0,n.jsx)(e.TooltipContent,{align:`start`,children:(0,n.jsx)(`p`,{className:`tabular-nums`,children:r.slice(1).replace(/(\d{2})(\d{3})(\d{4})/,`+84 $1 $2 $3`)})})]}):(0,n.jsx)(t.Q,{});exports.UITablePhoneNumberDisplay=r;
2
- //# sourceMappingURL=phone-number-BqRhKQdr.cjs.map
1
+ const e=require("./ui/tooltip.cjs"),t=require("./tables-DdLEj1dI.cjs");let n=require("react/jsx-runtime");const r=({value:r})=>r?(0,n.jsxs)(e.Tooltip,{children:[(0,n.jsx)(e.TooltipTrigger,{asChild:!0,children:(0,n.jsx)(`p`,{className:`font-number text-text-positive text-sm tabular-nums`,children:r.replace(/(\d{3})(\d{3})(\d{4})/,`($1) $2-$3`)})}),(0,n.jsx)(e.TooltipContent,{align:`start`,children:(0,n.jsx)(`p`,{className:`tabular-nums`,children:r.slice(1).replace(/(\d{2})(\d{3})(\d{4})/,`+84 $1 $2 $3`)})})]}):(0,n.jsx)(t.Q,{});exports.UITablePhoneNumberDisplay=r;
2
+ //# sourceMappingURL=phone-number-YzmDmFBU.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"phone-number-BqRhKQdr.cjs","names":["UITableEmpty","Tooltip","TooltipTrigger","TooltipContent"],"sources":["../packages/components/features/tables/components/atoms/phone-number.tsx"],"sourcesContent":["import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { UITableEmpty } from './empty';\n\n/**\n * Formats and displays a phone number string in a table cell using the\n * `(NXX) NXX-XXXX` pattern, with a tooltip that shows the full international\n * dialling representation. Renders {@link UITableEmpty} when `value` is absent.\n *\n * @example\n * import { UITablePhoneNumberDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITablePhoneNumberDisplay value=\"0843456789\" />\n */\nexport const UITablePhoneNumberDisplay: React.FC<{\n /** The raw phone number string to format and display; `null`/`undefined`/empty renders an empty state. */\n value: string | null | undefined;\n}> = ({ value }) => {\n if (!value) return <UITableEmpty />;\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <p className=\"font-number text-text-positive text-sm tabular-nums\">{value.replace(/(\\d{3})(\\d{3})(\\d{4})/, '($1) $2-$3')}</p>\n </TooltipTrigger>\n <TooltipContent align=\"start\">\n <p className=\"tabular-nums\">{value.slice(1).replace(/(\\d{2})(\\d{3})(\\d{4})/, '+84 $1 $2 $3')}</p>\n </TooltipContent>\n </Tooltip>\n );\n};\n"],"mappings":"0GAcA,MAAa,GAGP,CAAE,WACD,GAGH,EAAA,EAAA,KAAA,CAACC,EAAAA,QAAD,CAAA,SAAA,EACE,EAAA,EAAA,IAAA,CAACC,EAAAA,eAAD,CAAgB,QAAA,GACd,UAAA,EAAA,EAAA,IAAA,CAAC,IAAD,CAAG,UAAU,sDAAuD,SAAA,EAAM,QAAQ,wBAAyB,YAAY,CAAK,CAAA,CAC9G,CAAA,GAChB,EAAA,EAAA,IAAA,CAACC,EAAAA,eAAD,CAAgB,MAAM,QACpB,UAAA,EAAA,EAAA,IAAA,CAAC,IAAD,CAAG,UAAU,eAAgB,SAAA,EAAM,MAAM,CAAC,CAAC,CAAC,QAAQ,wBAAyB,cAAc,CAAK,CAAA,CAClF,CAAA,CACT,CAAA,CAAA,GAVQ,EAAA,EAAA,IAAA,CAACH,EAAAA,EAAD,CAAe,CAAA"}
1
+ {"version":3,"file":"phone-number-YzmDmFBU.cjs","names":["UITableEmpty","Tooltip","TooltipTrigger","TooltipContent"],"sources":["../packages/components/features/tables/components/atoms/phone-number.tsx"],"sourcesContent":["import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\n\nimport { UITableEmpty } from './empty';\n\n/**\n * Formats and displays a phone number string in a table cell using the\n * `(NXX) NXX-XXXX` pattern, with a tooltip that shows the full international\n * dialling representation. Renders {@link UITableEmpty} when `value` is absent.\n *\n * @example\n * import { UITablePhoneNumberDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITablePhoneNumberDisplay value=\"0843456789\" />\n */\nexport const UITablePhoneNumberDisplay: React.FC<{\n /** The raw phone number string to format and display; `null`/`undefined`/empty renders an empty state. */\n value: string | null | undefined;\n}> = ({ value }) => {\n if (!value) return <UITableEmpty />;\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <p className=\"font-number text-text-positive text-sm tabular-nums\">{value.replace(/(\\d{3})(\\d{3})(\\d{4})/, '($1) $2-$3')}</p>\n </TooltipTrigger>\n <TooltipContent align=\"start\">\n <p className=\"tabular-nums\">{value.slice(1).replace(/(\\d{2})(\\d{3})(\\d{4})/, '+84 $1 $2 $3')}</p>\n </TooltipContent>\n </Tooltip>\n );\n};\n"],"mappings":"0GAcA,MAAa,GAGP,CAAE,WACD,GAGH,EAAA,EAAA,KAAA,CAACC,EAAAA,QAAD,CAAA,SAAA,EACE,EAAA,EAAA,IAAA,CAACC,EAAAA,eAAD,CAAgB,QAAA,GACd,UAAA,EAAA,EAAA,IAAA,CAAC,IAAD,CAAG,UAAU,sDAAuD,SAAA,EAAM,QAAQ,wBAAyB,YAAY,CAAK,CAAA,CAC9G,CAAA,GAChB,EAAA,EAAA,IAAA,CAACC,EAAAA,eAAD,CAAgB,MAAM,QACpB,UAAA,EAAA,EAAA,IAAA,CAAC,IAAD,CAAG,UAAU,eAAgB,SAAA,EAAM,MAAM,CAAC,CAAC,CAAC,QAAQ,wBAAyB,cAAc,CAAK,CAAA,CAClF,CAAA,CACT,CAAA,CAAA,GAVQ,EAAA,EAAA,IAAA,CAACH,EAAAA,EAAD,CAAe,CAAA"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./close-DYJZ8fkh.mjs";import{K as t}from"./tanstack-form-q9hDCc0Y.mjs";import{n,t as r}from"./submit-button-CGBaPzE9.mjs";import{cn as i}from"@customafk/react-toolkit/utils";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{Dialog as s}from"radix-ui";const c=({title:c,open:l,contentClassName:u,onOpenChange:d,children:f})=>{let p=t();return a(s.Root,{"data-slot":`dialog`,open:l,onOpenChange:d,children:o(s.Portal,{"data-slot":`dialog-portal`,children:[a(s.Overlay,{"data-slot":`dialog-overlay`,className:i(`fixed inset-0 z-40 bg-black/40 backdrop-blur-sm`,`data-[state=open]:animate-in data-[state=open]:fade-in`,`data-[state=closed]:animate-out data-[state=closed]:fade-out`)}),a(s.Content,{"data-slot":`dialog-content`,className:i(`fixed top-4 right-4 z-50 h-[calc(100dvh-2rem)] min-w-sm max-w-xl rounded-md bg-background shadow-lg ring-1 ring-border`,`duration-300`,`data-[state=open]:animate-in data-[state=open]:slide-in-from-right data-[state=open]:fade-in`,`data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right data-[state=closed]:fade-out`),children:o(`section`,{className:`relative flex size-full flex-col`,children:[a(`header`,{className:`flex h-14 shrink-0 items-center border-b border-border px-5`,children:a(`h2`,{className:`font-semibold text-base tracking-tight text-text-positive`,children:c})}),a(`div`,{className:i(`flex flex-1 flex-col overflow-y-auto py-4`,u),children:f}),o(`div`,{className:`flex shrink-0 flex-col gap-2 border-t border-border px-4 py-3`,children:[a(p.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:t})=>a(r,{isSubmitting:e,disabled:t,className:`w-full`,onClick:()=>p.handleSubmit()})}),a(p.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:e})=>a(n,{disabled:e,className:`w-full`,onClick:()=>{p.reset(),d?.(!1)}})})]}),a(s.Close,{asChild:!0,children:a(e,{className:`absolute top-2.5 right-3`})})]})})]})})};export{c as TanStackPopoverForm};
2
- //# sourceMappingURL=popover-form-BsapHJck.mjs.map
1
+ import{t as e}from"./close-DYJZ8fkh.mjs";import{K as t}from"./tanstack-form-fkaBh9RO.mjs";import{n,t as r}from"./submit-button-CGBaPzE9.mjs";import{cn as i}from"@customafk/react-toolkit/utils";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{Dialog as s}from"radix-ui";const c=({title:c,open:l,contentClassName:u,onOpenChange:d,children:f})=>{let p=t();return a(s.Root,{"data-slot":`dialog`,open:l,onOpenChange:d,children:o(s.Portal,{"data-slot":`dialog-portal`,children:[a(s.Overlay,{"data-slot":`dialog-overlay`,className:i(`fixed inset-0 z-40 bg-black/40 backdrop-blur-sm`,`data-[state=open]:animate-in data-[state=open]:fade-in`,`data-[state=closed]:animate-out data-[state=closed]:fade-out`)}),a(s.Content,{"data-slot":`dialog-content`,className:i(`fixed top-4 right-4 z-50 h-[calc(100dvh-2rem)] min-w-sm max-w-xl rounded-md bg-background shadow-lg ring-1 ring-border`,`duration-300`,`data-[state=open]:animate-in data-[state=open]:slide-in-from-right data-[state=open]:fade-in`,`data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right data-[state=closed]:fade-out`),children:o(`section`,{className:`relative flex size-full flex-col`,children:[a(`header`,{className:`flex h-14 shrink-0 items-center border-b border-border px-5`,children:a(`h2`,{className:`font-semibold text-base tracking-tight text-text-positive`,children:c})}),a(`div`,{className:i(`flex flex-1 flex-col overflow-y-auto py-4`,u),children:f}),o(`div`,{className:`flex shrink-0 flex-col gap-2 border-t border-border px-4 py-3`,children:[a(p.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:t})=>a(r,{isSubmitting:e,disabled:t,className:`w-full`,onClick:()=>p.handleSubmit()})}),a(p.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:e})=>a(n,{disabled:e,className:`w-full`,onClick:()=>{p.reset(),d?.(!1)}})})]}),a(s.Close,{asChild:!0,children:a(e,{className:`absolute top-2.5 right-3`})})]})})]})})};export{c as TanStackPopoverForm};
2
+ //# sourceMappingURL=popover-form-CeRVpy1B.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"popover-form-BsapHJck.mjs","names":["DialogPrimitive"],"sources":["../packages/components/features/tanstack-form/components/forms/popover-form.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { CloseButton } from '@/components/ui/buttons/close';\n\nimport { Dialog as DialogPrimitive } from 'radix-ui';\nimport { useTanStackFormContext } from '../form-context';\nimport { CancelButton } from '../ui/cancel-button';\nimport { SubmitButton } from '../ui/submit-button';\n\n/**\n * Renders a slide-in side-panel dialog that wraps a TanStack form with built-in submit and cancel actions.\n *\n * @example\n * import { TanStackPopoverForm } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <TanStackPopoverForm\n * title=\"Edit Profile\"\n * open={isOpen}\n * onOpenChange={setIsOpen}\n * >\n * <EmailField />\n * </TanStackPopoverForm>\n */\nexport const TanStackPopoverForm: React.FC<\n React.PropsWithChildren<{\n /** Heading text displayed in the panel header. */\n title: string;\n /** Controlled open state of the popover dialog. */\n open?: boolean;\n /** Additional CSS class names applied to the scrollable content area. */\n contentClassName?: string;\n /** Callback fired when the open state changes. */\n onOpenChange?: (open: boolean) => void;\n }>\n> = ({ title, open, contentClassName, onOpenChange, children }) => {\n const form = useTanStackFormContext();\n\n return (\n <DialogPrimitive.Root data-slot=\"dialog\" open={open} onOpenChange={onOpenChange}>\n <DialogPrimitive.Portal data-slot=\"dialog-portal\">\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n 'fixed inset-0 z-40 bg-black/40 backdrop-blur-sm',\n 'data-[state=open]:animate-in data-[state=open]:fade-in',\n 'data-[state=closed]:animate-out data-[state=closed]:fade-out'\n )}\n />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'fixed top-4 right-4 z-50 h-[calc(100dvh-2rem)] min-w-sm max-w-xl rounded-md bg-background shadow-lg ring-1 ring-border',\n 'duration-300',\n 'data-[state=open]:animate-in data-[state=open]:slide-in-from-right data-[state=open]:fade-in',\n 'data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right data-[state=closed]:fade-out'\n )}\n >\n <section className=\"relative flex size-full flex-col\">\n <header className=\"flex h-14 shrink-0 items-center border-b border-border px-5\">\n <h2 className=\"font-semibold text-base tracking-tight text-text-positive\">{title}</h2>\n </header>\n\n <div className={cn('flex flex-1 flex-col overflow-y-auto py-4', contentClassName)}>{children}</div>\n\n <div className=\"flex shrink-0 flex-col gap-2 border-t border-border px-4 py-3\">\n <form.Subscribe\n selector={state => ({\n isSubmitting: state.isSubmitting,\n disabled: state.isPristine || !state.isValid || state.isValidating || state.isSubmitting || !state.canSubmit,\n })}\n children={({ isSubmitting, disabled }) => (\n <SubmitButton isSubmitting={isSubmitting} disabled={disabled} className=\"w-full\" onClick={() => form.handleSubmit()} />\n )}\n />\n <form.Subscribe\n selector={state => ({ disabled: state.isPristine || state.isSubmitting })}\n children={({ disabled }) => (\n <CancelButton\n disabled={disabled}\n className=\"w-full\"\n onClick={() => {\n form.reset();\n onOpenChange?.(false);\n }}\n />\n )}\n />\n </div>\n\n <DialogPrimitive.Close asChild>\n <CloseButton className=\"absolute top-2.5 right-3\" />\n </DialogPrimitive.Close>\n </section>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n </DialogPrimitive.Root>\n );\n};\n"],"mappings":"qRAyBA,MAAa,GAWR,CAAE,QAAO,OAAM,mBAAkB,eAAc,cAAe,CACjE,IAAM,EAAO,EAAuB,EAEpC,OACE,EAACA,EAAgB,KAAjB,CAAsB,YAAU,SAAe,OAAoB,eACjE,SAAA,EAACA,EAAgB,OAAjB,CAAwB,YAAU,gBAAlC,SAAA,CACE,EAACA,EAAgB,QAAjB,CACE,YAAU,iBACV,UAAW,EACT,kDACA,yDACA,8DACF,CACD,CAAA,EACD,EAACA,EAAgB,QAAjB,CACE,YAAU,iBACV,UAAW,EACT,yHACA,eACA,+FACA,qGACF,EAEA,SAAA,EAAC,UAAD,CAAS,UAAU,mCAAnB,SAAA,CACE,EAAC,SAAD,CAAQ,UAAU,8DAChB,SAAA,EAAC,KAAD,CAAI,UAAU,4DAA6D,SAAA,CAAU,CAAA,CAC/E,CAAA,EAER,EAAC,MAAD,CAAK,UAAW,EAAG,4CAA6C,CAAgB,EAAI,UAAc,CAAA,EAElG,EAAC,MAAD,CAAK,UAAU,gEAAf,SAAA,CACE,EAAC,EAAK,UAAN,CACE,SAAU,IAAU,CAClB,aAAc,EAAM,aACpB,SAAU,EAAM,YAAc,CAAC,EAAM,SAAW,EAAM,cAAgB,EAAM,cAAgB,CAAC,EAAM,SACrG,GACA,UAAW,CAAE,eAAc,cACzB,EAAC,EAAD,CAA4B,eAAwB,WAAU,UAAU,SAAS,YAAe,EAAK,aAAa,CAAI,CAAA,CAEzH,CAAA,EACD,EAAC,EAAK,UAAN,CACE,SAAU,IAAU,CAAE,SAAU,EAAM,YAAc,EAAM,YAAa,GACvE,UAAW,CAAE,cACX,EAAC,EAAD,CACY,WACV,UAAU,SACV,YAAe,CACb,EAAK,MAAM,EACX,IAAe,EAAK,CACtB,CACD,CAAA,CAEJ,CAAA,CACE,IAEL,EAACA,EAAgB,MAAjB,CAAuB,QAAA,GACrB,SAAA,EAAC,EAAD,CAAa,UAAU,0BAA4B,CAAA,CAC9B,CAAA,CAChB,GACc,CAAA,CACH,GACJ,CAAA,CAE1B"}
1
+ {"version":3,"file":"popover-form-CeRVpy1B.mjs","names":["DialogPrimitive"],"sources":["../packages/components/features/tanstack-form/components/forms/popover-form.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { CloseButton } from '@/components/ui/buttons/close';\n\nimport { Dialog as DialogPrimitive } from 'radix-ui';\nimport { useTanStackFormContext } from '../form-context';\nimport { CancelButton } from '../ui/cancel-button';\nimport { SubmitButton } from '../ui/submit-button';\n\n/**\n * Renders a slide-in side-panel dialog that wraps a TanStack form with built-in submit and cancel actions.\n *\n * @example\n * import { TanStackPopoverForm } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <TanStackPopoverForm\n * title=\"Edit Profile\"\n * open={isOpen}\n * onOpenChange={setIsOpen}\n * >\n * <EmailField />\n * </TanStackPopoverForm>\n */\nexport const TanStackPopoverForm: React.FC<\n React.PropsWithChildren<{\n /** Heading text displayed in the panel header. */\n title: string;\n /** Controlled open state of the popover dialog. */\n open?: boolean;\n /** Additional CSS class names applied to the scrollable content area. */\n contentClassName?: string;\n /** Callback fired when the open state changes. */\n onOpenChange?: (open: boolean) => void;\n }>\n> = ({ title, open, contentClassName, onOpenChange, children }) => {\n const form = useTanStackFormContext();\n\n return (\n <DialogPrimitive.Root data-slot=\"dialog\" open={open} onOpenChange={onOpenChange}>\n <DialogPrimitive.Portal data-slot=\"dialog-portal\">\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n 'fixed inset-0 z-40 bg-black/40 backdrop-blur-sm',\n 'data-[state=open]:animate-in data-[state=open]:fade-in',\n 'data-[state=closed]:animate-out data-[state=closed]:fade-out'\n )}\n />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'fixed top-4 right-4 z-50 h-[calc(100dvh-2rem)] min-w-sm max-w-xl rounded-md bg-background shadow-lg ring-1 ring-border',\n 'duration-300',\n 'data-[state=open]:animate-in data-[state=open]:slide-in-from-right data-[state=open]:fade-in',\n 'data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right data-[state=closed]:fade-out'\n )}\n >\n <section className=\"relative flex size-full flex-col\">\n <header className=\"flex h-14 shrink-0 items-center border-b border-border px-5\">\n <h2 className=\"font-semibold text-base tracking-tight text-text-positive\">{title}</h2>\n </header>\n\n <div className={cn('flex flex-1 flex-col overflow-y-auto py-4', contentClassName)}>{children}</div>\n\n <div className=\"flex shrink-0 flex-col gap-2 border-t border-border px-4 py-3\">\n <form.Subscribe\n selector={state => ({\n isSubmitting: state.isSubmitting,\n disabled: state.isPristine || !state.isValid || state.isValidating || state.isSubmitting || !state.canSubmit,\n })}\n children={({ isSubmitting, disabled }) => (\n <SubmitButton isSubmitting={isSubmitting} disabled={disabled} className=\"w-full\" onClick={() => form.handleSubmit()} />\n )}\n />\n <form.Subscribe\n selector={state => ({ disabled: state.isPristine || state.isSubmitting })}\n children={({ disabled }) => (\n <CancelButton\n disabled={disabled}\n className=\"w-full\"\n onClick={() => {\n form.reset();\n onOpenChange?.(false);\n }}\n />\n )}\n />\n </div>\n\n <DialogPrimitive.Close asChild>\n <CloseButton className=\"absolute top-2.5 right-3\" />\n </DialogPrimitive.Close>\n </section>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n </DialogPrimitive.Root>\n );\n};\n"],"mappings":"qRAyBA,MAAa,GAWR,CAAE,QAAO,OAAM,mBAAkB,eAAc,cAAe,CACjE,IAAM,EAAO,EAAuB,EAEpC,OACE,EAACA,EAAgB,KAAjB,CAAsB,YAAU,SAAe,OAAoB,eACjE,SAAA,EAACA,EAAgB,OAAjB,CAAwB,YAAU,gBAAlC,SAAA,CACE,EAACA,EAAgB,QAAjB,CACE,YAAU,iBACV,UAAW,EACT,kDACA,yDACA,8DACF,CACD,CAAA,EACD,EAACA,EAAgB,QAAjB,CACE,YAAU,iBACV,UAAW,EACT,yHACA,eACA,+FACA,qGACF,EAEA,SAAA,EAAC,UAAD,CAAS,UAAU,mCAAnB,SAAA,CACE,EAAC,SAAD,CAAQ,UAAU,8DAChB,SAAA,EAAC,KAAD,CAAI,UAAU,4DAA6D,SAAA,CAAU,CAAA,CAC/E,CAAA,EAER,EAAC,MAAD,CAAK,UAAW,EAAG,4CAA6C,CAAgB,EAAI,UAAc,CAAA,EAElG,EAAC,MAAD,CAAK,UAAU,gEAAf,SAAA,CACE,EAAC,EAAK,UAAN,CACE,SAAU,IAAU,CAClB,aAAc,EAAM,aACpB,SAAU,EAAM,YAAc,CAAC,EAAM,SAAW,EAAM,cAAgB,EAAM,cAAgB,CAAC,EAAM,SACrG,GACA,UAAW,CAAE,eAAc,cACzB,EAAC,EAAD,CAA4B,eAAwB,WAAU,UAAU,SAAS,YAAe,EAAK,aAAa,CAAI,CAAA,CAEzH,CAAA,EACD,EAAC,EAAK,UAAN,CACE,SAAU,IAAU,CAAE,SAAU,EAAM,YAAc,EAAM,YAAa,GACvE,UAAW,CAAE,cACX,EAAC,EAAD,CACY,WACV,UAAU,SACV,YAAe,CACb,EAAK,MAAM,EACX,IAAe,EAAK,CACtB,CACD,CAAA,CAEJ,CAAA,CACE,IAEL,EAACA,EAAgB,MAAjB,CAAuB,QAAA,GACrB,SAAA,EAAC,EAAD,CAAa,UAAU,0BAA4B,CAAA,CAC9B,CAAA,CAChB,GACc,CAAA,CACH,GACJ,CAAA,CAE1B"}
@@ -1,2 +1,2 @@
1
- const e=require("./close-BYHgEZvZ.cjs"),t=require("./tanstack-form-BxqS40rB.cjs"),n=require("./submit-button-CvINfld5.cjs");let r=require("@customafk/react-toolkit/utils"),i=require("react/jsx-runtime"),a=require("radix-ui");const o=({title:o,open:s,contentClassName:c,onOpenChange:l,children:u})=>{let d=t.K();return(0,i.jsx)(a.Dialog.Root,{"data-slot":`dialog`,open:s,onOpenChange:l,children:(0,i.jsxs)(a.Dialog.Portal,{"data-slot":`dialog-portal`,children:[(0,i.jsx)(a.Dialog.Overlay,{"data-slot":`dialog-overlay`,className:(0,r.cn)(`fixed inset-0 z-40 bg-black/40 backdrop-blur-sm`,`data-[state=open]:animate-in data-[state=open]:fade-in`,`data-[state=closed]:animate-out data-[state=closed]:fade-out`)}),(0,i.jsx)(a.Dialog.Content,{"data-slot":`dialog-content`,className:(0,r.cn)(`fixed top-4 right-4 z-50 h-[calc(100dvh-2rem)] min-w-sm max-w-xl rounded-md bg-background shadow-lg ring-1 ring-border`,`duration-300`,`data-[state=open]:animate-in data-[state=open]:slide-in-from-right data-[state=open]:fade-in`,`data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right data-[state=closed]:fade-out`),children:(0,i.jsxs)(`section`,{className:`relative flex size-full flex-col`,children:[(0,i.jsx)(`header`,{className:`flex h-14 shrink-0 items-center border-b border-border px-5`,children:(0,i.jsx)(`h2`,{className:`font-semibold text-base tracking-tight text-text-positive`,children:o})}),(0,i.jsx)(`div`,{className:(0,r.cn)(`flex flex-1 flex-col overflow-y-auto py-4`,c),children:u}),(0,i.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 border-t border-border px-4 py-3`,children:[(0,i.jsx)(d.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:t})=>(0,i.jsx)(n.t,{isSubmitting:e,disabled:t,className:`w-full`,onClick:()=>d.handleSubmit()})}),(0,i.jsx)(d.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:e})=>(0,i.jsx)(n.n,{disabled:e,className:`w-full`,onClick:()=>{d.reset(),l?.(!1)}})})]}),(0,i.jsx)(a.Dialog.Close,{asChild:!0,children:(0,i.jsx)(e.t,{className:`absolute top-2.5 right-3`})})]})})]})})};exports.TanStackPopoverForm=o;
2
- //# sourceMappingURL=popover-form-Bq2GcuZu.cjs.map
1
+ const e=require("./close-BYHgEZvZ.cjs"),t=require("./tanstack-form-C0ab8EEl.cjs"),n=require("./submit-button-CvINfld5.cjs");let r=require("@customafk/react-toolkit/utils"),i=require("react/jsx-runtime"),a=require("radix-ui");const o=({title:o,open:s,contentClassName:c,onOpenChange:l,children:u})=>{let d=t.K();return(0,i.jsx)(a.Dialog.Root,{"data-slot":`dialog`,open:s,onOpenChange:l,children:(0,i.jsxs)(a.Dialog.Portal,{"data-slot":`dialog-portal`,children:[(0,i.jsx)(a.Dialog.Overlay,{"data-slot":`dialog-overlay`,className:(0,r.cn)(`fixed inset-0 z-40 bg-black/40 backdrop-blur-sm`,`data-[state=open]:animate-in data-[state=open]:fade-in`,`data-[state=closed]:animate-out data-[state=closed]:fade-out`)}),(0,i.jsx)(a.Dialog.Content,{"data-slot":`dialog-content`,className:(0,r.cn)(`fixed top-4 right-4 z-50 h-[calc(100dvh-2rem)] min-w-sm max-w-xl rounded-md bg-background shadow-lg ring-1 ring-border`,`duration-300`,`data-[state=open]:animate-in data-[state=open]:slide-in-from-right data-[state=open]:fade-in`,`data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right data-[state=closed]:fade-out`),children:(0,i.jsxs)(`section`,{className:`relative flex size-full flex-col`,children:[(0,i.jsx)(`header`,{className:`flex h-14 shrink-0 items-center border-b border-border px-5`,children:(0,i.jsx)(`h2`,{className:`font-semibold text-base tracking-tight text-text-positive`,children:o})}),(0,i.jsx)(`div`,{className:(0,r.cn)(`flex flex-1 flex-col overflow-y-auto py-4`,c),children:u}),(0,i.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 border-t border-border px-4 py-3`,children:[(0,i.jsx)(d.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:t})=>(0,i.jsx)(n.t,{isSubmitting:e,disabled:t,className:`w-full`,onClick:()=>d.handleSubmit()})}),(0,i.jsx)(d.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:e})=>(0,i.jsx)(n.n,{disabled:e,className:`w-full`,onClick:()=>{d.reset(),l?.(!1)}})})]}),(0,i.jsx)(a.Dialog.Close,{asChild:!0,children:(0,i.jsx)(e.t,{className:`absolute top-2.5 right-3`})})]})})]})})};exports.TanStackPopoverForm=o;
2
+ //# sourceMappingURL=popover-form-Ch_iMMSm.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"popover-form-Bq2GcuZu.cjs","names":["useTanStackFormContext","DialogPrimitive","SubmitButton","CancelButton","CloseButton"],"sources":["../packages/components/features/tanstack-form/components/forms/popover-form.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { CloseButton } from '@/components/ui/buttons/close';\n\nimport { Dialog as DialogPrimitive } from 'radix-ui';\nimport { useTanStackFormContext } from '../form-context';\nimport { CancelButton } from '../ui/cancel-button';\nimport { SubmitButton } from '../ui/submit-button';\n\n/**\n * Renders a slide-in side-panel dialog that wraps a TanStack form with built-in submit and cancel actions.\n *\n * @example\n * import { TanStackPopoverForm } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <TanStackPopoverForm\n * title=\"Edit Profile\"\n * open={isOpen}\n * onOpenChange={setIsOpen}\n * >\n * <EmailField />\n * </TanStackPopoverForm>\n */\nexport const TanStackPopoverForm: React.FC<\n React.PropsWithChildren<{\n /** Heading text displayed in the panel header. */\n title: string;\n /** Controlled open state of the popover dialog. */\n open?: boolean;\n /** Additional CSS class names applied to the scrollable content area. */\n contentClassName?: string;\n /** Callback fired when the open state changes. */\n onOpenChange?: (open: boolean) => void;\n }>\n> = ({ title, open, contentClassName, onOpenChange, children }) => {\n const form = useTanStackFormContext();\n\n return (\n <DialogPrimitive.Root data-slot=\"dialog\" open={open} onOpenChange={onOpenChange}>\n <DialogPrimitive.Portal data-slot=\"dialog-portal\">\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n 'fixed inset-0 z-40 bg-black/40 backdrop-blur-sm',\n 'data-[state=open]:animate-in data-[state=open]:fade-in',\n 'data-[state=closed]:animate-out data-[state=closed]:fade-out'\n )}\n />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'fixed top-4 right-4 z-50 h-[calc(100dvh-2rem)] min-w-sm max-w-xl rounded-md bg-background shadow-lg ring-1 ring-border',\n 'duration-300',\n 'data-[state=open]:animate-in data-[state=open]:slide-in-from-right data-[state=open]:fade-in',\n 'data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right data-[state=closed]:fade-out'\n )}\n >\n <section className=\"relative flex size-full flex-col\">\n <header className=\"flex h-14 shrink-0 items-center border-b border-border px-5\">\n <h2 className=\"font-semibold text-base tracking-tight text-text-positive\">{title}</h2>\n </header>\n\n <div className={cn('flex flex-1 flex-col overflow-y-auto py-4', contentClassName)}>{children}</div>\n\n <div className=\"flex shrink-0 flex-col gap-2 border-t border-border px-4 py-3\">\n <form.Subscribe\n selector={state => ({\n isSubmitting: state.isSubmitting,\n disabled: state.isPristine || !state.isValid || state.isValidating || state.isSubmitting || !state.canSubmit,\n })}\n children={({ isSubmitting, disabled }) => (\n <SubmitButton isSubmitting={isSubmitting} disabled={disabled} className=\"w-full\" onClick={() => form.handleSubmit()} />\n )}\n />\n <form.Subscribe\n selector={state => ({ disabled: state.isPristine || state.isSubmitting })}\n children={({ disabled }) => (\n <CancelButton\n disabled={disabled}\n className=\"w-full\"\n onClick={() => {\n form.reset();\n onOpenChange?.(false);\n }}\n />\n )}\n />\n </div>\n\n <DialogPrimitive.Close asChild>\n <CloseButton className=\"absolute top-2.5 right-3\" />\n </DialogPrimitive.Close>\n </section>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n </DialogPrimitive.Root>\n );\n};\n"],"mappings":"iOAyBA,MAAa,GAWR,CAAE,QAAO,OAAM,mBAAkB,eAAc,cAAe,CACjE,IAAM,EAAOA,EAAAA,EAAuB,EAEpC,OACE,EAAA,EAAA,IAAA,CAACC,EAAAA,OAAgB,KAAjB,CAAsB,YAAU,SAAe,OAAoB,eACjE,UAAA,EAAA,EAAA,KAAA,CAACA,EAAAA,OAAgB,OAAjB,CAAwB,YAAU,gBAAlC,SAAA,EACE,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAgB,QAAjB,CACE,YAAU,iBACV,WAAA,EAAA,EAAA,GAAA,CACE,kDACA,yDACA,8DACF,CACD,CAAA,GACD,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAgB,QAAjB,CACE,YAAU,iBACV,WAAA,EAAA,EAAA,GAAA,CACE,yHACA,eACA,+FACA,qGACF,EAEA,UAAA,EAAA,EAAA,KAAA,CAAC,UAAD,CAAS,UAAU,mCAAnB,SAAA,EACE,EAAA,EAAA,IAAA,CAAC,SAAD,CAAQ,UAAU,8DAChB,UAAA,EAAA,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,4DAA6D,SAAA,CAAU,CAAA,CAC/E,CAAA,GAER,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,WAAA,EAAA,EAAA,GAAA,CAAc,4CAA6C,CAAgB,EAAI,UAAc,CAAA,GAElG,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,gEAAf,SAAA,EACE,EAAA,EAAA,IAAA,CAAC,EAAK,UAAN,CACE,SAAU,IAAU,CAClB,aAAc,EAAM,aACpB,SAAU,EAAM,YAAc,CAAC,EAAM,SAAW,EAAM,cAAgB,EAAM,cAAgB,CAAC,EAAM,SACrG,GACA,UAAW,CAAE,eAAc,eACzB,EAAA,EAAA,IAAA,CAACC,EAAAA,EAAD,CAA4B,eAAwB,WAAU,UAAU,SAAS,YAAe,EAAK,aAAa,CAAI,CAAA,CAEzH,CAAA,GACD,EAAA,EAAA,IAAA,CAAC,EAAK,UAAN,CACE,SAAU,IAAU,CAAE,SAAU,EAAM,YAAc,EAAM,YAAa,GACvE,UAAW,CAAE,eACX,EAAA,EAAA,IAAA,CAACC,EAAAA,EAAD,CACY,WACV,UAAU,SACV,YAAe,CACb,EAAK,MAAM,EACX,IAAe,EAAK,CACtB,CACD,CAAA,CAEJ,CAAA,CACE,KAEL,EAAA,EAAA,IAAA,CAACF,EAAAA,OAAgB,MAAjB,CAAuB,QAAA,GACrB,UAAA,EAAA,EAAA,IAAA,CAACG,EAAAA,EAAD,CAAa,UAAU,0BAA4B,CAAA,CAC9B,CAAA,CAChB,GACc,CAAA,CACH,GACJ,CAAA,CAE1B"}
1
+ {"version":3,"file":"popover-form-Ch_iMMSm.cjs","names":["useTanStackFormContext","DialogPrimitive","SubmitButton","CancelButton","CloseButton"],"sources":["../packages/components/features/tanstack-form/components/forms/popover-form.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { CloseButton } from '@/components/ui/buttons/close';\n\nimport { Dialog as DialogPrimitive } from 'radix-ui';\nimport { useTanStackFormContext } from '../form-context';\nimport { CancelButton } from '../ui/cancel-button';\nimport { SubmitButton } from '../ui/submit-button';\n\n/**\n * Renders a slide-in side-panel dialog that wraps a TanStack form with built-in submit and cancel actions.\n *\n * @example\n * import { TanStackPopoverForm } from '@customafk/lunas-ui/features/tanstack-form';\n *\n * <TanStackPopoverForm\n * title=\"Edit Profile\"\n * open={isOpen}\n * onOpenChange={setIsOpen}\n * >\n * <EmailField />\n * </TanStackPopoverForm>\n */\nexport const TanStackPopoverForm: React.FC<\n React.PropsWithChildren<{\n /** Heading text displayed in the panel header. */\n title: string;\n /** Controlled open state of the popover dialog. */\n open?: boolean;\n /** Additional CSS class names applied to the scrollable content area. */\n contentClassName?: string;\n /** Callback fired when the open state changes. */\n onOpenChange?: (open: boolean) => void;\n }>\n> = ({ title, open, contentClassName, onOpenChange, children }) => {\n const form = useTanStackFormContext();\n\n return (\n <DialogPrimitive.Root data-slot=\"dialog\" open={open} onOpenChange={onOpenChange}>\n <DialogPrimitive.Portal data-slot=\"dialog-portal\">\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n 'fixed inset-0 z-40 bg-black/40 backdrop-blur-sm',\n 'data-[state=open]:animate-in data-[state=open]:fade-in',\n 'data-[state=closed]:animate-out data-[state=closed]:fade-out'\n )}\n />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'fixed top-4 right-4 z-50 h-[calc(100dvh-2rem)] min-w-sm max-w-xl rounded-md bg-background shadow-lg ring-1 ring-border',\n 'duration-300',\n 'data-[state=open]:animate-in data-[state=open]:slide-in-from-right data-[state=open]:fade-in',\n 'data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right data-[state=closed]:fade-out'\n )}\n >\n <section className=\"relative flex size-full flex-col\">\n <header className=\"flex h-14 shrink-0 items-center border-b border-border px-5\">\n <h2 className=\"font-semibold text-base tracking-tight text-text-positive\">{title}</h2>\n </header>\n\n <div className={cn('flex flex-1 flex-col overflow-y-auto py-4', contentClassName)}>{children}</div>\n\n <div className=\"flex shrink-0 flex-col gap-2 border-t border-border px-4 py-3\">\n <form.Subscribe\n selector={state => ({\n isSubmitting: state.isSubmitting,\n disabled: state.isPristine || !state.isValid || state.isValidating || state.isSubmitting || !state.canSubmit,\n })}\n children={({ isSubmitting, disabled }) => (\n <SubmitButton isSubmitting={isSubmitting} disabled={disabled} className=\"w-full\" onClick={() => form.handleSubmit()} />\n )}\n />\n <form.Subscribe\n selector={state => ({ disabled: state.isPristine || state.isSubmitting })}\n children={({ disabled }) => (\n <CancelButton\n disabled={disabled}\n className=\"w-full\"\n onClick={() => {\n form.reset();\n onOpenChange?.(false);\n }}\n />\n )}\n />\n </div>\n\n <DialogPrimitive.Close asChild>\n <CloseButton className=\"absolute top-2.5 right-3\" />\n </DialogPrimitive.Close>\n </section>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n </DialogPrimitive.Root>\n );\n};\n"],"mappings":"iOAyBA,MAAa,GAWR,CAAE,QAAO,OAAM,mBAAkB,eAAc,cAAe,CACjE,IAAM,EAAOA,EAAAA,EAAuB,EAEpC,OACE,EAAA,EAAA,IAAA,CAACC,EAAAA,OAAgB,KAAjB,CAAsB,YAAU,SAAe,OAAoB,eACjE,UAAA,EAAA,EAAA,KAAA,CAACA,EAAAA,OAAgB,OAAjB,CAAwB,YAAU,gBAAlC,SAAA,EACE,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAgB,QAAjB,CACE,YAAU,iBACV,WAAA,EAAA,EAAA,GAAA,CACE,kDACA,yDACA,8DACF,CACD,CAAA,GACD,EAAA,EAAA,IAAA,CAACA,EAAAA,OAAgB,QAAjB,CACE,YAAU,iBACV,WAAA,EAAA,EAAA,GAAA,CACE,yHACA,eACA,+FACA,qGACF,EAEA,UAAA,EAAA,EAAA,KAAA,CAAC,UAAD,CAAS,UAAU,mCAAnB,SAAA,EACE,EAAA,EAAA,IAAA,CAAC,SAAD,CAAQ,UAAU,8DAChB,UAAA,EAAA,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,4DAA6D,SAAA,CAAU,CAAA,CAC/E,CAAA,GAER,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,WAAA,EAAA,EAAA,GAAA,CAAc,4CAA6C,CAAgB,EAAI,UAAc,CAAA,GAElG,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,gEAAf,SAAA,EACE,EAAA,EAAA,IAAA,CAAC,EAAK,UAAN,CACE,SAAU,IAAU,CAClB,aAAc,EAAM,aACpB,SAAU,EAAM,YAAc,CAAC,EAAM,SAAW,EAAM,cAAgB,EAAM,cAAgB,CAAC,EAAM,SACrG,GACA,UAAW,CAAE,eAAc,eACzB,EAAA,EAAA,IAAA,CAACC,EAAAA,EAAD,CAA4B,eAAwB,WAAU,UAAU,SAAS,YAAe,EAAK,aAAa,CAAI,CAAA,CAEzH,CAAA,GACD,EAAA,EAAA,IAAA,CAAC,EAAK,UAAN,CACE,SAAU,IAAU,CAAE,SAAU,EAAM,YAAc,EAAM,YAAa,GACvE,UAAW,CAAE,eACX,EAAA,EAAA,IAAA,CAACC,EAAAA,EAAD,CACY,WACV,UAAU,SACV,YAAe,CACb,EAAK,MAAM,EACX,IAAe,EAAK,CACtB,CACD,CAAA,CAEJ,CAAA,CACE,KAEL,EAAA,EAAA,IAAA,CAACF,EAAAA,OAAgB,MAAjB,CAAuB,QAAA,GACrB,UAAA,EAAA,EAAA,IAAA,CAACG,EAAAA,EAAD,CAAa,UAAU,0BAA4B,CAAA,CAC9B,CAAA,CAChB,GACc,CAAA,CACH,GACJ,CAAA,CAE1B"}
@@ -1,2 +1,2 @@
1
- const e=require("./tables-BqZ4Zs6e.cjs"),t=require("./ui/progress.cjs");let n=require("react"),r=require("@customafk/react-toolkit/utils"),i=require("react/jsx-runtime");const a=(0,n.memo)(({value:n,showLabel:a=!0,successThreshold:o=70,warningThreshold:s=40})=>{if(n==null)return(0,i.jsx)(e.Q,{});let c=Math.min(100,Math.max(0,n));return(0,i.jsxs)(`div`,{className:`flex w-full min-w-24 items-center gap-x-2`,children:[(0,i.jsx)(t.Progress,{value:c,className:(0,r.cn)(`flex-1`,c>=o?`[&>[data-slot=progress-indicator]]:bg-success`:c>=s?`[&>[data-slot=progress-indicator]]:bg-warning`:`[&>[data-slot=progress-indicator]]:bg-danger`)}),a&&(0,i.jsxs)(`span`,{className:`w-9 shrink-0 text-right font-number text-text-positive-weak text-xs tabular-nums`,children:[c,`%`]})]})});a.displayName=`UITableProgressDisplay`,exports.UITableProgressDisplay=a;
2
- //# sourceMappingURL=progress-display-CiYWPOnq.cjs.map
1
+ const e=require("./ui/progress.cjs"),t=require("./tables-DdLEj1dI.cjs");let n=require("react"),r=require("@customafk/react-toolkit/utils"),i=require("react/jsx-runtime");const a=(0,n.memo)(({value:n,showLabel:a=!0,successThreshold:o=70,warningThreshold:s=40})=>{if(n==null)return(0,i.jsx)(t.Q,{});let c=Math.min(100,Math.max(0,n));return(0,i.jsxs)(`div`,{className:`flex w-full min-w-24 items-center gap-x-2`,children:[(0,i.jsx)(e.Progress,{value:c,className:(0,r.cn)(`flex-1`,c>=o?`[&>[data-slot=progress-indicator]]:bg-success`:c>=s?`[&>[data-slot=progress-indicator]]:bg-warning`:`[&>[data-slot=progress-indicator]]:bg-danger`)}),a&&(0,i.jsxs)(`span`,{className:`w-9 shrink-0 text-right font-number text-text-positive-weak text-xs tabular-nums`,children:[c,`%`]})]})});a.displayName=`UITableProgressDisplay`,exports.UITableProgressDisplay=a;
2
+ //# sourceMappingURL=progress-display-57LT7U37.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"progress-display-CiYWPOnq.cjs","names":["UITableEmpty","Progress"],"sources":["../packages/components/features/tables/components/atoms/progress-display.tsx"],"sourcesContent":["'use client';\n\nimport { memo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Progress } from '@/components/ui/progress';\nimport { UITableEmpty } from './empty';\n\n/** Props for the {@link UITableProgressDisplay} component. */\ntype Props = {\n /** Percentage value between 0 and 100; `null`/`undefined` renders an empty state. */\n value: number | null | undefined;\n /** When `true`, shows the numeric percentage next to the bar (default: `true`). */\n showLabel?: boolean;\n /**\n * Color thresholds applied to the progress indicator.\n * - `≥ successThreshold` → green\n * - `≥ warningThreshold` → yellow\n * - otherwise → red\n *\n * Defaults: `successThreshold = 70`, `warningThreshold = 40`.\n */\n successThreshold?: number;\n warningThreshold?: number;\n};\n\n/**\n * Renders a horizontal progress bar with an optional percentage label for a\n * table cell. The bar color shifts from red → yellow → green based on\n * configurable thresholds. Renders {@link UITableEmpty} when `value` is absent.\n *\n * @example\n * import { UITableProgressDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITableProgressDisplay value={75} />\n */\nexport const UITableProgressDisplay = memo(({ value, showLabel = true, successThreshold = 70, warningThreshold = 40 }: Props) => {\n if (value === null || value === undefined) return <UITableEmpty />;\n\n const clamped = Math.min(100, Math.max(0, value));\n\n const indicatorClass =\n clamped >= successThreshold\n ? '[&>[data-slot=progress-indicator]]:bg-success'\n : clamped >= warningThreshold\n ? '[&>[data-slot=progress-indicator]]:bg-warning'\n : '[&>[data-slot=progress-indicator]]:bg-danger';\n\n return (\n <div className=\"flex w-full min-w-24 items-center gap-x-2\">\n <Progress value={clamped} className={cn('flex-1', indicatorClass)} />\n {showLabel && <span className=\"w-9 shrink-0 text-right font-number text-text-positive-weak text-xs tabular-nums\">{clamped}%</span>}\n </div>\n );\n});\nUITableProgressDisplay.displayName = 'UITableProgressDisplay';\n"],"mappings":"0KAqCA,MAAa,GAAA,EAAA,EAAA,KAAA,EAA+B,CAAE,QAAO,YAAY,GAAM,mBAAmB,GAAI,mBAAmB,MAAgB,CAC/H,GAAI,GAAU,KAA6B,OAAO,EAAA,EAAA,IAAA,CAACA,EAAAA,EAAD,CAAe,CAAA,EAEjE,IAAM,EAAU,KAAK,IAAI,IAAK,KAAK,IAAI,EAAG,CAAK,CAAC,EAShD,OACE,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,4CAAf,SAAA,EACE,EAAA,EAAA,IAAA,CAACC,EAAAA,SAAD,CAAU,MAAO,EAAS,WAAA,EAAA,EAAA,GAAA,CAAc,SAR1C,GAAW,EACP,gDACA,GAAW,EACT,gDACA,8CAI4D,CAAI,CAAA,EACnE,IAAa,EAAA,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,mFAAhB,SAAA,CAAoG,EAAQ,GAAO,CAC9H,CAAA,CAAA,GAET,CAAC,EACD,EAAuB,YAAc"}
1
+ {"version":3,"file":"progress-display-57LT7U37.cjs","names":["UITableEmpty","Progress"],"sources":["../packages/components/features/tables/components/atoms/progress-display.tsx"],"sourcesContent":["'use client';\n\nimport { memo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Progress } from '@/components/ui/progress';\nimport { UITableEmpty } from './empty';\n\n/** Props for the {@link UITableProgressDisplay} component. */\ntype Props = {\n /** Percentage value between 0 and 100; `null`/`undefined` renders an empty state. */\n value: number | null | undefined;\n /** When `true`, shows the numeric percentage next to the bar (default: `true`). */\n showLabel?: boolean;\n /**\n * Color thresholds applied to the progress indicator.\n * - `≥ successThreshold` → green\n * - `≥ warningThreshold` → yellow\n * - otherwise → red\n *\n * Defaults: `successThreshold = 70`, `warningThreshold = 40`.\n */\n successThreshold?: number;\n warningThreshold?: number;\n};\n\n/**\n * Renders a horizontal progress bar with an optional percentage label for a\n * table cell. The bar color shifts from red → yellow → green based on\n * configurable thresholds. Renders {@link UITableEmpty} when `value` is absent.\n *\n * @example\n * import { UITableProgressDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITableProgressDisplay value={75} />\n */\nexport const UITableProgressDisplay = memo(({ value, showLabel = true, successThreshold = 70, warningThreshold = 40 }: Props) => {\n if (value === null || value === undefined) return <UITableEmpty />;\n\n const clamped = Math.min(100, Math.max(0, value));\n\n const indicatorClass =\n clamped >= successThreshold\n ? '[&>[data-slot=progress-indicator]]:bg-success'\n : clamped >= warningThreshold\n ? '[&>[data-slot=progress-indicator]]:bg-warning'\n : '[&>[data-slot=progress-indicator]]:bg-danger';\n\n return (\n <div className=\"flex w-full min-w-24 items-center gap-x-2\">\n <Progress value={clamped} className={cn('flex-1', indicatorClass)} />\n {showLabel && <span className=\"w-9 shrink-0 text-right font-number text-text-positive-weak text-xs tabular-nums\">{clamped}%</span>}\n </div>\n );\n});\nUITableProgressDisplay.displayName = 'UITableProgressDisplay';\n"],"mappings":"0KAqCA,MAAa,GAAA,EAAA,EAAA,KAAA,EAA+B,CAAE,QAAO,YAAY,GAAM,mBAAmB,GAAI,mBAAmB,MAAgB,CAC/H,GAAI,GAAU,KAA6B,OAAO,EAAA,EAAA,IAAA,CAACA,EAAAA,EAAD,CAAe,CAAA,EAEjE,IAAM,EAAU,KAAK,IAAI,IAAK,KAAK,IAAI,EAAG,CAAK,CAAC,EAShD,OACE,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,4CAAf,SAAA,EACE,EAAA,EAAA,IAAA,CAACC,EAAAA,SAAD,CAAU,MAAO,EAAS,WAAA,EAAA,EAAA,GAAA,CAAc,SAR1C,GAAW,EACP,gDACA,GAAW,EACT,gDACA,8CAI4D,CAAI,CAAA,EACnE,IAAa,EAAA,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,mFAAhB,SAAA,CAAoG,EAAQ,GAAO,CAC9H,CAAA,CAAA,GAET,CAAC,EACD,EAAuB,YAAc"}
@@ -1,2 +1,2 @@
1
- import{Q as e}from"./tables-Dg3KMBKA.mjs";import{Progress as t}from"./ui/progress.mjs";import{memo as n}from"react";import{cn as r}from"@customafk/react-toolkit/utils";import{jsx as i,jsxs as a}from"react/jsx-runtime";const o=n(({value:n,showLabel:o=!0,successThreshold:s=70,warningThreshold:c=40})=>{if(n==null)return i(e,{});let l=Math.min(100,Math.max(0,n));return a(`div`,{className:`flex w-full min-w-24 items-center gap-x-2`,children:[i(t,{value:l,className:r(`flex-1`,l>=s?`[&>[data-slot=progress-indicator]]:bg-success`:l>=c?`[&>[data-slot=progress-indicator]]:bg-warning`:`[&>[data-slot=progress-indicator]]:bg-danger`)}),o&&a(`span`,{className:`w-9 shrink-0 text-right font-number text-text-positive-weak text-xs tabular-nums`,children:[l,`%`]})]})});o.displayName=`UITableProgressDisplay`;export{o as UITableProgressDisplay};
2
- //# sourceMappingURL=progress-display-0UsBzt_r.mjs.map
1
+ import{Progress as e}from"./ui/progress.mjs";import{Q as t}from"./tables-CuoBQNqx.mjs";import{memo as n}from"react";import{cn as r}from"@customafk/react-toolkit/utils";import{jsx as i,jsxs as a}from"react/jsx-runtime";const o=n(({value:n,showLabel:o=!0,successThreshold:s=70,warningThreshold:c=40})=>{if(n==null)return i(t,{});let l=Math.min(100,Math.max(0,n));return a(`div`,{className:`flex w-full min-w-24 items-center gap-x-2`,children:[i(e,{value:l,className:r(`flex-1`,l>=s?`[&>[data-slot=progress-indicator]]:bg-success`:l>=c?`[&>[data-slot=progress-indicator]]:bg-warning`:`[&>[data-slot=progress-indicator]]:bg-danger`)}),o&&a(`span`,{className:`w-9 shrink-0 text-right font-number text-text-positive-weak text-xs tabular-nums`,children:[l,`%`]})]})});o.displayName=`UITableProgressDisplay`;export{o as UITableProgressDisplay};
2
+ //# sourceMappingURL=progress-display-AfoHitiE.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"progress-display-0UsBzt_r.mjs","names":[],"sources":["../packages/components/features/tables/components/atoms/progress-display.tsx"],"sourcesContent":["'use client';\n\nimport { memo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Progress } from '@/components/ui/progress';\nimport { UITableEmpty } from './empty';\n\n/** Props for the {@link UITableProgressDisplay} component. */\ntype Props = {\n /** Percentage value between 0 and 100; `null`/`undefined` renders an empty state. */\n value: number | null | undefined;\n /** When `true`, shows the numeric percentage next to the bar (default: `true`). */\n showLabel?: boolean;\n /**\n * Color thresholds applied to the progress indicator.\n * - `≥ successThreshold` → green\n * - `≥ warningThreshold` → yellow\n * - otherwise → red\n *\n * Defaults: `successThreshold = 70`, `warningThreshold = 40`.\n */\n successThreshold?: number;\n warningThreshold?: number;\n};\n\n/**\n * Renders a horizontal progress bar with an optional percentage label for a\n * table cell. The bar color shifts from red → yellow → green based on\n * configurable thresholds. Renders {@link UITableEmpty} when `value` is absent.\n *\n * @example\n * import { UITableProgressDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITableProgressDisplay value={75} />\n */\nexport const UITableProgressDisplay = memo(({ value, showLabel = true, successThreshold = 70, warningThreshold = 40 }: Props) => {\n if (value === null || value === undefined) return <UITableEmpty />;\n\n const clamped = Math.min(100, Math.max(0, value));\n\n const indicatorClass =\n clamped >= successThreshold\n ? '[&>[data-slot=progress-indicator]]:bg-success'\n : clamped >= warningThreshold\n ? '[&>[data-slot=progress-indicator]]:bg-warning'\n : '[&>[data-slot=progress-indicator]]:bg-danger';\n\n return (\n <div className=\"flex w-full min-w-24 items-center gap-x-2\">\n <Progress value={clamped} className={cn('flex-1', indicatorClass)} />\n {showLabel && <span className=\"w-9 shrink-0 text-right font-number text-text-positive-weak text-xs tabular-nums\">{clamped}%</span>}\n </div>\n );\n});\nUITableProgressDisplay.displayName = 'UITableProgressDisplay';\n"],"mappings":"0NAqCA,MAAa,EAAyB,GAAM,CAAE,QAAO,YAAY,GAAM,mBAAmB,GAAI,mBAAmB,MAAgB,CAC/H,GAAI,GAAU,KAA6B,OAAO,EAAC,EAAD,CAAe,CAAA,EAEjE,IAAM,EAAU,KAAK,IAAI,IAAK,KAAK,IAAI,EAAG,CAAK,CAAC,EAShD,OACE,EAAC,MAAD,CAAK,UAAU,4CAAf,SAAA,CACE,EAAC,EAAD,CAAU,MAAO,EAAS,UAAW,EAAG,SAR1C,GAAW,EACP,gDACA,GAAW,EACT,gDACA,8CAI4D,CAAI,CAAA,EACnE,GAAa,EAAC,OAAD,CAAM,UAAU,mFAAhB,SAAA,CAAoG,EAAQ,GAAO,CAC9H,CAAA,CAAA,GAET,CAAC,EACD,EAAuB,YAAc"}
1
+ {"version":3,"file":"progress-display-AfoHitiE.mjs","names":[],"sources":["../packages/components/features/tables/components/atoms/progress-display.tsx"],"sourcesContent":["'use client';\n\nimport { memo } from 'react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Progress } from '@/components/ui/progress';\nimport { UITableEmpty } from './empty';\n\n/** Props for the {@link UITableProgressDisplay} component. */\ntype Props = {\n /** Percentage value between 0 and 100; `null`/`undefined` renders an empty state. */\n value: number | null | undefined;\n /** When `true`, shows the numeric percentage next to the bar (default: `true`). */\n showLabel?: boolean;\n /**\n * Color thresholds applied to the progress indicator.\n * - `≥ successThreshold` → green\n * - `≥ warningThreshold` → yellow\n * - otherwise → red\n *\n * Defaults: `successThreshold = 70`, `warningThreshold = 40`.\n */\n successThreshold?: number;\n warningThreshold?: number;\n};\n\n/**\n * Renders a horizontal progress bar with an optional percentage label for a\n * table cell. The bar color shifts from red → yellow → green based on\n * configurable thresholds. Renders {@link UITableEmpty} when `value` is absent.\n *\n * @example\n * import { UITableProgressDisplay } from '@customafk/lunas-ui/features/tables';\n *\n * <UITableProgressDisplay value={75} />\n */\nexport const UITableProgressDisplay = memo(({ value, showLabel = true, successThreshold = 70, warningThreshold = 40 }: Props) => {\n if (value === null || value === undefined) return <UITableEmpty />;\n\n const clamped = Math.min(100, Math.max(0, value));\n\n const indicatorClass =\n clamped >= successThreshold\n ? '[&>[data-slot=progress-indicator]]:bg-success'\n : clamped >= warningThreshold\n ? '[&>[data-slot=progress-indicator]]:bg-warning'\n : '[&>[data-slot=progress-indicator]]:bg-danger';\n\n return (\n <div className=\"flex w-full min-w-24 items-center gap-x-2\">\n <Progress value={clamped} className={cn('flex-1', indicatorClass)} />\n {showLabel && <span className=\"w-9 shrink-0 text-right font-number text-text-positive-weak text-xs tabular-nums\">{clamped}%</span>}\n </div>\n );\n});\nUITableProgressDisplay.displayName = 'UITableProgressDisplay';\n"],"mappings":"0NAqCA,MAAa,EAAyB,GAAM,CAAE,QAAO,YAAY,GAAM,mBAAmB,GAAI,mBAAmB,MAAgB,CAC/H,GAAI,GAAU,KAA6B,OAAO,EAAC,EAAD,CAAe,CAAA,EAEjE,IAAM,EAAU,KAAK,IAAI,IAAK,KAAK,IAAI,EAAG,CAAK,CAAC,EAShD,OACE,EAAC,MAAD,CAAK,UAAU,4CAAf,SAAA,CACE,EAAC,EAAD,CAAU,MAAO,EAAS,UAAW,EAAG,SAR1C,GAAW,EACP,gDACA,GAAW,EACT,gDACA,8CAI4D,CAAI,CAAA,EACnE,GAAa,EAAC,OAAD,CAAM,UAAU,mFAAhB,SAAA,CAAoG,EAAQ,GAAO,CAC9H,CAAA,CAAA,GAET,CAAC,EACD,EAAuB,YAAc"}
@@ -1,2 +1,2 @@
1
- const e=require("./tanstack-form-BxqS40rB.cjs"),t=require("./ui/radio-group.cjs"),n=require("./field-BSLi-P0Q.cjs");let r=require("@customafk/react-toolkit/utils"),i=require("react/jsx-runtime"),a=require("@tanstack/react-form");const o=({label:o,description:s,orientation:c,options:l,tooltip:u,helperText:d})=>{let f=e.G(),p=(0,a.useStore)(f.form.store,({isSubmitting:e})=>e);return(0,i.jsxs)(n.FieldGroup,{className:`px-4`,children:[(0,i.jsxs)(n.Field,{orientation:c,className:`flex-col gap-2`,children:[(0,i.jsxs)(n.FieldContent,{children:[(0,i.jsxs)(n.FieldLabel,{children:[o,u&&(0,i.jsx)(n.FieldTooltip,{tooltip:u})]}),(0,i.jsx)(n.FieldDescription,{children:s}),(0,i.jsx)(n.FieldNote,{isShow:!!d,children:d})]}),(0,i.jsx)(n.FieldContentMain,{children:(0,i.jsx)(t.RadioGroup,{value:f.state.value??``,className:`w-full`,onValueChange:f.handleChange,children:l.map(e=>(0,i.jsx)(n.FieldLabel,{className:(0,r.cn)(`h-fit`,f.state.value===e.value&&`border-primary-weak! bg-primary-bg-subtle`,p&&`pointer-events-none bg-muted-muted opacity-60`,f.state.value===e.value&&p&&`border-border-strong!`),children:(0,i.jsxs)(n.Field,{orientation:`horizontal`,className:`items-start gap-3 rounded p-2!`,children:[(0,i.jsx)(t.RadioGroupItem,{value:e.value,className:`mt-0.5 shrink-0`}),(0,i.jsxs)(n.FieldContent,{className:`gap-0.5!`,children:[(0,i.jsx)(n.FieldTitle,{children:e.label}),(0,i.jsx)(n.FieldDescription,{className:`text-xs`,children:e.description})]})]})},e.value))})})]}),(0,i.jsx)(n.FieldSeparator,{})]})};exports.RadioGroupField=o;
2
- //# sourceMappingURL=radio-group-field-kTgtvp1p.cjs.map
1
+ const e=require("./tanstack-form-C0ab8EEl.cjs"),t=require("./ui/radio-group.cjs"),n=require("./field-BSLi-P0Q.cjs");let r=require("@customafk/react-toolkit/utils"),i=require("react/jsx-runtime"),a=require("@tanstack/react-form");const o=({label:o,description:s,orientation:c,options:l,tooltip:u,helperText:d})=>{let f=e.G(),p=(0,a.useStore)(f.form.store,({isSubmitting:e})=>e);return(0,i.jsxs)(n.FieldGroup,{className:`px-4`,children:[(0,i.jsxs)(n.Field,{orientation:c,className:`flex-col gap-2`,children:[(0,i.jsxs)(n.FieldContent,{children:[(0,i.jsxs)(n.FieldLabel,{children:[o,u&&(0,i.jsx)(n.FieldTooltip,{tooltip:u})]}),(0,i.jsx)(n.FieldDescription,{children:s}),(0,i.jsx)(n.FieldNote,{isShow:!!d,children:d})]}),(0,i.jsx)(n.FieldContentMain,{children:(0,i.jsx)(t.RadioGroup,{value:f.state.value??``,className:`w-full`,onValueChange:f.handleChange,children:l.map(e=>(0,i.jsx)(n.FieldLabel,{className:(0,r.cn)(`h-fit`,f.state.value===e.value&&`border-primary-weak! bg-primary-bg-subtle`,p&&`pointer-events-none bg-muted-muted opacity-60`,f.state.value===e.value&&p&&`border-border-strong!`),children:(0,i.jsxs)(n.Field,{orientation:`horizontal`,className:`items-start gap-3 rounded p-2!`,children:[(0,i.jsx)(t.RadioGroupItem,{value:e.value,className:`mt-0.5 shrink-0`}),(0,i.jsxs)(n.FieldContent,{className:`gap-0.5!`,children:[(0,i.jsx)(n.FieldTitle,{children:e.label}),(0,i.jsx)(n.FieldDescription,{className:`text-xs`,children:e.description})]})]})},e.value))})})]}),(0,i.jsx)(n.FieldSeparator,{})]})};exports.RadioGroupField=o;
2
+ //# sourceMappingURL=radio-group-field-BFhBfzoT.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group-field-kTgtvp1p.cjs","names":["useTanStackFieldContext","FieldGroup","Field","FieldContent","FieldLabel","FieldTooltip","FieldDescription","FieldNote","FieldContentMain","RadioGroup","RadioGroupItem","FieldTitle","FieldSeparator"],"sources":["../packages/components/features/tanstack-form/components/fields/radio-group-field.tsx"],"sourcesContent":["'use client';\n\nimport { useStore } from '@tanstack/react-form';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { useTanStackFieldContext } from '../form-context';\nimport {\n Field,\n FieldContent,\n FieldContentMain,\n FieldDescription,\n FieldGroup,\n FieldLabel,\n FieldNote,\n FieldSeparator,\n FieldTitle,\n FieldTooltip,\n} from '../ui/field';\nimport { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group';\n\nimport type { RadioGroupFieldProps as Props } from '../../types';\n\nexport const RadioGroupField: React.FC<Props> = ({ label, description, orientation, options, tooltip, helperText }) => {\n const field = useTanStackFieldContext<string | null>();\n const isSubmitting = useStore(field.form.store, ({ isSubmitting }) => isSubmitting);\n\n return (\n <FieldGroup className=\"px-4\">\n <Field orientation={orientation} className=\"flex-col gap-2\">\n <FieldContent>\n <FieldLabel>\n {label}\n {tooltip && <FieldTooltip tooltip={tooltip} />}\n </FieldLabel>\n <FieldDescription>{description}</FieldDescription>\n <FieldNote isShow={!!helperText}>{helperText}</FieldNote>\n </FieldContent>\n\n <FieldContentMain>\n <RadioGroup value={field.state.value ?? ''} className=\"w-full\" onValueChange={field.handleChange}>\n {options.map(option => (\n <FieldLabel\n key={option.value}\n className={cn(\n 'h-fit',\n field.state.value === option.value && 'border-primary-weak! bg-primary-bg-subtle',\n isSubmitting && 'pointer-events-none bg-muted-muted opacity-60',\n field.state.value === option.value && isSubmitting && 'border-border-strong!'\n )}\n >\n <Field orientation=\"horizontal\" className=\"items-start gap-3 rounded p-2!\">\n <RadioGroupItem value={option.value} className=\"mt-0.5 shrink-0\" />\n <FieldContent className=\"gap-0.5!\">\n <FieldTitle>{option.label}</FieldTitle>\n <FieldDescription className=\"text-xs\">{option.description}</FieldDescription>\n </FieldContent>\n </Field>\n </FieldLabel>\n ))}\n </RadioGroup>\n </FieldContentMain>\n </Field>\n <FieldSeparator />\n </FieldGroup>\n );\n};\n"],"mappings":"qOAuBA,MAAa,GAAoC,CAAE,QAAO,cAAa,cAAa,UAAS,UAAS,gBAAiB,CACrH,IAAM,EAAQA,EAAAA,EAAuC,EAC/C,GAAA,EAAA,EAAA,SAAA,CAAwB,EAAM,KAAK,OAAQ,CAAE,kBAAmB,CAAY,EAElF,OACE,EAAA,EAAA,KAAA,CAACC,EAAAA,WAAD,CAAY,UAAU,OAAtB,SAAA,EACE,EAAA,EAAA,KAAA,CAACC,EAAAA,MAAD,CAAoB,cAAa,UAAU,iBAA3C,SAAA,EACE,EAAA,EAAA,KAAA,CAACC,EAAAA,aAAD,CAAA,SAAA,EACE,EAAA,EAAA,KAAA,CAACC,EAAAA,WAAD,CAAA,SAAA,CACG,EACA,IAAW,EAAA,EAAA,IAAA,CAACC,EAAAA,aAAD,CAAuB,SAAU,CAAA,CACnC,CAAA,CAAA,GACZ,EAAA,EAAA,IAAA,CAACC,EAAAA,iBAAD,CAAA,SAAmB,CAA8B,CAAA,GACjD,EAAA,EAAA,IAAA,CAACC,EAAAA,UAAD,CAAW,OAAQ,CAAC,CAAC,EAAa,SAAA,CAAsB,CAAA,CAC5C,CAAA,CAAA,GAEd,EAAA,EAAA,IAAA,CAACC,EAAAA,iBAAD,CAAA,UACE,EAAA,EAAA,IAAA,CAACC,EAAAA,WAAD,CAAY,MAAO,EAAM,MAAM,OAAS,GAAI,UAAU,SAAS,cAAe,EAAM,aACjF,SAAA,EAAQ,IAAI,IACX,EAAA,EAAA,IAAA,CAACL,EAAAA,WAAD,CAEE,WAAA,EAAA,EAAA,GAAA,CACE,QACA,EAAM,MAAM,QAAU,EAAO,OAAS,4CACtC,GAAgB,gDAChB,EAAM,MAAM,QAAU,EAAO,OAAS,GAAgB,uBACxD,EAEA,UAAA,EAAA,EAAA,KAAA,CAACF,EAAAA,MAAD,CAAO,YAAY,aAAa,UAAU,iCAA1C,SAAA,EACE,EAAA,EAAA,IAAA,CAACQ,EAAAA,eAAD,CAAgB,MAAO,EAAO,MAAO,UAAU,iBAAmB,CAAA,GAClE,EAAA,EAAA,KAAA,CAACP,EAAAA,aAAD,CAAc,UAAU,WAAxB,SAAA,EACE,EAAA,EAAA,IAAA,CAACQ,EAAAA,WAAD,CAAA,SAAa,EAAO,KAAkB,CAAA,GACtC,EAAA,EAAA,IAAA,CAACL,EAAAA,iBAAD,CAAkB,UAAU,UAAW,SAAA,EAAO,WAA8B,CAAA,CAChE,CACT,CAAA,CAAA,GACG,EAfL,EAAO,KAeF,CACb,CACS,CAAA,CACI,CAAA,CACb,CACP,CAAA,GAAA,EAAA,EAAA,IAAA,CAACM,EAAAA,eAAD,CAAiB,CAAA,CACP,GAEhB"}
1
+ {"version":3,"file":"radio-group-field-BFhBfzoT.cjs","names":["useTanStackFieldContext","FieldGroup","Field","FieldContent","FieldLabel","FieldTooltip","FieldDescription","FieldNote","FieldContentMain","RadioGroup","RadioGroupItem","FieldTitle","FieldSeparator"],"sources":["../packages/components/features/tanstack-form/components/fields/radio-group-field.tsx"],"sourcesContent":["'use client';\n\nimport { useStore } from '@tanstack/react-form';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { useTanStackFieldContext } from '../form-context';\nimport {\n Field,\n FieldContent,\n FieldContentMain,\n FieldDescription,\n FieldGroup,\n FieldLabel,\n FieldNote,\n FieldSeparator,\n FieldTitle,\n FieldTooltip,\n} from '../ui/field';\nimport { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group';\n\nimport type { RadioGroupFieldProps as Props } from '../../types';\n\nexport const RadioGroupField: React.FC<Props> = ({ label, description, orientation, options, tooltip, helperText }) => {\n const field = useTanStackFieldContext<string | null>();\n const isSubmitting = useStore(field.form.store, ({ isSubmitting }) => isSubmitting);\n\n return (\n <FieldGroup className=\"px-4\">\n <Field orientation={orientation} className=\"flex-col gap-2\">\n <FieldContent>\n <FieldLabel>\n {label}\n {tooltip && <FieldTooltip tooltip={tooltip} />}\n </FieldLabel>\n <FieldDescription>{description}</FieldDescription>\n <FieldNote isShow={!!helperText}>{helperText}</FieldNote>\n </FieldContent>\n\n <FieldContentMain>\n <RadioGroup value={field.state.value ?? ''} className=\"w-full\" onValueChange={field.handleChange}>\n {options.map(option => (\n <FieldLabel\n key={option.value}\n className={cn(\n 'h-fit',\n field.state.value === option.value && 'border-primary-weak! bg-primary-bg-subtle',\n isSubmitting && 'pointer-events-none bg-muted-muted opacity-60',\n field.state.value === option.value && isSubmitting && 'border-border-strong!'\n )}\n >\n <Field orientation=\"horizontal\" className=\"items-start gap-3 rounded p-2!\">\n <RadioGroupItem value={option.value} className=\"mt-0.5 shrink-0\" />\n <FieldContent className=\"gap-0.5!\">\n <FieldTitle>{option.label}</FieldTitle>\n <FieldDescription className=\"text-xs\">{option.description}</FieldDescription>\n </FieldContent>\n </Field>\n </FieldLabel>\n ))}\n </RadioGroup>\n </FieldContentMain>\n </Field>\n <FieldSeparator />\n </FieldGroup>\n );\n};\n"],"mappings":"qOAuBA,MAAa,GAAoC,CAAE,QAAO,cAAa,cAAa,UAAS,UAAS,gBAAiB,CACrH,IAAM,EAAQA,EAAAA,EAAuC,EAC/C,GAAA,EAAA,EAAA,SAAA,CAAwB,EAAM,KAAK,OAAQ,CAAE,kBAAmB,CAAY,EAElF,OACE,EAAA,EAAA,KAAA,CAACC,EAAAA,WAAD,CAAY,UAAU,OAAtB,SAAA,EACE,EAAA,EAAA,KAAA,CAACC,EAAAA,MAAD,CAAoB,cAAa,UAAU,iBAA3C,SAAA,EACE,EAAA,EAAA,KAAA,CAACC,EAAAA,aAAD,CAAA,SAAA,EACE,EAAA,EAAA,KAAA,CAACC,EAAAA,WAAD,CAAA,SAAA,CACG,EACA,IAAW,EAAA,EAAA,IAAA,CAACC,EAAAA,aAAD,CAAuB,SAAU,CAAA,CACnC,CAAA,CAAA,GACZ,EAAA,EAAA,IAAA,CAACC,EAAAA,iBAAD,CAAA,SAAmB,CAA8B,CAAA,GACjD,EAAA,EAAA,IAAA,CAACC,EAAAA,UAAD,CAAW,OAAQ,CAAC,CAAC,EAAa,SAAA,CAAsB,CAAA,CAC5C,CAAA,CAAA,GAEd,EAAA,EAAA,IAAA,CAACC,EAAAA,iBAAD,CAAA,UACE,EAAA,EAAA,IAAA,CAACC,EAAAA,WAAD,CAAY,MAAO,EAAM,MAAM,OAAS,GAAI,UAAU,SAAS,cAAe,EAAM,aACjF,SAAA,EAAQ,IAAI,IACX,EAAA,EAAA,IAAA,CAACL,EAAAA,WAAD,CAEE,WAAA,EAAA,EAAA,GAAA,CACE,QACA,EAAM,MAAM,QAAU,EAAO,OAAS,4CACtC,GAAgB,gDAChB,EAAM,MAAM,QAAU,EAAO,OAAS,GAAgB,uBACxD,EAEA,UAAA,EAAA,EAAA,KAAA,CAACF,EAAAA,MAAD,CAAO,YAAY,aAAa,UAAU,iCAA1C,SAAA,EACE,EAAA,EAAA,IAAA,CAACQ,EAAAA,eAAD,CAAgB,MAAO,EAAO,MAAO,UAAU,iBAAmB,CAAA,GAClE,EAAA,EAAA,KAAA,CAACP,EAAAA,aAAD,CAAc,UAAU,WAAxB,SAAA,EACE,EAAA,EAAA,IAAA,CAACQ,EAAAA,WAAD,CAAA,SAAa,EAAO,KAAkB,CAAA,GACtC,EAAA,EAAA,IAAA,CAACL,EAAAA,iBAAD,CAAkB,UAAU,UAAW,SAAA,EAAO,WAA8B,CAAA,CAChE,CACT,CAAA,CAAA,GACG,EAfL,EAAO,KAeF,CACb,CACS,CAAA,CACI,CAAA,CACb,CACP,CAAA,GAAA,EAAA,EAAA,IAAA,CAACM,EAAAA,eAAD,CAAiB,CAAA,CACP,GAEhB"}
@@ -1,2 +1,2 @@
1
- import{G as e}from"./tanstack-form-q9hDCc0Y.mjs";import{RadioGroup as t,RadioGroupItem as n}from"./ui/radio-group.mjs";import{Field as r,FieldContent as i,FieldContentMain as a,FieldDescription as o,FieldGroup as s,FieldLabel as c,FieldNote as l,FieldSeparator as u,FieldTitle as d,FieldTooltip as f}from"./field-V2DoD8qL.mjs";import{cn as p}from"@customafk/react-toolkit/utils";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{useStore as g}from"@tanstack/react-form";const _=({label:_,description:v,orientation:y,options:b,tooltip:x,helperText:S})=>{let C=e(),w=g(C.form.store,({isSubmitting:e})=>e);return h(s,{className:`px-4`,children:[h(r,{orientation:y,className:`flex-col gap-2`,children:[h(i,{children:[h(c,{children:[_,x&&m(f,{tooltip:x})]}),m(o,{children:v}),m(l,{isShow:!!S,children:S})]}),m(a,{children:m(t,{value:C.state.value??``,className:`w-full`,onValueChange:C.handleChange,children:b.map(e=>m(c,{className:p(`h-fit`,C.state.value===e.value&&`border-primary-weak! bg-primary-bg-subtle`,w&&`pointer-events-none bg-muted-muted opacity-60`,C.state.value===e.value&&w&&`border-border-strong!`),children:h(r,{orientation:`horizontal`,className:`items-start gap-3 rounded p-2!`,children:[m(n,{value:e.value,className:`mt-0.5 shrink-0`}),h(i,{className:`gap-0.5!`,children:[m(d,{children:e.label}),m(o,{className:`text-xs`,children:e.description})]})]})},e.value))})})]}),m(u,{})]})};export{_ as RadioGroupField};
2
- //# sourceMappingURL=radio-group-field-DOJ4jVSr.mjs.map
1
+ import{G as e}from"./tanstack-form-fkaBh9RO.mjs";import{RadioGroup as t,RadioGroupItem as n}from"./ui/radio-group.mjs";import{Field as r,FieldContent as i,FieldContentMain as a,FieldDescription as o,FieldGroup as s,FieldLabel as c,FieldNote as l,FieldSeparator as u,FieldTitle as d,FieldTooltip as f}from"./field-V2DoD8qL.mjs";import{cn as p}from"@customafk/react-toolkit/utils";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{useStore as g}from"@tanstack/react-form";const _=({label:_,description:v,orientation:y,options:b,tooltip:x,helperText:S})=>{let C=e(),w=g(C.form.store,({isSubmitting:e})=>e);return h(s,{className:`px-4`,children:[h(r,{orientation:y,className:`flex-col gap-2`,children:[h(i,{children:[h(c,{children:[_,x&&m(f,{tooltip:x})]}),m(o,{children:v}),m(l,{isShow:!!S,children:S})]}),m(a,{children:m(t,{value:C.state.value??``,className:`w-full`,onValueChange:C.handleChange,children:b.map(e=>m(c,{className:p(`h-fit`,C.state.value===e.value&&`border-primary-weak! bg-primary-bg-subtle`,w&&`pointer-events-none bg-muted-muted opacity-60`,C.state.value===e.value&&w&&`border-border-strong!`),children:h(r,{orientation:`horizontal`,className:`items-start gap-3 rounded p-2!`,children:[m(n,{value:e.value,className:`mt-0.5 shrink-0`}),h(i,{className:`gap-0.5!`,children:[m(d,{children:e.label}),m(o,{className:`text-xs`,children:e.description})]})]})},e.value))})})]}),m(u,{})]})};export{_ as RadioGroupField};
2
+ //# sourceMappingURL=radio-group-field-Iwo2Q2Ig.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group-field-DOJ4jVSr.mjs","names":[],"sources":["../packages/components/features/tanstack-form/components/fields/radio-group-field.tsx"],"sourcesContent":["'use client';\n\nimport { useStore } from '@tanstack/react-form';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { useTanStackFieldContext } from '../form-context';\nimport {\n Field,\n FieldContent,\n FieldContentMain,\n FieldDescription,\n FieldGroup,\n FieldLabel,\n FieldNote,\n FieldSeparator,\n FieldTitle,\n FieldTooltip,\n} from '../ui/field';\nimport { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group';\n\nimport type { RadioGroupFieldProps as Props } from '../../types';\n\nexport const RadioGroupField: React.FC<Props> = ({ label, description, orientation, options, tooltip, helperText }) => {\n const field = useTanStackFieldContext<string | null>();\n const isSubmitting = useStore(field.form.store, ({ isSubmitting }) => isSubmitting);\n\n return (\n <FieldGroup className=\"px-4\">\n <Field orientation={orientation} className=\"flex-col gap-2\">\n <FieldContent>\n <FieldLabel>\n {label}\n {tooltip && <FieldTooltip tooltip={tooltip} />}\n </FieldLabel>\n <FieldDescription>{description}</FieldDescription>\n <FieldNote isShow={!!helperText}>{helperText}</FieldNote>\n </FieldContent>\n\n <FieldContentMain>\n <RadioGroup value={field.state.value ?? ''} className=\"w-full\" onValueChange={field.handleChange}>\n {options.map(option => (\n <FieldLabel\n key={option.value}\n className={cn(\n 'h-fit',\n field.state.value === option.value && 'border-primary-weak! bg-primary-bg-subtle',\n isSubmitting && 'pointer-events-none bg-muted-muted opacity-60',\n field.state.value === option.value && isSubmitting && 'border-border-strong!'\n )}\n >\n <Field orientation=\"horizontal\" className=\"items-start gap-3 rounded p-2!\">\n <RadioGroupItem value={option.value} className=\"mt-0.5 shrink-0\" />\n <FieldContent className=\"gap-0.5!\">\n <FieldTitle>{option.label}</FieldTitle>\n <FieldDescription className=\"text-xs\">{option.description}</FieldDescription>\n </FieldContent>\n </Field>\n </FieldLabel>\n ))}\n </RadioGroup>\n </FieldContentMain>\n </Field>\n <FieldSeparator />\n </FieldGroup>\n );\n};\n"],"mappings":"6dAuBA,MAAa,GAAoC,CAAE,QAAO,cAAa,cAAa,UAAS,UAAS,gBAAiB,CACrH,IAAM,EAAQ,EAAuC,EAC/C,EAAe,EAAS,EAAM,KAAK,OAAQ,CAAE,kBAAmB,CAAY,EAElF,OACE,EAAC,EAAD,CAAY,UAAU,OAAtB,SAAA,CACE,EAAC,EAAD,CAAoB,cAAa,UAAU,iBAA3C,SAAA,CACE,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAA,SAAA,CACG,EACA,GAAW,EAAC,EAAD,CAAuB,SAAU,CAAA,CACnC,CAAA,CAAA,EACZ,EAAC,EAAD,CAAA,SAAmB,CAA8B,CAAA,EACjD,EAAC,EAAD,CAAW,OAAQ,CAAC,CAAC,EAAa,SAAA,CAAsB,CAAA,CAC5C,CAAA,CAAA,EAEd,EAAC,EAAD,CAAA,SACE,EAAC,EAAD,CAAY,MAAO,EAAM,MAAM,OAAS,GAAI,UAAU,SAAS,cAAe,EAAM,aACjF,SAAA,EAAQ,IAAI,GACX,EAAC,EAAD,CAEE,UAAW,EACT,QACA,EAAM,MAAM,QAAU,EAAO,OAAS,4CACtC,GAAgB,gDAChB,EAAM,MAAM,QAAU,EAAO,OAAS,GAAgB,uBACxD,EAEA,SAAA,EAAC,EAAD,CAAO,YAAY,aAAa,UAAU,iCAA1C,SAAA,CACE,EAAC,EAAD,CAAgB,MAAO,EAAO,MAAO,UAAU,iBAAmB,CAAA,EAClE,EAAC,EAAD,CAAc,UAAU,WAAxB,SAAA,CACE,EAAC,EAAD,CAAA,SAAa,EAAO,KAAkB,CAAA,EACtC,EAAC,EAAD,CAAkB,UAAU,UAAW,SAAA,EAAO,WAA8B,CAAA,CAChE,CACT,CAAA,CAAA,GACG,EAfL,EAAO,KAeF,CACb,CACS,CAAA,CACI,CAAA,CACb,CACP,CAAA,EAAA,EAAC,EAAD,CAAiB,CAAA,CACP,GAEhB"}
1
+ {"version":3,"file":"radio-group-field-Iwo2Q2Ig.mjs","names":[],"sources":["../packages/components/features/tanstack-form/components/fields/radio-group-field.tsx"],"sourcesContent":["'use client';\n\nimport { useStore } from '@tanstack/react-form';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { useTanStackFieldContext } from '../form-context';\nimport {\n Field,\n FieldContent,\n FieldContentMain,\n FieldDescription,\n FieldGroup,\n FieldLabel,\n FieldNote,\n FieldSeparator,\n FieldTitle,\n FieldTooltip,\n} from '../ui/field';\nimport { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group';\n\nimport type { RadioGroupFieldProps as Props } from '../../types';\n\nexport const RadioGroupField: React.FC<Props> = ({ label, description, orientation, options, tooltip, helperText }) => {\n const field = useTanStackFieldContext<string | null>();\n const isSubmitting = useStore(field.form.store, ({ isSubmitting }) => isSubmitting);\n\n return (\n <FieldGroup className=\"px-4\">\n <Field orientation={orientation} className=\"flex-col gap-2\">\n <FieldContent>\n <FieldLabel>\n {label}\n {tooltip && <FieldTooltip tooltip={tooltip} />}\n </FieldLabel>\n <FieldDescription>{description}</FieldDescription>\n <FieldNote isShow={!!helperText}>{helperText}</FieldNote>\n </FieldContent>\n\n <FieldContentMain>\n <RadioGroup value={field.state.value ?? ''} className=\"w-full\" onValueChange={field.handleChange}>\n {options.map(option => (\n <FieldLabel\n key={option.value}\n className={cn(\n 'h-fit',\n field.state.value === option.value && 'border-primary-weak! bg-primary-bg-subtle',\n isSubmitting && 'pointer-events-none bg-muted-muted opacity-60',\n field.state.value === option.value && isSubmitting && 'border-border-strong!'\n )}\n >\n <Field orientation=\"horizontal\" className=\"items-start gap-3 rounded p-2!\">\n <RadioGroupItem value={option.value} className=\"mt-0.5 shrink-0\" />\n <FieldContent className=\"gap-0.5!\">\n <FieldTitle>{option.label}</FieldTitle>\n <FieldDescription className=\"text-xs\">{option.description}</FieldDescription>\n </FieldContent>\n </Field>\n </FieldLabel>\n ))}\n </RadioGroup>\n </FieldContentMain>\n </Field>\n <FieldSeparator />\n </FieldGroup>\n );\n};\n"],"mappings":"6dAuBA,MAAa,GAAoC,CAAE,QAAO,cAAa,cAAa,UAAS,UAAS,gBAAiB,CACrH,IAAM,EAAQ,EAAuC,EAC/C,EAAe,EAAS,EAAM,KAAK,OAAQ,CAAE,kBAAmB,CAAY,EAElF,OACE,EAAC,EAAD,CAAY,UAAU,OAAtB,SAAA,CACE,EAAC,EAAD,CAAoB,cAAa,UAAU,iBAA3C,SAAA,CACE,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAA,SAAA,CACG,EACA,GAAW,EAAC,EAAD,CAAuB,SAAU,CAAA,CACnC,CAAA,CAAA,EACZ,EAAC,EAAD,CAAA,SAAmB,CAA8B,CAAA,EACjD,EAAC,EAAD,CAAW,OAAQ,CAAC,CAAC,EAAa,SAAA,CAAsB,CAAA,CAC5C,CAAA,CAAA,EAEd,EAAC,EAAD,CAAA,SACE,EAAC,EAAD,CAAY,MAAO,EAAM,MAAM,OAAS,GAAI,UAAU,SAAS,cAAe,EAAM,aACjF,SAAA,EAAQ,IAAI,GACX,EAAC,EAAD,CAEE,UAAW,EACT,QACA,EAAM,MAAM,QAAU,EAAO,OAAS,4CACtC,GAAgB,gDAChB,EAAM,MAAM,QAAU,EAAO,OAAS,GAAgB,uBACxD,EAEA,SAAA,EAAC,EAAD,CAAO,YAAY,aAAa,UAAU,iCAA1C,SAAA,CACE,EAAC,EAAD,CAAgB,MAAO,EAAO,MAAO,UAAU,iBAAmB,CAAA,EAClE,EAAC,EAAD,CAAc,UAAU,WAAxB,SAAA,CACE,EAAC,EAAD,CAAA,SAAa,EAAO,KAAkB,CAAA,EACtC,EAAC,EAAD,CAAkB,UAAU,UAAW,SAAA,EAAO,WAA8B,CAAA,CAChE,CACT,CAAA,CAAA,GACG,EAfL,EAAO,KAeF,CACb,CACS,CAAA,CACI,CAAA,CACb,CACP,CAAA,EAAA,EAAC,EAAD,CAAiB,CAAA,CACP,GAEhB"}
@@ -35,7 +35,7 @@ declare const ResizablePanelGroup: import("react").NamedExoticComponent<Omit<imp
35
35
  children?: import("react").ReactNode | undefined;
36
36
  } & import("react").RefAttributes<ResizablePrimitive.ImperativePanelGroupHandle>>;
37
37
  /** An individual resizable panel within a ResizablePanelGroup. */
38
- declare const ResizablePanel: import("react").NamedExoticComponent<Omit<import("react").HTMLAttributes<HTMLInputElement | HTMLElement | HTMLParagraphElement | HTMLDivElement | HTMLButtonElement | HTMLFieldSetElement | HTMLLegendElement | HTMLLabelElement | HTMLObjectElement | HTMLAnchorElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableCaptionElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFormElement | HTMLHeadingElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLLIElement | HTMLLinkElement | HTMLMapElement | HTMLMenuElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPictureElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLSourceElement | HTMLSpanElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement>, "id" | "onResize"> & {
38
+ declare const ResizablePanel: import("react").NamedExoticComponent<Omit<import("react").HTMLAttributes<HTMLInputElement | HTMLElement | HTMLParagraphElement | HTMLDivElement | HTMLButtonElement | HTMLLabelElement | HTMLFieldSetElement | HTMLLegendElement | HTMLObjectElement | HTMLAnchorElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableCaptionElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFormElement | HTMLHeadingElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLLIElement | HTMLLinkElement | HTMLMapElement | HTMLMenuElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPictureElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLSourceElement | HTMLSpanElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement>, "id" | "onResize"> & {
39
39
  className?: string;
40
40
  collapsedSize?: number | undefined;
41
41
  collapsible?: boolean | undefined;
@@ -60,4 +60,4 @@ declare const ResizablePanel: import("react").NamedExoticComponent<Omit<import("
60
60
  declare const ResizableHandle: import("react").NamedExoticComponent<TResizableHandle>;
61
61
  //#endregion
62
62
  export { ResizablePanel as n, ResizablePanelGroup as r, ResizableHandle as t };
63
- //# sourceMappingURL=resizable-C3uADYIg.d.mts.map
63
+ //# sourceMappingURL=resizable-CNqPu4Ck.d.cts.map
@@ -35,7 +35,7 @@ declare const ResizablePanelGroup: import("react").NamedExoticComponent<Omit<imp
35
35
  children?: import("react").ReactNode | undefined;
36
36
  } & import("react").RefAttributes<ResizablePrimitive.ImperativePanelGroupHandle>>;
37
37
  /** An individual resizable panel within a ResizablePanelGroup. */
38
- declare const ResizablePanel: import("react").NamedExoticComponent<Omit<import("react").HTMLAttributes<HTMLInputElement | HTMLElement | HTMLParagraphElement | HTMLDivElement | HTMLButtonElement | HTMLFieldSetElement | HTMLLegendElement | HTMLLabelElement | HTMLObjectElement | HTMLAnchorElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableCaptionElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFormElement | HTMLHeadingElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLLIElement | HTMLLinkElement | HTMLMapElement | HTMLMenuElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPictureElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLSourceElement | HTMLSpanElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement>, "id" | "onResize"> & {
38
+ declare const ResizablePanel: import("react").NamedExoticComponent<Omit<import("react").HTMLAttributes<HTMLInputElement | HTMLElement | HTMLParagraphElement | HTMLDivElement | HTMLButtonElement | HTMLLabelElement | HTMLFieldSetElement | HTMLLegendElement | HTMLObjectElement | HTMLAnchorElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableCaptionElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFormElement | HTMLHeadingElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLLIElement | HTMLLinkElement | HTMLMapElement | HTMLMenuElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPictureElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLSourceElement | HTMLSpanElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement>, "id" | "onResize"> & {
39
39
  className?: string;
40
40
  collapsedSize?: number | undefined;
41
41
  collapsible?: boolean | undefined;
@@ -60,4 +60,4 @@ declare const ResizablePanel: import("react").NamedExoticComponent<Omit<import("
60
60
  declare const ResizableHandle: import("react").NamedExoticComponent<TResizableHandle>;
61
61
  //#endregion
62
62
  export { ResizablePanel as n, ResizablePanelGroup as r, ResizableHandle as t };
63
- //# sourceMappingURL=resizable-C3uADYIg.d.cts.map
63
+ //# sourceMappingURL=resizable-CNqPu4Ck.d.mts.map
@@ -1,2 +1,2 @@
1
- const e=require("./ui/dialog.cjs"),t=require("./tanstack-form-BxqS40rB.cjs"),n=require("./ui/select.cjs"),r=require("./field-BSLi-P0Q.cjs");let i=require("lucide-react"),a=require("react"),o=require("@customafk/react-toolkit/utils"),s=require("react/jsx-runtime"),c=require("radix-ui"),l=require("@tanstack/react-form"),u=require("@customafk/react-toolkit/hooks/useMobile");const d=(0,a.memo)(({label:d,description:f,placeholder:p,orientation:m=`responsive`,tooltip:h,options:g,helperText:_,clearable:v=!1,required:y=!1,disabled:b=!1,showErrorMessage:x=!0})=>{let S=(0,a.useId)(),C=t.G(),w=(0,u.useIsMobile)(),[T,E]=(0,a.useState)(!1),D=(0,l.useStore)(C.form.store,({isSubmitting:e})=>e),O=b||D,k=C.state.meta.isDirty||C.state.meta.isTouched,A=k&&!C.state.meta.isValid,j=y&&C.state.value===null,M=v&&!!C.state.value&&!O,N=g.find(e=>e.value===C.state.value)?.label,P=()=>{C.handleChange(null),C.handleBlur()};return(0,s.jsxs)(r.FieldGroup,{className:`gap-y-4 px-4`,children:[(0,s.jsxs)(r.Field,{orientation:m,"data-invalid":A,children:[(0,s.jsxs)(r.FieldContent,{children:[(0,s.jsxs)(r.FieldLabel,{htmlFor:C.name,"aria-required":j,children:[d,h&&(0,s.jsx)(r.FieldTooltip,{tooltip:h})]}),(0,s.jsx)(r.FieldDescription,{children:f})]}),(0,s.jsxs)(r.FieldContentMain,{className:`flex flex-col`,children:[w?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(`button`,{id:C.name,type:`button`,disabled:O,"aria-invalid":A?`true`:void 0,"aria-describedby":S,onBlur:C.handleBlur,onClick:()=>E(!0),className:(0,o.cn)(`flex w-full items-center justify-between`,`outline-1 outline-border -outline-offset-1`,`gap-2 rounded bg-transparent px-3 py-2`,`shadow-input transition-all cursor-pointer whitespace-nowrap text-sm`,`focus-visible:outline-primary-strong focus-visible:ring-4 focus-visible:ring-primary-weak`,`disabled:cursor-not-allowed disabled:opacity-50`,A&&`outline-danger bg-danger-bg-subtle ring-danger-weak`,!C.state.value&&`text-text-positive-muted`),children:[(0,s.jsx)(`span`,{className:`line-clamp-1`,children:N??p}),(0,s.jsx)(i.ChevronDownIcon,{size:16,className:`shrink-0 opacity-50`})]}),(0,s.jsx)(e.Dialog,{open:T,onOpenChange:e=>{E(e),e||C.handleBlur()},children:(0,s.jsxs)(e.DialogPortal,{children:[(0,s.jsx)(e.DialogOverlay,{}),(0,s.jsxs)(c.Dialog.Content,{onOpenAutoFocus:e=>e.preventDefault(),className:(0,o.cn)(`fixed inset-x-0 bottom-0 z-50`,`flex flex-col bg-background rounded-t-2xl outline-none`,`max-h-[80dvh] shadow-[0_-4px_24px_rgba(0,0,0,0.08)]`,`data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom data-[state=open]:fade-in-0`,`data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=closed]:fade-out-0`,`duration-300`),children:[(0,s.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-border shrink-0`,children:[(0,s.jsx)(`span`,{className:`font-semibold text-sm text-text-positive`,children:d??p??`Chọn một tùy chọn`}),(0,s.jsx)(e.DialogClose,{asChild:!0,children:(0,s.jsx)(`button`,{type:`button`,"aria-label":`Đóng`,className:`flex size-7 items-center justify-center rounded-md text-text-positive-weak transition-colors hover:bg-muted-muted hover:text-text-positive`,children:(0,s.jsx)(i.XIcon,{size:16})})})]}),(0,s.jsxs)(`div`,{className:`flex flex-col overflow-y-auto`,children:[M&&(0,s.jsx)(e.DialogClose,{asChild:!0,children:(0,s.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-x-2 px-4 py-3 text-left text-sm text-danger-strong transition-colors hover:bg-danger-bg-subtle`,onClick:P,children:[(0,s.jsx)(i.XIcon,{size:14}),`Xóa lựa chọn`]})}),g.length>0?g.map(t=>(0,s.jsx)(e.DialogClose,{asChild:!0,children:(0,s.jsx)(`button`,{type:`button`,className:(0,o.cn)(`flex w-full items-center px-4 py-3 text-left text-sm transition-colors`,`hover:bg-muted-muted active:bg-muted-muted`,C.state.value===t.value&&`bg-primary-bg-subtle font-medium text-primary`),onClick:()=>{C.handleChange(t.value),C.handleBlur()},children:t.label})},t.value)):(0,s.jsxs)(`div`,{className:`flex items-center justify-center gap-x-2 px-4 py-8 text-center text-sm text-text-positive-weak`,children:[(0,s.jsx)(i.PackagePlusIcon,{strokeWidth:1}),`Không có tùy chọn`]})]}),(0,s.jsx)(`div`,{className:`shrink-0 h-safe-bottom`})]})]})})]}):(0,s.jsxs)(`div`,{className:`relative`,children:[(0,s.jsxs)(n.Select,{value:C.state.value??``,disabled:O,onValueChange:C.handleChange,children:[(0,s.jsx)(n.SelectTrigger,{"aria-invalid":A?`true`:void 0,"aria-describedby":S,onBlur:C.handleBlur,children:(0,s.jsx)(n.SelectValue,{placeholder:p})}),(0,s.jsx)(n.SelectContent,{children:g.length>0?g.map(e=>(0,s.jsx)(n.SelectItem,{value:e.value,children:e.label},e.value)):(0,s.jsxs)(`div`,{className:`flex items-center justify-center gap-x-2 rounded border border-border bg-muted-muted px-4 py-6.5 text-center text-sm text-text-positive-weak`,children:[(0,s.jsx)(i.PackagePlusIcon,{strokeWidth:1}),`No options available`]})})]}),M&&(0,s.jsx)(`button`,{type:`button`,"aria-label":`Xóa lựa chọn`,className:`absolute right-7 top-1/2 -translate-y-1/2 flex size-4 cursor-pointer items-center justify-center rounded-md text-text-positive-weak outline-none transition-[color,transform] hover:text-text-positive focus-visible:text-primary-strong focus-visible:[&>svg]:scale-125 [&>svg]:size-3.5 [&>svg]:transition-transform`,onClick:P,children:(0,s.jsx)(i.XIcon,{"aria-hidden":`true`})})]}),k&&x&&(0,s.jsx)(r.FieldError,{id:S,className:`mt-1`,errors:C.state.meta.errors}),(0,s.jsx)(r.FieldNote,{isShow:!!_,children:_})]})]}),(0,s.jsx)(r.FieldSeparator,{})]})});d.displayName=`SelectField`,exports.SelectField=d;
2
- //# sourceMappingURL=select-field-CURv37h4.cjs.map
1
+ const e=require("./ui/dialog.cjs"),t=require("./tanstack-form-C0ab8EEl.cjs"),n=require("./ui/select.cjs"),r=require("./field-BSLi-P0Q.cjs");let i=require("lucide-react"),a=require("react"),o=require("@customafk/react-toolkit/utils"),s=require("react/jsx-runtime"),c=require("radix-ui"),l=require("@tanstack/react-form"),u=require("@customafk/react-toolkit/hooks/useMobile");const d=(0,a.memo)(({label:d,description:f,placeholder:p,orientation:m=`responsive`,tooltip:h,options:g,helperText:_,clearable:v=!1,required:y=!1,disabled:b=!1,showErrorMessage:x=!0})=>{let S=(0,a.useId)(),C=t.G(),w=(0,u.useIsMobile)(),[T,E]=(0,a.useState)(!1),D=(0,l.useStore)(C.form.store,({isSubmitting:e})=>e),O=b||D,k=C.state.meta.isDirty||C.state.meta.isTouched,A=k&&!C.state.meta.isValid,j=y&&C.state.value===null,M=v&&!!C.state.value&&!O,N=g.find(e=>e.value===C.state.value)?.label,P=()=>{C.handleChange(null),C.handleBlur()};return(0,s.jsxs)(r.FieldGroup,{className:`gap-y-4 px-4`,children:[(0,s.jsxs)(r.Field,{orientation:m,"data-invalid":A,children:[(0,s.jsxs)(r.FieldContent,{children:[(0,s.jsxs)(r.FieldLabel,{htmlFor:C.name,"aria-required":j,children:[d,h&&(0,s.jsx)(r.FieldTooltip,{tooltip:h})]}),(0,s.jsx)(r.FieldDescription,{children:f})]}),(0,s.jsxs)(r.FieldContentMain,{className:`flex flex-col`,children:[w?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(`button`,{id:C.name,type:`button`,disabled:O,"aria-invalid":A?`true`:void 0,"aria-describedby":S,onBlur:C.handleBlur,onClick:()=>E(!0),className:(0,o.cn)(`flex w-full items-center justify-between`,`outline-1 outline-border -outline-offset-1`,`gap-2 rounded bg-transparent px-3 py-2`,`shadow-input transition-all cursor-pointer whitespace-nowrap text-sm`,`focus-visible:outline-primary-strong focus-visible:ring-4 focus-visible:ring-primary-weak`,`disabled:cursor-not-allowed disabled:opacity-50`,A&&`outline-danger bg-danger-bg-subtle ring-danger-weak`,!C.state.value&&`text-text-positive-muted`),children:[(0,s.jsx)(`span`,{className:`line-clamp-1`,children:N??p}),(0,s.jsx)(i.ChevronDownIcon,{size:16,className:`shrink-0 opacity-50`})]}),(0,s.jsx)(e.Dialog,{open:T,onOpenChange:e=>{E(e),e||C.handleBlur()},children:(0,s.jsxs)(e.DialogPortal,{children:[(0,s.jsx)(e.DialogOverlay,{}),(0,s.jsxs)(c.Dialog.Content,{onOpenAutoFocus:e=>e.preventDefault(),className:(0,o.cn)(`fixed inset-x-0 bottom-0 z-50`,`flex flex-col bg-background rounded-t-2xl outline-none`,`max-h-[80dvh] shadow-[0_-4px_24px_rgba(0,0,0,0.08)]`,`data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom data-[state=open]:fade-in-0`,`data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=closed]:fade-out-0`,`duration-300`),children:[(0,s.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-border shrink-0`,children:[(0,s.jsx)(`span`,{className:`font-semibold text-sm text-text-positive`,children:d??p??`Chọn một tùy chọn`}),(0,s.jsx)(e.DialogClose,{asChild:!0,children:(0,s.jsx)(`button`,{type:`button`,"aria-label":`Đóng`,className:`flex size-7 items-center justify-center rounded-md text-text-positive-weak transition-colors hover:bg-muted-muted hover:text-text-positive`,children:(0,s.jsx)(i.XIcon,{size:16})})})]}),(0,s.jsxs)(`div`,{className:`flex flex-col overflow-y-auto`,children:[M&&(0,s.jsx)(e.DialogClose,{asChild:!0,children:(0,s.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-x-2 px-4 py-3 text-left text-sm text-danger-strong transition-colors hover:bg-danger-bg-subtle`,onClick:P,children:[(0,s.jsx)(i.XIcon,{size:14}),`Xóa lựa chọn`]})}),g.length>0?g.map(t=>(0,s.jsx)(e.DialogClose,{asChild:!0,children:(0,s.jsx)(`button`,{type:`button`,className:(0,o.cn)(`flex w-full items-center px-4 py-3 text-left text-sm transition-colors`,`hover:bg-muted-muted active:bg-muted-muted`,C.state.value===t.value&&`bg-primary-bg-subtle font-medium text-primary`),onClick:()=>{C.handleChange(t.value),C.handleBlur()},children:t.label})},t.value)):(0,s.jsxs)(`div`,{className:`flex items-center justify-center gap-x-2 px-4 py-8 text-center text-sm text-text-positive-weak`,children:[(0,s.jsx)(i.PackagePlusIcon,{strokeWidth:1}),`Không có tùy chọn`]})]}),(0,s.jsx)(`div`,{className:`shrink-0 h-safe-bottom`})]})]})})]}):(0,s.jsxs)(`div`,{className:`relative`,children:[(0,s.jsxs)(n.Select,{value:C.state.value??``,disabled:O,onValueChange:C.handleChange,children:[(0,s.jsx)(n.SelectTrigger,{"aria-invalid":A?`true`:void 0,"aria-describedby":S,onBlur:C.handleBlur,children:(0,s.jsx)(n.SelectValue,{placeholder:p})}),(0,s.jsx)(n.SelectContent,{children:g.length>0?g.map(e=>(0,s.jsx)(n.SelectItem,{value:e.value,children:e.label},e.value)):(0,s.jsxs)(`div`,{className:`flex items-center justify-center gap-x-2 rounded border border-border bg-muted-muted px-4 py-6.5 text-center text-sm text-text-positive-weak`,children:[(0,s.jsx)(i.PackagePlusIcon,{strokeWidth:1}),`No options available`]})})]}),M&&(0,s.jsx)(`button`,{type:`button`,"aria-label":`Xóa lựa chọn`,className:`absolute right-7 top-1/2 -translate-y-1/2 flex size-4 cursor-pointer items-center justify-center rounded-md text-text-positive-weak outline-none transition-[color,transform] hover:text-text-positive focus-visible:text-primary-strong focus-visible:[&>svg]:scale-125 [&>svg]:size-3.5 [&>svg]:transition-transform`,onClick:P,children:(0,s.jsx)(i.XIcon,{"aria-hidden":`true`})})]}),k&&x&&(0,s.jsx)(r.FieldError,{id:S,className:`mt-1`,errors:C.state.meta.errors}),(0,s.jsx)(r.FieldNote,{isShow:!!_,children:_})]})]}),(0,s.jsx)(r.FieldSeparator,{})]})});d.displayName=`SelectField`,exports.SelectField=d;
2
+ //# sourceMappingURL=select-field-CvDBZQTl.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"select-field-CURv37h4.cjs","names":["useTanStackFieldContext","FieldGroup","Field","FieldContent","FieldLabel","FieldTooltip","FieldDescription","FieldContentMain","ChevronDownIcon","Dialog","DialogPortal","DialogOverlay","RadixDialog","DialogClose","XIcon","PackagePlusIcon","Select","SelectTrigger","SelectValue","SelectContent","SelectItem","FieldError","FieldNote","FieldSeparator"],"sources":["../packages/components/features/tanstack-form/components/fields/select-field.tsx"],"sourcesContent":["'use client';\n\nimport { memo, useId, useState } from 'react';\n\nimport { useStore } from '@tanstack/react-form';\n\nimport { ChevronDownIcon, PackagePlusIcon, XIcon } from 'lucide-react';\n\nimport { useIsMobile } from '@customafk/react-toolkit/hooks/useMobile';\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Dialog as RadixDialog } from 'radix-ui';\n\nimport { Dialog, DialogClose, DialogOverlay, DialogPortal } from '@/components/ui/dialog';\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';\n\nimport { useTanStackFieldContext } from '../form-context';\nimport {\n Field,\n FieldContent,\n FieldContentMain,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLabel,\n FieldNote,\n FieldSeparator,\n FieldTooltip,\n} from '../ui/field';\n\nimport type { SelectFieldProps as Props } from '../../types';\n\nexport const SelectField = memo<Props>(\n ({\n label,\n description,\n placeholder,\n orientation = 'responsive',\n tooltip,\n options,\n helperText,\n clearable = false,\n required = false,\n disabled = false,\n showErrorMessage = true,\n }) => {\n const errorId = useId();\n const field = useTanStackFieldContext<string | null>();\n const isMobile = useIsMobile();\n const [dialogOpen, setDialogOpen] = useState(false);\n\n const isSubmitting = useStore(field.form.store, ({ isSubmitting }) => isSubmitting);\n const isDisabled = disabled || isSubmitting;\n\n const _touched = field.state.meta.isDirty || field.state.meta.isTouched;\n const _invalid = _touched && !field.state.meta.isValid;\n const _isEmpty = required && field.state.value === null;\n const _showClear = clearable && !!field.state.value && !isDisabled;\n\n const selectedLabel = options.find(o => o.value === field.state.value)?.label;\n\n const onClear = () => {\n field.handleChange(null);\n field.handleBlur();\n };\n\n return (\n <FieldGroup className=\"gap-y-4 px-4\">\n <Field orientation={orientation} data-invalid={_invalid}>\n <FieldContent>\n <FieldLabel htmlFor={field.name} aria-required={_isEmpty}>\n {label}\n {tooltip && <FieldTooltip tooltip={tooltip} />}\n </FieldLabel>\n <FieldDescription>{description}</FieldDescription>\n </FieldContent>\n\n <FieldContentMain className=\"flex flex-col\">\n {isMobile ? (\n <>\n <button\n id={field.name}\n type=\"button\"\n disabled={isDisabled}\n aria-invalid={_invalid ? 'true' : undefined}\n aria-describedby={errorId}\n onBlur={field.handleBlur}\n onClick={() => setDialogOpen(true)}\n className={cn(\n 'flex w-full items-center justify-between',\n 'outline-1 outline-border -outline-offset-1',\n 'gap-2 rounded bg-transparent px-3 py-2',\n 'shadow-input transition-all cursor-pointer whitespace-nowrap text-sm',\n 'focus-visible:outline-primary-strong focus-visible:ring-4 focus-visible:ring-primary-weak',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n _invalid && 'outline-danger bg-danger-bg-subtle ring-danger-weak',\n !field.state.value && 'text-text-positive-muted'\n )}\n >\n <span className=\"line-clamp-1\">{selectedLabel ?? placeholder}</span>\n <ChevronDownIcon size={16} className=\"shrink-0 opacity-50\" />\n </button>\n\n <Dialog\n open={dialogOpen}\n onOpenChange={open => {\n setDialogOpen(open);\n if (!open) field.handleBlur();\n }}\n >\n <DialogPortal>\n <DialogOverlay />\n <RadixDialog.Content\n onOpenAutoFocus={e => e.preventDefault()}\n className={cn(\n 'fixed inset-x-0 bottom-0 z-50',\n 'flex flex-col bg-background rounded-t-2xl outline-none',\n 'max-h-[80dvh] shadow-[0_-4px_24px_rgba(0,0,0,0.08)]',\n 'data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom data-[state=open]:fade-in-0',\n 'data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=closed]:fade-out-0',\n 'duration-300'\n )}\n >\n <div className=\"flex items-center justify-between px-4 py-3 border-b border-border shrink-0\">\n <span className=\"font-semibold text-sm text-text-positive\">{label ?? placeholder ?? 'Chọn một tùy chọn'}</span>\n <DialogClose asChild>\n <button\n type=\"button\"\n aria-label=\"Đóng\"\n className=\"flex size-7 items-center justify-center rounded-md text-text-positive-weak transition-colors hover:bg-muted-muted hover:text-text-positive\"\n >\n <XIcon size={16} />\n </button>\n </DialogClose>\n </div>\n\n <div className=\"flex flex-col overflow-y-auto\">\n {_showClear && (\n <DialogClose asChild>\n <button\n type=\"button\"\n 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\"\n onClick={onClear}\n >\n <XIcon size={14} />\n Xóa lựa chọn\n </button>\n </DialogClose>\n )}\n {options.length > 0 ? (\n options.map(option => (\n <DialogClose key={option.value} asChild>\n <button\n type=\"button\"\n className={cn(\n 'flex w-full items-center px-4 py-3 text-left text-sm transition-colors',\n 'hover:bg-muted-muted active:bg-muted-muted',\n field.state.value === option.value && 'bg-primary-bg-subtle font-medium text-primary'\n )}\n onClick={() => {\n field.handleChange(option.value);\n field.handleBlur();\n }}\n >\n {option.label}\n </button>\n </DialogClose>\n ))\n ) : (\n <div className=\"flex items-center justify-center gap-x-2 px-4 py-8 text-center text-sm text-text-positive-weak\">\n <PackagePlusIcon strokeWidth={1} />\n Không có tùy chọn\n </div>\n )}\n </div>\n\n <div className=\"shrink-0 h-safe-bottom\" />\n </RadixDialog.Content>\n </DialogPortal>\n </Dialog>\n </>\n ) : (\n <div className=\"relative\">\n <Select value={field.state.value ?? ''} disabled={isDisabled} onValueChange={field.handleChange}>\n <SelectTrigger aria-invalid={_invalid ? 'true' : undefined} aria-describedby={errorId} onBlur={field.handleBlur}>\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n <SelectContent>\n {options.length > 0 ? (\n options.map(option => (\n <SelectItem key={option.value} value={option.value}>\n {option.label}\n </SelectItem>\n ))\n ) : (\n <div className=\"flex items-center justify-center gap-x-2 rounded border border-border bg-muted-muted px-4 py-6.5 text-center text-sm text-text-positive-weak\">\n <PackagePlusIcon strokeWidth={1} />\n No options available\n </div>\n )}\n </SelectContent>\n </Select>\n\n {_showClear && (\n <button\n type=\"button\"\n aria-label=\"Xóa lựa chọn\"\n className=\"absolute right-7 top-1/2 -translate-y-1/2 flex size-4 cursor-pointer items-center justify-center rounded-md text-text-positive-weak outline-none transition-[color,transform] hover:text-text-positive focus-visible:text-primary-strong focus-visible:[&>svg]:scale-125 [&>svg]:size-3.5 [&>svg]:transition-transform\"\n onClick={onClear}\n >\n <XIcon aria-hidden=\"true\" />\n </button>\n )}\n </div>\n )}\n\n {_touched && showErrorMessage && <FieldError id={errorId} className=\"mt-1\" errors={field.state.meta.errors} />}\n\n <FieldNote isShow={!!helperText}>{helperText}</FieldNote>\n </FieldContentMain>\n </Field>\n <FieldSeparator />\n </FieldGroup>\n );\n }\n);\n\nSelectField.displayName = 'SelectField';\n"],"mappings":"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"}
1
+ {"version":3,"file":"select-field-CvDBZQTl.cjs","names":["useTanStackFieldContext","FieldGroup","Field","FieldContent","FieldLabel","FieldTooltip","FieldDescription","FieldContentMain","ChevronDownIcon","Dialog","DialogPortal","DialogOverlay","RadixDialog","DialogClose","XIcon","PackagePlusIcon","Select","SelectTrigger","SelectValue","SelectContent","SelectItem","FieldError","FieldNote","FieldSeparator"],"sources":["../packages/components/features/tanstack-form/components/fields/select-field.tsx"],"sourcesContent":["'use client';\n\nimport { memo, useId, useState } from 'react';\n\nimport { useStore } from '@tanstack/react-form';\n\nimport { ChevronDownIcon, PackagePlusIcon, XIcon } from 'lucide-react';\n\nimport { useIsMobile } from '@customafk/react-toolkit/hooks/useMobile';\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Dialog as RadixDialog } from 'radix-ui';\n\nimport { Dialog, DialogClose, DialogOverlay, DialogPortal } from '@/components/ui/dialog';\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';\n\nimport { useTanStackFieldContext } from '../form-context';\nimport {\n Field,\n FieldContent,\n FieldContentMain,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLabel,\n FieldNote,\n FieldSeparator,\n FieldTooltip,\n} from '../ui/field';\n\nimport type { SelectFieldProps as Props } from '../../types';\n\nexport const SelectField = memo<Props>(\n ({\n label,\n description,\n placeholder,\n orientation = 'responsive',\n tooltip,\n options,\n helperText,\n clearable = false,\n required = false,\n disabled = false,\n showErrorMessage = true,\n }) => {\n const errorId = useId();\n const field = useTanStackFieldContext<string | null>();\n const isMobile = useIsMobile();\n const [dialogOpen, setDialogOpen] = useState(false);\n\n const isSubmitting = useStore(field.form.store, ({ isSubmitting }) => isSubmitting);\n const isDisabled = disabled || isSubmitting;\n\n const _touched = field.state.meta.isDirty || field.state.meta.isTouched;\n const _invalid = _touched && !field.state.meta.isValid;\n const _isEmpty = required && field.state.value === null;\n const _showClear = clearable && !!field.state.value && !isDisabled;\n\n const selectedLabel = options.find(o => o.value === field.state.value)?.label;\n\n const onClear = () => {\n field.handleChange(null);\n field.handleBlur();\n };\n\n return (\n <FieldGroup className=\"gap-y-4 px-4\">\n <Field orientation={orientation} data-invalid={_invalid}>\n <FieldContent>\n <FieldLabel htmlFor={field.name} aria-required={_isEmpty}>\n {label}\n {tooltip && <FieldTooltip tooltip={tooltip} />}\n </FieldLabel>\n <FieldDescription>{description}</FieldDescription>\n </FieldContent>\n\n <FieldContentMain className=\"flex flex-col\">\n {isMobile ? (\n <>\n <button\n id={field.name}\n type=\"button\"\n disabled={isDisabled}\n aria-invalid={_invalid ? 'true' : undefined}\n aria-describedby={errorId}\n onBlur={field.handleBlur}\n onClick={() => setDialogOpen(true)}\n className={cn(\n 'flex w-full items-center justify-between',\n 'outline-1 outline-border -outline-offset-1',\n 'gap-2 rounded bg-transparent px-3 py-2',\n 'shadow-input transition-all cursor-pointer whitespace-nowrap text-sm',\n 'focus-visible:outline-primary-strong focus-visible:ring-4 focus-visible:ring-primary-weak',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n _invalid && 'outline-danger bg-danger-bg-subtle ring-danger-weak',\n !field.state.value && 'text-text-positive-muted'\n )}\n >\n <span className=\"line-clamp-1\">{selectedLabel ?? placeholder}</span>\n <ChevronDownIcon size={16} className=\"shrink-0 opacity-50\" />\n </button>\n\n <Dialog\n open={dialogOpen}\n onOpenChange={open => {\n setDialogOpen(open);\n if (!open) field.handleBlur();\n }}\n >\n <DialogPortal>\n <DialogOverlay />\n <RadixDialog.Content\n onOpenAutoFocus={e => e.preventDefault()}\n className={cn(\n 'fixed inset-x-0 bottom-0 z-50',\n 'flex flex-col bg-background rounded-t-2xl outline-none',\n 'max-h-[80dvh] shadow-[0_-4px_24px_rgba(0,0,0,0.08)]',\n 'data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom data-[state=open]:fade-in-0',\n 'data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=closed]:fade-out-0',\n 'duration-300'\n )}\n >\n <div className=\"flex items-center justify-between px-4 py-3 border-b border-border shrink-0\">\n <span className=\"font-semibold text-sm text-text-positive\">{label ?? placeholder ?? 'Chọn một tùy chọn'}</span>\n <DialogClose asChild>\n <button\n type=\"button\"\n aria-label=\"Đóng\"\n className=\"flex size-7 items-center justify-center rounded-md text-text-positive-weak transition-colors hover:bg-muted-muted hover:text-text-positive\"\n >\n <XIcon size={16} />\n </button>\n </DialogClose>\n </div>\n\n <div className=\"flex flex-col overflow-y-auto\">\n {_showClear && (\n <DialogClose asChild>\n <button\n type=\"button\"\n 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\"\n onClick={onClear}\n >\n <XIcon size={14} />\n Xóa lựa chọn\n </button>\n </DialogClose>\n )}\n {options.length > 0 ? (\n options.map(option => (\n <DialogClose key={option.value} asChild>\n <button\n type=\"button\"\n className={cn(\n 'flex w-full items-center px-4 py-3 text-left text-sm transition-colors',\n 'hover:bg-muted-muted active:bg-muted-muted',\n field.state.value === option.value && 'bg-primary-bg-subtle font-medium text-primary'\n )}\n onClick={() => {\n field.handleChange(option.value);\n field.handleBlur();\n }}\n >\n {option.label}\n </button>\n </DialogClose>\n ))\n ) : (\n <div className=\"flex items-center justify-center gap-x-2 px-4 py-8 text-center text-sm text-text-positive-weak\">\n <PackagePlusIcon strokeWidth={1} />\n Không có tùy chọn\n </div>\n )}\n </div>\n\n <div className=\"shrink-0 h-safe-bottom\" />\n </RadixDialog.Content>\n </DialogPortal>\n </Dialog>\n </>\n ) : (\n <div className=\"relative\">\n <Select value={field.state.value ?? ''} disabled={isDisabled} onValueChange={field.handleChange}>\n <SelectTrigger aria-invalid={_invalid ? 'true' : undefined} aria-describedby={errorId} onBlur={field.handleBlur}>\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n <SelectContent>\n {options.length > 0 ? (\n options.map(option => (\n <SelectItem key={option.value} value={option.value}>\n {option.label}\n </SelectItem>\n ))\n ) : (\n <div className=\"flex items-center justify-center gap-x-2 rounded border border-border bg-muted-muted px-4 py-6.5 text-center text-sm text-text-positive-weak\">\n <PackagePlusIcon strokeWidth={1} />\n No options available\n </div>\n )}\n </SelectContent>\n </Select>\n\n {_showClear && (\n <button\n type=\"button\"\n aria-label=\"Xóa lựa chọn\"\n className=\"absolute right-7 top-1/2 -translate-y-1/2 flex size-4 cursor-pointer items-center justify-center rounded-md text-text-positive-weak outline-none transition-[color,transform] hover:text-text-positive focus-visible:text-primary-strong focus-visible:[&>svg]:scale-125 [&>svg]:size-3.5 [&>svg]:transition-transform\"\n onClick={onClear}\n >\n <XIcon aria-hidden=\"true\" />\n </button>\n )}\n </div>\n )}\n\n {_touched && showErrorMessage && <FieldError id={errorId} className=\"mt-1\" errors={field.state.meta.errors} />}\n\n <FieldNote isShow={!!helperText}>{helperText}</FieldNote>\n </FieldContentMain>\n </Field>\n <FieldSeparator />\n </FieldGroup>\n );\n }\n);\n\nSelectField.displayName = 'SelectField';\n"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- import{Dialog as e,DialogClose as t,DialogOverlay as n,DialogPortal as r}from"./ui/dialog.mjs";import{G as i}from"./tanstack-form-q9hDCc0Y.mjs";import{Select as a,SelectContent as o,SelectItem as ee,SelectTrigger as s,SelectValue as c}from"./ui/select.mjs";import{Field as l,FieldContent as u,FieldContentMain as d,FieldDescription as f,FieldError as te,FieldGroup as p,FieldLabel as m,FieldNote as h,FieldSeparator as g,FieldTooltip as _}from"./field-V2DoD8qL.mjs";import{ChevronDownIcon as v,PackagePlusIcon as y,XIcon as b}from"lucide-react";import{memo as x,useId as S,useState as C}from"react";import{cn as w}from"@customafk/react-toolkit/utils";import{Fragment as T,jsx as E,jsxs as D}from"react/jsx-runtime";import{Dialog as O}from"radix-ui";import{useStore as k}from"@tanstack/react-form";import{useIsMobile as A}from"@customafk/react-toolkit/hooks/useMobile";const j=x(({label:x,description:j,placeholder:M,orientation:N=`responsive`,tooltip:P,options:F,helperText:I,clearable:L=!1,required:R=!1,disabled:z=!1,showErrorMessage:B=!0})=>{let V=S(),H=i(),U=A(),[W,G]=C(!1),K=k(H.form.store,({isSubmitting:e})=>e),q=z||K,J=H.state.meta.isDirty||H.state.meta.isTouched,Y=J&&!H.state.meta.isValid,X=R&&H.state.value===null,Z=L&&!!H.state.value&&!q,Q=F.find(e=>e.value===H.state.value)?.label,$=()=>{H.handleChange(null),H.handleBlur()};return D(p,{className:`gap-y-4 px-4`,children:[D(l,{orientation:N,"data-invalid":Y,children:[D(u,{children:[D(m,{htmlFor:H.name,"aria-required":X,children:[x,P&&E(_,{tooltip:P})]}),E(f,{children:j})]}),D(d,{className:`flex flex-col`,children:[U?D(T,{children:[D(`button`,{id:H.name,type:`button`,disabled:q,"aria-invalid":Y?`true`:void 0,"aria-describedby":V,onBlur:H.handleBlur,onClick:()=>G(!0),className:w(`flex w-full items-center justify-between`,`outline-1 outline-border -outline-offset-1`,`gap-2 rounded bg-transparent px-3 py-2`,`shadow-input transition-all cursor-pointer whitespace-nowrap text-sm`,`focus-visible:outline-primary-strong focus-visible:ring-4 focus-visible:ring-primary-weak`,`disabled:cursor-not-allowed disabled:opacity-50`,Y&&`outline-danger bg-danger-bg-subtle ring-danger-weak`,!H.state.value&&`text-text-positive-muted`),children:[E(`span`,{className:`line-clamp-1`,children:Q??M}),E(v,{size:16,className:`shrink-0 opacity-50`})]}),E(e,{open:W,onOpenChange:e=>{G(e),e||H.handleBlur()},children:D(r,{children:[E(n,{}),D(O.Content,{onOpenAutoFocus:e=>e.preventDefault(),className:w(`fixed inset-x-0 bottom-0 z-50`,`flex flex-col bg-background rounded-t-2xl outline-none`,`max-h-[80dvh] shadow-[0_-4px_24px_rgba(0,0,0,0.08)]`,`data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom data-[state=open]:fade-in-0`,`data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=closed]:fade-out-0`,`duration-300`),children:[D(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-border shrink-0`,children:[E(`span`,{className:`font-semibold text-sm text-text-positive`,children:x??M??`Chọn một tùy chọn`}),E(t,{asChild:!0,children:E(`button`,{type:`button`,"aria-label":`Đóng`,className:`flex size-7 items-center justify-center rounded-md text-text-positive-weak transition-colors hover:bg-muted-muted hover:text-text-positive`,children:E(b,{size:16})})})]}),D(`div`,{className:`flex flex-col overflow-y-auto`,children:[Z&&E(t,{asChild:!0,children:D(`button`,{type:`button`,className:`flex w-full items-center gap-x-2 px-4 py-3 text-left text-sm text-danger-strong transition-colors hover:bg-danger-bg-subtle`,onClick:$,children:[E(b,{size:14}),`Xóa lựa chọn`]})}),F.length>0?F.map(e=>E(t,{asChild:!0,children:E(`button`,{type:`button`,className:w(`flex w-full items-center px-4 py-3 text-left text-sm transition-colors`,`hover:bg-muted-muted active:bg-muted-muted`,H.state.value===e.value&&`bg-primary-bg-subtle font-medium text-primary`),onClick:()=>{H.handleChange(e.value),H.handleBlur()},children:e.label})},e.value)):D(`div`,{className:`flex items-center justify-center gap-x-2 px-4 py-8 text-center text-sm text-text-positive-weak`,children:[E(y,{strokeWidth:1}),`Không có tùy chọn`]})]}),E(`div`,{className:`shrink-0 h-safe-bottom`})]})]})})]}):D(`div`,{className:`relative`,children:[D(a,{value:H.state.value??``,disabled:q,onValueChange:H.handleChange,children:[E(s,{"aria-invalid":Y?`true`:void 0,"aria-describedby":V,onBlur:H.handleBlur,children:E(c,{placeholder:M})}),E(o,{children:F.length>0?F.map(e=>E(ee,{value:e.value,children:e.label},e.value)):D(`div`,{className:`flex items-center justify-center gap-x-2 rounded border border-border bg-muted-muted px-4 py-6.5 text-center text-sm text-text-positive-weak`,children:[E(y,{strokeWidth:1}),`No options available`]})})]}),Z&&E(`button`,{type:`button`,"aria-label":`Xóa lựa chọn`,className:`absolute right-7 top-1/2 -translate-y-1/2 flex size-4 cursor-pointer items-center justify-center rounded-md text-text-positive-weak outline-none transition-[color,transform] hover:text-text-positive focus-visible:text-primary-strong focus-visible:[&>svg]:scale-125 [&>svg]:size-3.5 [&>svg]:transition-transform`,onClick:$,children:E(b,{"aria-hidden":`true`})})]}),J&&B&&E(te,{id:V,className:`mt-1`,errors:H.state.meta.errors}),E(h,{isShow:!!I,children:I})]})]}),E(g,{})]})});j.displayName=`SelectField`;export{j as SelectField};
2
- //# sourceMappingURL=select-field-BcsFBbNJ.mjs.map
1
+ import{Dialog as e,DialogClose as t,DialogOverlay as n,DialogPortal as r}from"./ui/dialog.mjs";import{G as i}from"./tanstack-form-fkaBh9RO.mjs";import{Select as a,SelectContent as o,SelectItem as ee,SelectTrigger as s,SelectValue as c}from"./ui/select.mjs";import{Field as l,FieldContent as u,FieldContentMain as d,FieldDescription as f,FieldError as te,FieldGroup as p,FieldLabel as m,FieldNote as h,FieldSeparator as g,FieldTooltip as _}from"./field-V2DoD8qL.mjs";import{ChevronDownIcon as v,PackagePlusIcon as y,XIcon as b}from"lucide-react";import{memo as x,useId as S,useState as C}from"react";import{cn as w}from"@customafk/react-toolkit/utils";import{Fragment as T,jsx as E,jsxs as D}from"react/jsx-runtime";import{Dialog as O}from"radix-ui";import{useStore as k}from"@tanstack/react-form";import{useIsMobile as A}from"@customafk/react-toolkit/hooks/useMobile";const j=x(({label:x,description:j,placeholder:M,orientation:N=`responsive`,tooltip:P,options:F,helperText:I,clearable:L=!1,required:R=!1,disabled:z=!1,showErrorMessage:B=!0})=>{let V=S(),H=i(),U=A(),[W,G]=C(!1),K=k(H.form.store,({isSubmitting:e})=>e),q=z||K,J=H.state.meta.isDirty||H.state.meta.isTouched,Y=J&&!H.state.meta.isValid,X=R&&H.state.value===null,Z=L&&!!H.state.value&&!q,Q=F.find(e=>e.value===H.state.value)?.label,$=()=>{H.handleChange(null),H.handleBlur()};return D(p,{className:`gap-y-4 px-4`,children:[D(l,{orientation:N,"data-invalid":Y,children:[D(u,{children:[D(m,{htmlFor:H.name,"aria-required":X,children:[x,P&&E(_,{tooltip:P})]}),E(f,{children:j})]}),D(d,{className:`flex flex-col`,children:[U?D(T,{children:[D(`button`,{id:H.name,type:`button`,disabled:q,"aria-invalid":Y?`true`:void 0,"aria-describedby":V,onBlur:H.handleBlur,onClick:()=>G(!0),className:w(`flex w-full items-center justify-between`,`outline-1 outline-border -outline-offset-1`,`gap-2 rounded bg-transparent px-3 py-2`,`shadow-input transition-all cursor-pointer whitespace-nowrap text-sm`,`focus-visible:outline-primary-strong focus-visible:ring-4 focus-visible:ring-primary-weak`,`disabled:cursor-not-allowed disabled:opacity-50`,Y&&`outline-danger bg-danger-bg-subtle ring-danger-weak`,!H.state.value&&`text-text-positive-muted`),children:[E(`span`,{className:`line-clamp-1`,children:Q??M}),E(v,{size:16,className:`shrink-0 opacity-50`})]}),E(e,{open:W,onOpenChange:e=>{G(e),e||H.handleBlur()},children:D(r,{children:[E(n,{}),D(O.Content,{onOpenAutoFocus:e=>e.preventDefault(),className:w(`fixed inset-x-0 bottom-0 z-50`,`flex flex-col bg-background rounded-t-2xl outline-none`,`max-h-[80dvh] shadow-[0_-4px_24px_rgba(0,0,0,0.08)]`,`data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom data-[state=open]:fade-in-0`,`data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=closed]:fade-out-0`,`duration-300`),children:[D(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-border shrink-0`,children:[E(`span`,{className:`font-semibold text-sm text-text-positive`,children:x??M??`Chọn một tùy chọn`}),E(t,{asChild:!0,children:E(`button`,{type:`button`,"aria-label":`Đóng`,className:`flex size-7 items-center justify-center rounded-md text-text-positive-weak transition-colors hover:bg-muted-muted hover:text-text-positive`,children:E(b,{size:16})})})]}),D(`div`,{className:`flex flex-col overflow-y-auto`,children:[Z&&E(t,{asChild:!0,children:D(`button`,{type:`button`,className:`flex w-full items-center gap-x-2 px-4 py-3 text-left text-sm text-danger-strong transition-colors hover:bg-danger-bg-subtle`,onClick:$,children:[E(b,{size:14}),`Xóa lựa chọn`]})}),F.length>0?F.map(e=>E(t,{asChild:!0,children:E(`button`,{type:`button`,className:w(`flex w-full items-center px-4 py-3 text-left text-sm transition-colors`,`hover:bg-muted-muted active:bg-muted-muted`,H.state.value===e.value&&`bg-primary-bg-subtle font-medium text-primary`),onClick:()=>{H.handleChange(e.value),H.handleBlur()},children:e.label})},e.value)):D(`div`,{className:`flex items-center justify-center gap-x-2 px-4 py-8 text-center text-sm text-text-positive-weak`,children:[E(y,{strokeWidth:1}),`Không có tùy chọn`]})]}),E(`div`,{className:`shrink-0 h-safe-bottom`})]})]})})]}):D(`div`,{className:`relative`,children:[D(a,{value:H.state.value??``,disabled:q,onValueChange:H.handleChange,children:[E(s,{"aria-invalid":Y?`true`:void 0,"aria-describedby":V,onBlur:H.handleBlur,children:E(c,{placeholder:M})}),E(o,{children:F.length>0?F.map(e=>E(ee,{value:e.value,children:e.label},e.value)):D(`div`,{className:`flex items-center justify-center gap-x-2 rounded border border-border bg-muted-muted px-4 py-6.5 text-center text-sm text-text-positive-weak`,children:[E(y,{strokeWidth:1}),`No options available`]})})]}),Z&&E(`button`,{type:`button`,"aria-label":`Xóa lựa chọn`,className:`absolute right-7 top-1/2 -translate-y-1/2 flex size-4 cursor-pointer items-center justify-center rounded-md text-text-positive-weak outline-none transition-[color,transform] hover:text-text-positive focus-visible:text-primary-strong focus-visible:[&>svg]:scale-125 [&>svg]:size-3.5 [&>svg]:transition-transform`,onClick:$,children:E(b,{"aria-hidden":`true`})})]}),J&&B&&E(te,{id:V,className:`mt-1`,errors:H.state.meta.errors}),E(h,{isShow:!!I,children:I})]})]}),E(g,{})]})});j.displayName=`SelectField`;export{j as SelectField};
2
+ //# sourceMappingURL=select-field-NJgDDCO2.mjs.map