@customafk/lunas-ui 0.2.82 → 0.2.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (410) hide show
  1. package/dist/action-submit-BHY2dndL.mjs +2 -0
  2. package/dist/{action-submit-DVNxnW4-.mjs.map → action-submit-BHY2dndL.mjs.map} +1 -1
  3. package/dist/action-submit-tpgKvZ47.cjs +2 -0
  4. package/dist/{action-submit-kYjq-iPD.cjs.map → action-submit-tpgKvZ47.cjs.map} +1 -1
  5. package/dist/actions-form-PByL8_M5.mjs +2 -0
  6. package/dist/{actions-form-DRrkiGzh.mjs.map → actions-form-PByL8_M5.mjs.map} +1 -1
  7. package/dist/actions-form-X46W7FVa.cjs +2 -0
  8. package/dist/{actions-form-CwicJU89.cjs.map → actions-form-X46W7FVa.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/{button-BnoPktln.d.cts → button-BGW-LZ3i.d.cts} +2 -2
  24. package/dist/{button-BnoPktln.d.mts → button-BGW-LZ3i.d.mts} +2 -2
  25. package/dist/{calendar-BkV5hTX2.d.mts → calendar-BNTvKnwd.d.cts} +2 -2
  26. package/dist/{calendar-iDMPT1kI.d.cts → calendar-DbaIaWr0.d.mts} +2 -2
  27. package/dist/{carousel-D7VXWJ3S.d.mts → carousel-Bw-VhPR3.d.mts} +2 -2
  28. package/dist/{carousel-bBvM31sh.d.cts → carousel-DRqMTyKS.d.cts} +2 -2
  29. package/dist/checkbox-field-BG35eKvM.cjs +2 -0
  30. package/dist/{checkbox-field-DBUjQC_4.cjs.map → checkbox-field-BG35eKvM.cjs.map} +1 -1
  31. package/dist/checkbox-field-C-NyMjEm.mjs +2 -0
  32. package/dist/{checkbox-field-BN3Vd9qq.mjs.map → checkbox-field-C-NyMjEm.mjs.map} +1 -1
  33. package/dist/{cms-layout-Ba_5wSnr.mjs → cms-layout-BHLo0_L_.mjs} +2 -2
  34. package/dist/{cms-layout-Ba_5wSnr.mjs.map → cms-layout-BHLo0_L_.mjs.map} +1 -1
  35. package/dist/{cms-layout-DCJhB-GY.cjs → cms-layout-DYEmSqzx.cjs} +2 -2
  36. package/dist/{cms-layout-DCJhB-GY.cjs.map → cms-layout-DYEmSqzx.cjs.map} +1 -1
  37. package/dist/combobox-Bhgo112r.cjs +2 -0
  38. package/dist/{combobox-kp_kPY8o.cjs.map → combobox-Bhgo112r.cjs.map} +1 -1
  39. package/dist/combobox-C0nno01T.mjs +2 -0
  40. package/dist/{combobox-C64Rvd7n.mjs.map → combobox-C0nno01T.mjs.map} +1 -1
  41. package/dist/combobox-field-Cx0A-CD4.mjs +2 -0
  42. package/dist/{combobox-field-Bug1qI5B.mjs.map → combobox-field-Cx0A-CD4.mjs.map} +1 -1
  43. package/dist/combobox-field-ROYquFD8.cjs +2 -0
  44. package/dist/{combobox-field-BE9miJ3D.cjs.map → combobox-field-ROYquFD8.cjs.map} +1 -1
  45. package/dist/{currency-display-B06kc2IG.cjs → currency-display-DefLJLqL.cjs} +2 -2
  46. package/dist/{currency-display-B06kc2IG.cjs.map → currency-display-DefLJLqL.cjs.map} +1 -1
  47. package/dist/{currency-display-7w-ZjVUw.mjs → currency-display-DpbtUluj.mjs} +2 -2
  48. package/dist/{currency-display-7w-ZjVUw.mjs.map → currency-display-DpbtUluj.mjs.map} +1 -1
  49. package/dist/data-display/country.cjs +1 -1
  50. package/dist/data-display/phone-number.cjs +1 -1
  51. package/dist/data-display/phone-number.cjs.map +1 -1
  52. package/dist/data-display/phone-number.d.cts +1 -1
  53. package/dist/data-display/phone-number.d.mts +1 -1
  54. package/dist/data-display/phone-number.mjs +1 -1
  55. package/dist/data-display/phone-number.mjs.map +1 -1
  56. package/dist/{date-display-BO7OY_AC.mjs → date-display-ByvkuSk0.mjs} +2 -2
  57. package/dist/{date-display-BO7OY_AC.mjs.map → date-display-ByvkuSk0.mjs.map} +1 -1
  58. package/dist/{date-display-DHnZr_yf.cjs → date-display-CkPBLlWz.cjs} +2 -2
  59. package/dist/{date-display-DHnZr_yf.cjs.map → date-display-CkPBLlWz.cjs.map} +1 -1
  60. package/dist/date-field-46UtGmEV.cjs +2 -0
  61. package/dist/{date-field-CYoPe74G.cjs.map → date-field-46UtGmEV.cjs.map} +1 -1
  62. package/dist/date-field-zoPch5tC.mjs +2 -0
  63. package/dist/{date-field-D_qpBb-t.mjs.map → date-field-zoPch5tC.mjs.map} +1 -1
  64. package/dist/{description-display-CBfoP3Y2.mjs → description-display-BFTBwDmB.mjs} +2 -2
  65. package/dist/{description-display-CBfoP3Y2.mjs.map → description-display-BFTBwDmB.mjs.map} +1 -1
  66. package/dist/{description-display-Cckihd1s.cjs → description-display-DeEwppdC.cjs} +2 -2
  67. package/dist/{description-display-Cckihd1s.cjs.map → description-display-DeEwppdC.cjs.map} +1 -1
  68. package/dist/descriptions-Bw9GSCjo.mjs +3 -0
  69. package/dist/descriptions-Bw9GSCjo.mjs.map +1 -0
  70. package/dist/descriptions-DUsJjqd2.cjs +3 -0
  71. package/dist/descriptions-DUsJjqd2.cjs.map +1 -0
  72. package/dist/dialog-form-BRV1niqF.mjs +2 -0
  73. package/dist/{dialog-form-CCIcht28.mjs.map → dialog-form-BRV1niqF.mjs.map} +1 -1
  74. package/dist/dialog-form-X9MxC8pq.cjs +2 -0
  75. package/dist/{dialog-form-BTZZwz3T.cjs.map → dialog-form-X9MxC8pq.cjs.map} +1 -1
  76. package/dist/dialogs/detail-dialog/components/sidebar.d.cts +1 -1
  77. package/dist/dialogs/detail-dialog/components/sidebar.d.mts +1 -1
  78. package/dist/{dist-DzA--RwW.cjs → dist-CIdWHwhj.cjs} +2 -2
  79. package/dist/{dist-DzA--RwW.cjs.map → dist-CIdWHwhj.cjs.map} +1 -1
  80. package/dist/{email-display-w-hRYIeL.cjs → email-display-BXw4IbbW.cjs} +2 -2
  81. package/dist/{email-display-w-hRYIeL.cjs.map → email-display-BXw4IbbW.cjs.map} +1 -1
  82. package/dist/{email-display-Bk_furIx.mjs → email-display-qxdrnYmK.mjs} +2 -2
  83. package/dist/{email-display-Bk_furIx.mjs.map → email-display-qxdrnYmK.mjs.map} +1 -1
  84. package/dist/email-field-0UjeYtnM.cjs +2 -0
  85. package/dist/{email-field-DJa7iASY.cjs.map → email-field-0UjeYtnM.cjs.map} +1 -1
  86. package/dist/email-field-CPEVNvn8.mjs +2 -0
  87. package/dist/{email-field-DxSNJ6tf.mjs.map → email-field-CPEVNvn8.mjs.map} +1 -1
  88. package/dist/features/descriptions/index.cjs +1 -2
  89. package/dist/features/descriptions/index.d.cts +2 -2
  90. package/dist/features/descriptions/index.d.mts +2 -2
  91. package/dist/features/descriptions/index.mjs +1 -2
  92. package/dist/features/tables/index.cjs +1 -1
  93. package/dist/features/tables/index.d.cts +1 -1
  94. package/dist/features/tables/index.d.mts +1 -1
  95. package/dist/features/tables/index.mjs +1 -1
  96. package/dist/features/tanstack-form/index.cjs +1 -1
  97. package/dist/features/tanstack-form/index.d.cts +1 -1
  98. package/dist/features/tanstack-form/index.d.mts +1 -1
  99. package/dist/features/tanstack-form/index.mjs +1 -1
  100. package/dist/features/text-editor/index.cjs +1 -1
  101. package/dist/features/text-editor/index.d.cts +1 -1
  102. package/dist/features/text-editor/index.d.mts +1 -1
  103. package/dist/features/text-editor/index.mjs +1 -1
  104. package/dist/{filter-BO7ISTIR.mjs → filter-DM4QLW77.mjs} +2 -2
  105. package/dist/{filter-BO7ISTIR.mjs.map → filter-DM4QLW77.mjs.map} +1 -1
  106. package/dist/{filter-CQ9BD0MV.cjs → filter-DQEjSnOP.cjs} +2 -2
  107. package/dist/{filter-CQ9BD0MV.cjs.map → filter-DQEjSnOP.cjs.map} +1 -1
  108. package/dist/{flex-CrxTaAXE.d.cts → flex-D7IE_cdR.d.cts} +8 -6
  109. package/dist/{flex-CrxTaAXE.d.mts → flex-D7IE_cdR.d.mts} +8 -6
  110. package/dist/group-field-Cs0uWHg0.mjs +2 -0
  111. package/dist/{group-field-gejvx_Td.mjs.map → group-field-Cs0uWHg0.mjs.map} +1 -1
  112. package/dist/group-field-DJXL9sRy.cjs +2 -0
  113. package/dist/{group-field-sVykO2JZ.cjs.map → group-field-DJXL9sRy.cjs.map} +1 -1
  114. package/dist/{index-DvC1inRy.d.cts → index-0HuXxgjQ.d.cts} +13 -10
  115. package/dist/{index-DvC1inRy.d.mts → index-CZ_2KVir.d.mts} +13 -10
  116. package/dist/index-Cp4Db57w.d.cts +598 -0
  117. package/dist/index-CqE3mOHo.d.mts +598 -0
  118. package/dist/{index-DRAyYm8g.d.cts → index-CvFEJoon.d.cts} +12 -3
  119. package/dist/{index-DRAyYm8g.d.mts → index-CvFEJoon.d.mts} +12 -3
  120. package/dist/{index-BPo-Lg3p.d.mts → index-DJY2uC2H.d.mts} +14 -14
  121. package/dist/{index-DaLpXe5l.d.cts → index-UZik7mgS.d.cts} +14 -14
  122. package/dist/index.cjs +1 -1
  123. package/dist/index.d.cts +17 -17
  124. package/dist/index.d.mts +17 -17
  125. package/dist/index.mjs +1 -1
  126. package/dist/{input-DxNK7Wo6.d.cts → input-D73TrUof.d.cts} +2 -2
  127. package/dist/{input-DxNK7Wo6.d.mts → input-D73TrUof.d.mts} +2 -2
  128. package/dist/layouts/cms-layout/index.cjs +1 -1
  129. package/dist/layouts/cms-layout/index.mjs +1 -1
  130. package/dist/layouts/flex.cjs +1 -1
  131. package/dist/layouts/flex.cjs.map +1 -1
  132. package/dist/layouts/flex.d.cts +1 -1
  133. package/dist/layouts/flex.d.mts +1 -1
  134. package/dist/layouts/flex.mjs +1 -1
  135. package/dist/layouts/flex.mjs.map +1 -1
  136. package/dist/layouts/payment-layout/index.cjs +1 -1
  137. package/dist/layouts/payment-layout/index.mjs +1 -1
  138. package/dist/layouts/ui-grid.cjs +1 -1
  139. package/dist/layouts/ui-grid.cjs.map +1 -1
  140. package/dist/layouts/ui-grid.d.cts +1 -1
  141. package/dist/layouts/ui-grid.d.mts +1 -1
  142. package/dist/layouts/ui-grid.mjs +1 -1
  143. package/dist/layouts/ui-grid.mjs.map +1 -1
  144. package/dist/{list-display-DLsm8uAh.mjs → list-display-4tTkV29U.mjs} +2 -2
  145. package/dist/{list-display-DLsm8uAh.mjs.map → list-display-4tTkV29U.mjs.map} +1 -1
  146. package/dist/{list-display-DDeJoneW.cjs → list-display-CJvQ-wwT.cjs} +2 -2
  147. package/dist/{list-display-DDeJoneW.cjs.map → list-display-CJvQ-wwT.cjs.map} +1 -1
  148. package/dist/{name-display-H5HFH1fU.mjs → name-display-BFoDcvt2.mjs} +2 -2
  149. package/dist/{name-display-H5HFH1fU.mjs.map → name-display-BFoDcvt2.mjs.map} +1 -1
  150. package/dist/{name-display-CKnyugrP.cjs → name-display-Br7rcdqi.cjs} +2 -2
  151. package/dist/{name-display-CKnyugrP.cjs.map → name-display-Br7rcdqi.cjs.map} +1 -1
  152. package/dist/number-field-CMskIrWP.cjs +2 -0
  153. package/dist/{number-field-DKZz-27X.cjs.map → number-field-CMskIrWP.cjs.map} +1 -1
  154. package/dist/number-field-DSGwWg7y.mjs +2 -0
  155. package/dist/{number-field-5INgdUUv.mjs.map → number-field-DSGwWg7y.mjs.map} +1 -1
  156. package/dist/{pagination-BRw-yZBY.d.cts → pagination-DDcO-TPf.d.cts} +2 -2
  157. package/dist/{pagination-BlLiOvY9.d.mts → pagination-DWg3Xv34.d.mts} +2 -2
  158. package/dist/{paragraph-CRo5eC7H.d.mts → paragraph--8GcgnQL.d.cts} +3 -3
  159. package/dist/{paragraph-CkCNIsvz.d.cts → paragraph-BOa0VlGX.d.mts} +3 -3
  160. package/dist/password-field-BxJqTPhN.cjs +2 -0
  161. package/dist/{password-field-BuWARi35.cjs.map → password-field-BxJqTPhN.cjs.map} +1 -1
  162. package/dist/password-field-DsmwNZep.mjs +2 -0
  163. package/dist/{password-field-DOIe6wTv.mjs.map → password-field-DsmwNZep.mjs.map} +1 -1
  164. package/dist/{payment-layout-BSl9DYQA.mjs → payment-layout--b7bhmR1.mjs} +2 -2
  165. package/dist/{payment-layout-BSl9DYQA.mjs.map → payment-layout--b7bhmR1.mjs.map} +1 -1
  166. package/dist/payment-layout-C38xIc2X.cjs +2 -0
  167. package/dist/{payment-layout-DDcLanA0.cjs.map → payment-layout-C38xIc2X.cjs.map} +1 -1
  168. package/dist/{permalink-CaCx9fi6.mjs → permalink-BPCF_npZ.mjs} +2 -2
  169. package/dist/{permalink-CaCx9fi6.mjs.map → permalink-BPCF_npZ.mjs.map} +1 -1
  170. package/dist/{permalink-azuGQg2b.cjs → permalink-DCvWlrAT.cjs} +2 -2
  171. package/dist/{permalink-azuGQg2b.cjs.map → permalink-DCvWlrAT.cjs.map} +1 -1
  172. package/dist/phone-CTTjc3mv.mjs +2 -0
  173. package/dist/phone-CTTjc3mv.mjs.map +1 -0
  174. package/dist/phone-CUxXVTg6.cjs +2 -0
  175. package/dist/phone-CUxXVTg6.cjs.map +1 -0
  176. package/dist/{phone-number-D9j5xYDW.d.cts → phone-number-B1bLIt8i.d.cts} +3 -3
  177. package/dist/{phone-number-D9j5xYDW.d.mts → phone-number-B1bLIt8i.d.mts} +3 -3
  178. package/dist/{phone-number-Ba-f4s1Y.mjs → phone-number-DHFLnHWO.mjs} +2 -2
  179. package/dist/{phone-number-Ba-f4s1Y.mjs.map → phone-number-DHFLnHWO.mjs.map} +1 -1
  180. package/dist/{phone-number-BqRhKQdr.cjs → phone-number-YzmDmFBU.cjs} +2 -2
  181. package/dist/{phone-number-BqRhKQdr.cjs.map → phone-number-YzmDmFBU.cjs.map} +1 -1
  182. package/dist/popover-form-BUc5ivCF.mjs +2 -0
  183. package/dist/{popover-form-BsapHJck.mjs.map → popover-form-BUc5ivCF.mjs.map} +1 -1
  184. package/dist/popover-form-CdXVFl0t.cjs +2 -0
  185. package/dist/{popover-form-Bq2GcuZu.cjs.map → popover-form-CdXVFl0t.cjs.map} +1 -1
  186. package/dist/{progress-display-CiYWPOnq.cjs → progress-display-57LT7U37.cjs} +2 -2
  187. package/dist/{progress-display-CiYWPOnq.cjs.map → progress-display-57LT7U37.cjs.map} +1 -1
  188. package/dist/{progress-display-0UsBzt_r.mjs → progress-display-AfoHitiE.mjs} +2 -2
  189. package/dist/{progress-display-0UsBzt_r.mjs.map → progress-display-AfoHitiE.mjs.map} +1 -1
  190. package/dist/radio-group-field-CmCo87tm.mjs +2 -0
  191. package/dist/{radio-group-field-DOJ4jVSr.mjs.map → radio-group-field-CmCo87tm.mjs.map} +1 -1
  192. package/dist/radio-group-field-gHNAwrdr.cjs +2 -0
  193. package/dist/{radio-group-field-kTgtvp1p.cjs.map → radio-group-field-gHNAwrdr.cjs.map} +1 -1
  194. package/dist/{resizable-C3uADYIg.d.cts → resizable-C6JLqxF3.d.cts} +2 -2
  195. package/dist/{resizable-C3uADYIg.d.mts → resizable-C6JLqxF3.d.mts} +2 -2
  196. package/dist/rolldown-runtime-DWNI8pZO.cjs +1 -0
  197. package/dist/{search-input-C8feOKe2.d.cts → search-input-DEvYI6Rm.d.mts} +2 -2
  198. package/dist/{search-input-CoqwakbI.d.mts → search-input-h_3MoMqK.d.cts} +2 -2
  199. package/dist/select-field-8PfksL_U.mjs +2 -0
  200. package/dist/{select-field-BcsFBbNJ.mjs.map → select-field-8PfksL_U.mjs.map} +1 -1
  201. package/dist/select-field-Ce53hZ3J.cjs +2 -0
  202. package/dist/{select-field-CURv37h4.cjs.map → select-field-Ce53hZ3J.cjs.map} +1 -1
  203. package/dist/simple-array-field-BAR4MjDR.cjs +2 -0
  204. package/dist/{simple-array-field-bCUuPMgT.cjs.map → simple-array-field-BAR4MjDR.cjs.map} +1 -1
  205. package/dist/simple-array-field-C0kpO1cq.mjs +2 -0
  206. package/dist/{simple-array-field-wFE_DUOV.mjs.map → simple-array-field-C0kpO1cq.mjs.map} +1 -1
  207. package/dist/simple-boolean-field-36jmOxCR.cjs +2 -0
  208. package/dist/{simple-boolean-field-DRapzNrB.cjs.map → simple-boolean-field-36jmOxCR.cjs.map} +1 -1
  209. package/dist/simple-boolean-field-Bdc4wuUU.mjs +2 -0
  210. package/dist/{simple-boolean-field-GQJyeyVS.mjs.map → simple-boolean-field-Bdc4wuUU.mjs.map} +1 -1
  211. package/dist/simple-combobox-field-BPDtPj1W.cjs +2 -0
  212. package/dist/{simple-combobox-field-Cp5dfQv3.cjs.map → simple-combobox-field-BPDtPj1W.cjs.map} +1 -1
  213. package/dist/simple-combobox-field-CR5Q6Nsd.mjs +2 -0
  214. package/dist/{simple-combobox-field-D6IaMJKl.mjs.map → simple-combobox-field-CR5Q6Nsd.mjs.map} +1 -1
  215. package/dist/simple-date-field-DUPnGa5d.cjs +2 -0
  216. package/dist/{simple-date-field-_PSkIXAt.cjs.map → simple-date-field-DUPnGa5d.cjs.map} +1 -1
  217. package/dist/simple-date-field-DkhG2o7I.mjs +2 -0
  218. package/dist/{simple-date-field-dszQs7Ik.mjs.map → simple-date-field-DkhG2o7I.mjs.map} +1 -1
  219. package/dist/simple-email-field-BTYqiFp8.cjs +2 -0
  220. package/dist/{simple-email-field-DIHwYrhk.cjs.map → simple-email-field-BTYqiFp8.cjs.map} +1 -1
  221. package/dist/simple-email-field-CpxklyKr.mjs +2 -0
  222. package/dist/{simple-email-field-CwyoXqWo.mjs.map → simple-email-field-CpxklyKr.mjs.map} +1 -1
  223. package/dist/simple-number-field-CTFyTMgw.cjs +2 -0
  224. package/dist/{simple-number-field-VdEeaIiC.cjs.map → simple-number-field-CTFyTMgw.cjs.map} +1 -1
  225. package/dist/simple-number-field-DuCvwUG9.mjs +2 -0
  226. package/dist/{simple-number-field-Id1kV5yR.mjs.map → simple-number-field-DuCvwUG9.mjs.map} +1 -1
  227. package/dist/simple-password-field-BaeUvVB1.cjs +2 -0
  228. package/dist/{simple-password-field-7xbVB1H3.cjs.map → simple-password-field-BaeUvVB1.cjs.map} +1 -1
  229. package/dist/simple-password-field-Cu_JvDEE.mjs +2 -0
  230. package/dist/{simple-password-field-DIO9FwQy.mjs.map → simple-password-field-Cu_JvDEE.mjs.map} +1 -1
  231. package/dist/simple-radio-group-field-DiU4eQ_c.cjs +2 -0
  232. package/dist/{simple-radio-group-field-CxVAr6yW.cjs.map → simple-radio-group-field-DiU4eQ_c.cjs.map} +1 -1
  233. package/dist/simple-radio-group-field-RJ_cEsxK.mjs +2 -0
  234. package/dist/{simple-radio-group-field-BmHWRnns.mjs.map → simple-radio-group-field-RJ_cEsxK.mjs.map} +1 -1
  235. package/dist/simple-select-field-B3uEUqvQ.mjs +2 -0
  236. package/dist/{simple-select-field-DfZk0zPa.mjs.map → simple-select-field-B3uEUqvQ.mjs.map} +1 -1
  237. package/dist/simple-select-field-C8vmeHbL.cjs +2 -0
  238. package/dist/{simple-select-field-C9u7Pg9u.cjs.map → simple-select-field-C8vmeHbL.cjs.map} +1 -1
  239. package/dist/simple-text-field-BEoQmd1b.mjs +2 -0
  240. package/dist/{simple-text-field-CT9KFUSK.mjs.map → simple-text-field-BEoQmd1b.mjs.map} +1 -1
  241. package/dist/simple-text-field-zFJt_99J.cjs +2 -0
  242. package/dist/{simple-text-field-BxPjcB4c.cjs.map → simple-text-field-zFJt_99J.cjs.map} +1 -1
  243. package/dist/simple-textarea-field-CzpApMiv.mjs +2 -0
  244. package/dist/{simple-textarea-field-B22rT6zS.mjs.map → simple-textarea-field-CzpApMiv.mjs.map} +1 -1
  245. package/dist/simple-textarea-field-DyQZEDTe.cjs +2 -0
  246. package/dist/{simple-textarea-field-DG9oPtP-.cjs.map → simple-textarea-field-DyQZEDTe.cjs.map} +1 -1
  247. package/dist/{statistic-CE_Jg8SN.cjs → statistic-CXBTEgKI.cjs} +2 -2
  248. package/dist/{statistic-CE_Jg8SN.cjs.map → statistic-CXBTEgKI.cjs.map} +1 -1
  249. package/dist/{statistic-639yMA2d.mjs → statistic-CvgurN5Z.mjs} +2 -2
  250. package/dist/{statistic-639yMA2d.mjs.map → statistic-CvgurN5Z.mjs.map} +1 -1
  251. package/dist/{status-display-BCYpNJmd.mjs → status-display-Caae2aYf.mjs} +2 -2
  252. package/dist/{status-display-BCYpNJmd.mjs.map → status-display-Caae2aYf.mjs.map} +1 -1
  253. package/dist/{status-display-xcCCGpGS.cjs → status-display-EVwkPrm6.cjs} +2 -2
  254. package/dist/{status-display-xcCCGpGS.cjs.map → status-display-EVwkPrm6.cjs.map} +1 -1
  255. package/dist/{summary-bar-C3NAnI3V.mjs → summary-bar-B6B_wmZA.mjs} +2 -2
  256. package/dist/{summary-bar-C3NAnI3V.mjs.map → summary-bar-B6B_wmZA.mjs.map} +1 -1
  257. package/dist/{summary-bar-C08g8bb1.cjs → summary-bar-D36n4fox.cjs} +2 -2
  258. package/dist/{summary-bar-C08g8bb1.cjs.map → summary-bar-D36n4fox.cjs.map} +1 -1
  259. package/dist/switch-field-CsI6eXJu.cjs +2 -0
  260. package/dist/{switch-field-yE4A6EoF.cjs.map → switch-field-CsI6eXJu.cjs.map} +1 -1
  261. package/dist/switch-field-D2SWDM1l.mjs +2 -0
  262. package/dist/{switch-field-Cz4lDf1D.mjs.map → switch-field-D2SWDM1l.mjs.map} +1 -1
  263. package/dist/{tables-Dg3KMBKA.mjs → tables-CuoBQNqx.mjs} +2 -2
  264. package/dist/{tables-Dg3KMBKA.mjs.map → tables-CuoBQNqx.mjs.map} +1 -1
  265. package/dist/{tables-BqZ4Zs6e.cjs → tables-DdLEj1dI.cjs} +2 -2
  266. package/dist/{tables-BqZ4Zs6e.cjs.map → tables-DdLEj1dI.cjs.map} +1 -1
  267. package/dist/tanstack-form-BiOihtxs.cjs +2 -0
  268. package/dist/tanstack-form-BiOihtxs.cjs.map +1 -0
  269. package/dist/tanstack-form-Do6xL2kv.mjs +2 -0
  270. package/dist/tanstack-form-Do6xL2kv.mjs.map +1 -0
  271. package/dist/text-editor-DWZf3yrW.cjs +2 -0
  272. package/dist/text-editor-DWZf3yrW.cjs.map +1 -0
  273. package/dist/text-editor-XBOAwJk-.mjs +2 -0
  274. package/dist/text-editor-XBOAwJk-.mjs.map +1 -0
  275. package/dist/text-field-D9CYYDKM.cjs +2 -0
  276. package/dist/{text-field-BQovKYN-.cjs.map → text-field-D9CYYDKM.cjs.map} +1 -1
  277. package/dist/text-field-wes_PQEd.mjs +2 -0
  278. package/dist/{text-field-B3xlvEUN.mjs.map → text-field-wes_PQEd.mjs.map} +1 -1
  279. package/dist/textarea-field-BiNmDHgL.mjs +2 -0
  280. package/dist/{textarea-field-u2UUwtr_.mjs.map → textarea-field-BiNmDHgL.mjs.map} +1 -1
  281. package/dist/textarea-field-CRf0M2Eb.cjs +2 -0
  282. package/dist/{textarea-field-B38SnNv4.cjs.map → textarea-field-CRf0M2Eb.cjs.map} +1 -1
  283. package/dist/title-field-B9LLoqIi.cjs +2 -0
  284. package/dist/{title-field-B2hM3S_S.cjs.map → title-field-B9LLoqIi.cjs.map} +1 -1
  285. package/dist/title-field-C4BmSDR2.mjs +2 -0
  286. package/dist/{title-field-oAqHRw59.mjs.map → title-field-C4BmSDR2.mjs.map} +1 -1
  287. package/dist/{tooltip-BVzKgxrZ.cjs → tooltip-CUyGXE9e.cjs} +3 -3
  288. package/dist/{tooltip-BVzKgxrZ.cjs.map → tooltip-CUyGXE9e.cjs.map} +1 -1
  289. package/dist/{tooltip-D7U_Nl5c.mjs → tooltip-DSxSeIak.mjs} +3 -3
  290. package/dist/{tooltip-D7U_Nl5c.mjs.map → tooltip-DSxSeIak.mjs.map} +1 -1
  291. package/dist/typography/paragraph.d.cts +1 -1
  292. package/dist/typography/paragraph.d.mts +1 -1
  293. package/dist/ui/badge.cjs +1 -1
  294. package/dist/ui/badge.cjs.map +1 -1
  295. package/dist/ui/badge.d.cts +2 -2
  296. package/dist/ui/badge.d.mts +2 -2
  297. package/dist/ui/badge.mjs +1 -1
  298. package/dist/ui/badge.mjs.map +1 -1
  299. package/dist/ui/breadcrumb.cjs +1 -1
  300. package/dist/ui/button-group.cjs +1 -1
  301. package/dist/ui/button.cjs +1 -1
  302. package/dist/ui/button.d.cts +1 -1
  303. package/dist/ui/button.d.mts +1 -1
  304. package/dist/ui/calendar.d.cts +1 -1
  305. package/dist/ui/calendar.d.mts +1 -1
  306. package/dist/ui/carousel.cjs +1 -1
  307. package/dist/ui/carousel.d.cts +1 -1
  308. package/dist/ui/carousel.d.mts +1 -1
  309. package/dist/ui/combobox.cjs +1 -1
  310. package/dist/ui/combobox.mjs +1 -1
  311. package/dist/ui/dropdown-menu.cjs +1 -1
  312. package/dist/ui/dropdown-menu.cjs.map +1 -1
  313. package/dist/ui/dropdown-menu.mjs +1 -1
  314. package/dist/ui/dropdown-menu.mjs.map +1 -1
  315. package/dist/ui/file-uploader.cjs +1 -1
  316. package/dist/ui/input.d.cts +1 -1
  317. package/dist/ui/input.d.mts +1 -1
  318. package/dist/ui/inputs/search-input.d.cts +1 -1
  319. package/dist/ui/inputs/search-input.d.mts +1 -1
  320. package/dist/ui/item.cjs +1 -1
  321. package/dist/ui/pagination.d.cts +1 -1
  322. package/dist/ui/pagination.d.mts +1 -1
  323. package/dist/ui/resizable.cjs +1 -1
  324. package/dist/ui/resizable.d.cts +1 -1
  325. package/dist/ui/resizable.d.mts +1 -1
  326. package/dist/{ui-grid-CzL5J7cm.d.cts → ui-grid-D1-Ponqs.d.cts} +5 -5
  327. package/dist/{ui-grid-CzL5J7cm.d.mts → ui-grid-D1-Ponqs.d.mts} +5 -5
  328. package/package.json +8 -4
  329. package/styles/text-editor.css +205 -38
  330. package/ai-docs.md +0 -419
  331. package/dist/action-submit-DVNxnW4-.mjs +0 -2
  332. package/dist/action-submit-kYjq-iPD.cjs +0 -2
  333. package/dist/actions-form-CwicJU89.cjs +0 -2
  334. package/dist/actions-form-DRrkiGzh.mjs +0 -2
  335. package/dist/checkbox-field-BN3Vd9qq.mjs +0 -2
  336. package/dist/checkbox-field-DBUjQC_4.cjs +0 -2
  337. package/dist/combobox-C64Rvd7n.mjs +0 -2
  338. package/dist/combobox-field-BE9miJ3D.cjs +0 -2
  339. package/dist/combobox-field-Bug1qI5B.mjs +0 -2
  340. package/dist/combobox-kp_kPY8o.cjs +0 -2
  341. package/dist/date-field-CYoPe74G.cjs +0 -2
  342. package/dist/date-field-D_qpBb-t.mjs +0 -2
  343. package/dist/dialog-form-BTZZwz3T.cjs +0 -2
  344. package/dist/dialog-form-CCIcht28.mjs +0 -2
  345. package/dist/email-field-DJa7iASY.cjs +0 -2
  346. package/dist/email-field-DxSNJ6tf.mjs +0 -2
  347. package/dist/features/descriptions/index.cjs.map +0 -1
  348. package/dist/features/descriptions/index.mjs.map +0 -1
  349. package/dist/field-BSLi-P0Q.cjs +0 -2
  350. package/dist/field-BSLi-P0Q.cjs.map +0 -1
  351. package/dist/field-V2DoD8qL.mjs +0 -2
  352. package/dist/field-V2DoD8qL.mjs.map +0 -1
  353. package/dist/group-field-gejvx_Td.mjs +0 -2
  354. package/dist/group-field-sVykO2JZ.cjs +0 -2
  355. package/dist/index-BMuVmm7f.d.mts +0 -236
  356. package/dist/index-CLx89ATZ.d.cts +0 -236
  357. package/dist/number-field-5INgdUUv.mjs +0 -2
  358. package/dist/number-field-DKZz-27X.cjs +0 -2
  359. package/dist/password-field-BuWARi35.cjs +0 -2
  360. package/dist/password-field-DOIe6wTv.mjs +0 -2
  361. package/dist/payment-layout-DDcLanA0.cjs +0 -2
  362. package/dist/popover-form-Bq2GcuZu.cjs +0 -2
  363. package/dist/popover-form-BsapHJck.mjs +0 -2
  364. package/dist/radio-group-field-DOJ4jVSr.mjs +0 -2
  365. package/dist/radio-group-field-kTgtvp1p.cjs +0 -2
  366. package/dist/rolldown-runtime-CMqjfN_6.cjs +0 -1
  367. package/dist/select-field-BcsFBbNJ.mjs +0 -2
  368. package/dist/select-field-CURv37h4.cjs +0 -2
  369. package/dist/simple-array-field-bCUuPMgT.cjs +0 -2
  370. package/dist/simple-array-field-wFE_DUOV.mjs +0 -2
  371. package/dist/simple-boolean-field-DRapzNrB.cjs +0 -2
  372. package/dist/simple-boolean-field-GQJyeyVS.mjs +0 -2
  373. package/dist/simple-combobox-field-Cp5dfQv3.cjs +0 -2
  374. package/dist/simple-combobox-field-D6IaMJKl.mjs +0 -2
  375. package/dist/simple-date-field-_PSkIXAt.cjs +0 -2
  376. package/dist/simple-date-field-dszQs7Ik.mjs +0 -2
  377. package/dist/simple-email-field-CwyoXqWo.mjs +0 -2
  378. package/dist/simple-email-field-DIHwYrhk.cjs +0 -2
  379. package/dist/simple-number-field-Id1kV5yR.mjs +0 -2
  380. package/dist/simple-number-field-VdEeaIiC.cjs +0 -2
  381. package/dist/simple-password-field-7xbVB1H3.cjs +0 -2
  382. package/dist/simple-password-field-DIO9FwQy.mjs +0 -2
  383. package/dist/simple-radio-group-field-BmHWRnns.mjs +0 -2
  384. package/dist/simple-radio-group-field-CxVAr6yW.cjs +0 -2
  385. package/dist/simple-select-field-C9u7Pg9u.cjs +0 -2
  386. package/dist/simple-select-field-DfZk0zPa.mjs +0 -2
  387. package/dist/simple-text-field-BxPjcB4c.cjs +0 -2
  388. package/dist/simple-text-field-CT9KFUSK.mjs +0 -2
  389. package/dist/simple-textarea-field-B22rT6zS.mjs +0 -2
  390. package/dist/simple-textarea-field-DG9oPtP-.cjs +0 -2
  391. package/dist/switch-field-Cz4lDf1D.mjs +0 -2
  392. package/dist/switch-field-yE4A6EoF.cjs +0 -2
  393. package/dist/tanstack-form-BxqS40rB.cjs +0 -2
  394. package/dist/tanstack-form-BxqS40rB.cjs.map +0 -1
  395. package/dist/tanstack-form-q9hDCc0Y.mjs +0 -2
  396. package/dist/tanstack-form-q9hDCc0Y.mjs.map +0 -1
  397. package/dist/text-editor-BtfyZSgR.cjs +0 -2
  398. package/dist/text-editor-BtfyZSgR.cjs.map +0 -1
  399. package/dist/text-editor-CtR27_PR.mjs +0 -2
  400. package/dist/text-editor-CtR27_PR.mjs.map +0 -1
  401. package/dist/text-editor-field-CQ8tnZFw.mjs +0 -2
  402. package/dist/text-editor-field-CQ8tnZFw.mjs.map +0 -1
  403. package/dist/text-editor-field-CxU-KMMn.cjs +0 -2
  404. package/dist/text-editor-field-CxU-KMMn.cjs.map +0 -1
  405. package/dist/text-field-B3xlvEUN.mjs +0 -2
  406. package/dist/text-field-BQovKYN-.cjs +0 -2
  407. package/dist/textarea-field-B38SnNv4.cjs +0 -2
  408. package/dist/textarea-field-u2UUwtr_.mjs +0 -2
  409. package/dist/title-field-B2hM3S_S.cjs +0 -2
  410. package/dist/title-field-oAqHRw59.mjs +0 -2
package/ai-docs.md DELETED
@@ -1,419 +0,0 @@
1
- # @customafk/lunas-ui — AI Reference Documentation
2
-
3
- > Optimized for AI agents (Claude, GitHub Copilot, Cursor, etc.).
4
- > Add a reference to this file in your project's CLAUDE.md or AI context config
5
- > so the assistant always has accurate import paths, prop types, and usage patterns.
6
-
7
- ## Package Identity
8
-
9
- - **Package name:** `@customafk/lunas-ui`
10
- - **Framework:** React 19+ · TypeScript 5+
11
- - **Styling:** TailwindCSS v4 (CSS custom properties — stylesheet import is required)
12
- - **Radix UI:** primitives are wrapped — always import from `@customafk/lunas-ui/*`, never from `@radix-ui/*`
13
-
14
- ---
15
-
16
- ## CRITICAL: Required Stylesheet Imports
17
-
18
- Import these in your root layout **before** any component renders.
19
- Without them all color tokens and base styles will be absent.
20
-
21
- ```tsx
22
- import '@customafk/lunas-ui/styles/base';
23
- import '@customafk/lunas-ui/styles/theme';
24
- // Optional: enhanced typographic defaults
25
- import '@customafk/lunas-ui/styles/typography';
26
- ```
27
-
28
- ---
29
-
30
- ## Import Rules (STRICT)
31
-
32
- ### Rule 1 — Named imports only; never default imports
33
-
34
- ```tsx
35
- // ✅ CORRECT
36
- import { Button } from '@customafk/lunas-ui/ui/button';
37
- import type { ButtonProps } from '@customafk/lunas-ui/ui/button';
38
-
39
- // ❌ WRONG — no default export exists
40
- import Button from '@customafk/lunas-ui/ui/button';
41
- ```
42
-
43
- ### Rule 2 — Use the exact published export paths
44
-
45
- Each component has its own path that matches the `package.json` exports map exactly.
46
-
47
- ```tsx
48
- // ✅ CORRECT
49
- import { Button } from '@customafk/lunas-ui/ui/button';
50
- import { ConfirmDialog } from '@customafk/lunas-ui/dialogs/confirm-dialog';
51
- import { Flex } from '@customafk/lunas-ui/layouts/flex';
52
- import { UserDataDisplay } from '@customafk/lunas-ui/data-display/user';
53
- import { Description } from '@customafk/lunas-ui/features/descriptions';
54
-
55
- // ❌ WRONG — internal source path, not shipped
56
- import { Button } from '@customafk/lunas-ui/packages/components/ui/button';
57
-
58
- // ❌ WRONG — missing category prefix
59
- import { Button } from '@customafk/lunas-ui/button';
60
- ```
61
-
62
- ### Rule 3 — Never import Radix UI primitives directly
63
-
64
- ```tsx
65
- // ❌ WRONG
66
- import { AlertDialog } from '@radix-ui/react-alert-dialog';
67
-
68
- // ✅ CORRECT — use the lunas-ui wrapper
69
- import { AlertDialog } from '@customafk/lunas-ui/ui/alert-dialog';
70
- ```
71
-
72
- ### Rule 4 — Separate type and value imports
73
-
74
- ```tsx
75
- import { Statistic } from '@customafk/lunas-ui/data-display/statistic';
76
- import type { StatisticProps } from '@customafk/lunas-ui/data-display/statistic';
77
- ```
78
-
79
- ---
80
-
81
- ## Component Catalog
82
-
83
- ### UI Primitives — `@customafk/lunas-ui/ui/*`
84
-
85
- | Component(s) | Full import path | Key props |
86
- |---|---|---|
87
- | `Button` | `.../ui/button` | `variant`, `color`, `size`, `isLoading`, `asChild` |
88
- | `Input` | `.../ui/input` | All native `<input>` props |
89
- | `Textarea` | `.../ui/textarea` | All native `<textarea>` props |
90
- | `Label` | `.../ui/label` | `htmlFor` |
91
- | `Checkbox` | `.../ui/checkbox` | `checked`, `onCheckedChange` |
92
- | `Switch` | `.../ui/switch` | `checked`, `onCheckedChange` |
93
- | `RadioGroup` + `RadioGroupItem` | `.../ui/radio-group` | `value`, `onValueChange` |
94
- | `Select` + `SelectTrigger` + `SelectContent` + `SelectItem` + `SelectValue` | `.../ui/select` | Radix composition |
95
- | `MultiSelect` | `.../ui/multi-select` | Multi-value select |
96
- | `Dialog` + sub-components | `.../ui/dialog` | `open`, `onOpenChange` |
97
- | `AlertDialog` + sub-components | `.../ui/alert-dialog` | `open`, `onOpenChange` |
98
- | `Sheet` + `SheetContent` | `.../ui/sheet` | `side`: `left`\|`right`\|`top`\|`bottom` |
99
- | `Drawer` + `DrawerContent` | `.../ui/drawer` | Mobile-first sheet |
100
- | `Popover` + `PopoverContent` + `PopoverTrigger` | `.../ui/popover` | `open`, `onOpenChange` |
101
- | `Tooltip` + `TooltipContent` + `TooltipTrigger` + `TooltipProvider` | `.../ui/tooltip` | Wrap app with `TooltipProvider` |
102
- | `Badge` | `.../ui/badge` | `variant`, `color` |
103
- | `Card` + `CardHeader` + `CardContent` + `CardFooter` + `CardTitle` + `CardDescription` + `CardAction` | `.../ui/card` | Composition |
104
- | `Avatar` + `AvatarImage` + `AvatarFallback` | `.../ui/avatar` | — |
105
- | `Tabs` + `TabsList` + `TabsTrigger` + `TabsContent` | `.../ui/tabs` | `defaultValue`, `value`, `onValueChange` |
106
- | `Table` + `TableHeader` + `TableBody` + `TableRow` + `TableHead` + `TableCell` | `.../ui/table` | Semantic HTML table |
107
- | `Calendar` | `.../ui/calendar` | `mode`, `selected`, `onSelect` |
108
- | `Command` + sub-components | `.../ui/command` | Command palette |
109
- | `Separator` | `.../ui/separator` | `orientation`: `horizontal`\|`vertical` |
110
- | `ScrollArea` | `.../ui/scroll-area` | `className` for fixed height |
111
- | `Skeleton` | `.../ui/skeleton` | `className` for shape |
112
- | `Spinner` | `.../ui/spinner` | `size`, `className` |
113
- | `Progress` | `.../ui/progress` | `value` (0–100) |
114
- | `Slider` | `.../ui/slider` | `value`, `min`, `max`, `step` |
115
- | `Sonner` | `.../ui/sonner` | Toast — use `toast()` from `sonner` package |
116
- | `Pagination` | `.../ui/pagination` | Page navigation |
117
- | `FileUploader` | `.../ui/file-uploader` | `onUpload`, `accept`, `maxSize` |
118
- | `ButtonGroup` | `.../ui/button-group` | Groups buttons |
119
- | `DropdownMenu` + sub-components | `.../ui/dropdown-menu` | — |
120
- | `ContextMenu` | `.../ui/context-menu` | Right-click menu |
121
- | `HoverCard` + sub-components | `.../ui/hover-card` | — |
122
- | `Collapsible` + sub-components | `.../ui/collapsible` | — |
123
- | `Breadcrumb` | `.../ui/breadcrumb` | — |
124
- | `Carousel` + sub-components | `.../ui/carousel` | — |
125
- | `Toggle` | `.../ui/toggle` | — |
126
- | `ToggleGroup` + `ToggleGroupItem` | `.../ui/toggle-group` | — |
127
- | `Resizable` + sub-components | `.../ui/resizable` | — |
128
- | `InputOTP` | `.../ui/input-otp` | OTP / PIN input |
129
- | `Sidebar` | `.../ui/sidebar` | App sidebar shell |
130
-
131
- #### Button — Complete Prop Reference
132
-
133
- ```tsx
134
- interface ButtonProps extends Omit<React.ComponentProps<'button'>, 'color'> {
135
- variant?: 'default' | 'outline' | 'ghost' | 'link' | 'icon' | 'destructive'; // default: 'default'
136
- color?: 'primary' | 'success' | 'danger' | 'warning' | 'muted'; // default: 'primary'
137
- size?: 'sm' | 'default' | 'lg' | 'icon'; // default: 'default'
138
- isLoading?: boolean; // Shows spinner + auto-disables. default: false
139
- asChild?: boolean; // Renders child via Radix Slot. default: false
140
- innerClassName?: string; // Classes on inner flex wrapper
141
- }
142
- ```
143
-
144
- ---
145
-
146
- ### Specialized UI Buttons — `@customafk/lunas-ui/ui/buttons/*`
147
-
148
- | Component | Full import path | Purpose |
149
- |---|---|---|
150
- | `AddNewButton` | `.../ui/buttons/add-new` | Standard "+ Add new" CTA |
151
- | `EditButton` | `.../ui/buttons/edit` | Edit / pencil icon |
152
- | `RefreshButton` | `.../ui/buttons/refresh` | Reload action |
153
- | `TrashButton` | `.../ui/buttons/trash` | Delete action |
154
- | `UploadImageButton` | `.../ui/buttons/upload-image` | Image upload trigger |
155
- | `SearchInput` | `.../ui/inputs/search-input` | Search field with icon |
156
-
157
- ---
158
-
159
- ### Layout Components
160
-
161
- | Component | Full import path | Key Props |
162
- |---|---|---|
163
- | `Flex` | `.../layouts/flex` | `vertical`, `wrap`, `gap`, `justify`, `align`, `padding`, `margin`, `width` |
164
- | `Grid` | `.../layouts/grid` | Children grid container |
165
- | `CmsLayout` | `.../layouts/cms-layout` | App shell with sidebar + header |
166
- | `PaymentLayout` | `.../layouts/payment-layout` | Checkout page layout |
167
-
168
- #### Flex — Complete Prop Reference
169
-
170
- ```tsx
171
- type FlexProps = {
172
- vertical?: boolean; // flex-col when true | flex-row when false (default: false)
173
- wrap?: boolean; // flex-wrap vs flex-nowrap (default: true)
174
- gap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'; // default: 'xs'
175
- justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly' | 'stretch'; // default: 'start'
176
- align?: 'start' | 'center' | 'end' | 'baseline' | 'stretch'; // default: 'center'
177
- padding?: 'none' | 'sm' | 'md' | 'lg' | 'xl'; // default: 'sm'
178
- margin?: 'none' | 'sm' | 'md' | 'lg' | 'xl'; // default: 'none'
179
- width?: 'full' | 'auto' | 'fit' | 'screen' | 'min' | 'max' | null; // default: 'fit'
180
- className?: string;
181
- };
182
- ```
183
-
184
- ---
185
-
186
- ### Typography
187
-
188
- | Component | Full import path | Key Props |
189
- |---|---|---|
190
- | `Title` | `.../typography/title` | `level` (1–6) → `<h1>`–`<h6>` |
191
- | `Paragraph` | `.../typography/paragraph` | `variant`, all `<p>` attrs |
192
-
193
- ---
194
-
195
- ### Data Display — `@customafk/lunas-ui/data-display/*`
196
-
197
- Read-only components for formatted entity fields.
198
-
199
- | Component | Full import path | Key Props |
200
- |---|---|---|
201
- | `UserDataDisplay` | `.../data-display/user` | `uuid`, `username`, `email` |
202
- | `DateDisplay` | `.../data-display/date` | `date` (ISO string or `Date`), `format?`, `showTime?` |
203
- | `DateTooltip` | `.../data-display/date-tooltip` | `date` — relative label + full date on hover |
204
- | `NameDisplay` | `.../data-display/name` | `name` |
205
- | `PhoneNumberDisplay` | `.../data-display/phone-number` | `value` |
206
- | `CountryDisplay` | `.../data-display/country` | `country` (ISO 3166-1 alpha-2) |
207
- | `RoleBadge` | `.../data-display/role-badge` | `status` (role / status string) |
208
- | `Statistic` | `.../data-display/statistic` | `label`, `value`, `trend?` |
209
- | `EmptyDisplay` | `.../data-display/empty` | `label?` |
210
- | `DataList` + `DataListItem` | `.../data-display/data-list` | `DataListItem`: `label` + `value` |
211
-
212
- ---
213
-
214
- ### Dialogs — `@customafk/lunas-ui/dialogs/*`
215
-
216
- All dialogs are **controlled** — manage `open` state in the parent.
217
-
218
- | Component | Full import path | Key Props |
219
- |---|---|---|
220
- | `ConfirmDialog` | `.../dialogs/confirm-dialog` | `open`, `title`, `description`, `onConfirm`, `isLoading`, `submitText`, `cancelText` |
221
- | `LoadingDialog` | `.../dialogs/loading-dialog` | `open`, `onOpenChange` |
222
- | `ErrorDialog` | `.../dialogs/error-dialog` | `open`, `title`, `onOpenChange`, `children` |
223
- | `DetailDialog` | `.../dialogs/detail-dialog` | `open`, `title`, `isLoading?`, `createdAt?`, `sidebar?`, `onOpenChange` |
224
-
225
- #### ConfirmDialog — Complete Prop Reference
226
-
227
- ```tsx
228
- type ConfirmDialogProps = {
229
- open?: boolean;
230
- isLoading?: boolean; // default: false
231
- title: string; // required
232
- description: string; // required
233
- cancelText?: string; // default: 'Cancel'
234
- submitText?: string; // default: 'Confirm'
235
- descriptionClassName?: string;
236
- onOpenChange?: (open: boolean) => void;
237
- onConfirm?: () => Promise<void> | void; // async-safe
238
- };
239
- ```
240
-
241
- ---
242
-
243
- ### Feature Components
244
-
245
- #### Descriptions — `@customafk/lunas-ui/features/descriptions`
246
-
247
- ```tsx
248
- import {
249
- Description, // Outer container (border, shadow, rounded)
250
- DescriptionHeader, // title, description?, extra?, className?
251
- DescriptionSection, // title? — labeled horizontal divider
252
- DescriptionItem, // label, labelColSpan? (default 3/12),
253
- // orientation? ('horizontal'|'vertical'), action?
254
- } from '@customafk/lunas-ui/features/descriptions';
255
- ```
256
-
257
- Also exports typed value cells:
258
- `DescriptionBadge`, `DescriptionDate`, `DescriptionName`, `DescriptionEmpty`,
259
- `DescriptionStatistic`, `DescriptionNumberPhone`, `DescriptionImages`, `DescriptionLongtext`.
260
-
261
- #### Tables — `@customafk/lunas-ui/features/tables`
262
-
263
- TanStack React Table v8 wrapper with column helpers, filter components, and table context provider.
264
-
265
- #### TanStack Form — `@customafk/lunas-ui/features/tanstack-form`
266
-
267
- ```tsx
268
- import {
269
- useTanStackForm, // Form factory hook — call once per form definition
270
- withTanStackForm, // HOC: connect a component to the form context
271
- withTanStackFieldGroup, // HOC: wrap a group of related fields
272
- } from '@customafk/lunas-ui/features/tanstack-form';
273
- // Field components (TextField, ComboboxField, etc.) are registered in the
274
- // factory — use them via the form's .AppField slot, not as direct imports.
275
- ```
276
-
277
- #### Search Modal — `@customafk/lunas-ui/features/search-modal`
278
-
279
- ```tsx
280
- import { SearchModal } from '@customafk/lunas-ui/features/search-modal';
281
- // Self-contained command-palette dialog — no props required.
282
- ```
283
-
284
- ---
285
-
286
- ### Cards
287
-
288
- | Component | Full import path | Key Props |
289
- |---|---|---|
290
- | `SimpleCard` | `.../cards/simple-card` | `title`, `description?`, `action?`, `footer?` |
291
- | `ProductCard` | `.../cards/product-card` | `id`, `name`, `thumbnail`, `price` |
292
- | `GridProductCard` | `.../cards/grid-product-card` | `id`, `name`, `thumbnail`, `price` |
293
-
294
- ### Page Components
295
-
296
- | Component | Full import path | Purpose |
297
- |---|---|---|
298
- | `NotFound` | `.../pages/NotFound` | 404 page |
299
- | `NotAuthorized` | `.../pages/NotAuthorized` | 403 / access denied |
300
- | `FeatureDeveloping` | `.../pages/FeatureDeveloping` | Coming-soon placeholder |
301
- | `FeatureFixing` | `.../pages/FeatureFixing` | Maintenance-mode page |
302
-
303
- ---
304
-
305
- ## Usage Patterns (RAG Examples)
306
-
307
- ### Pattern 1 — Confirm dialog before a destructive mutation
308
-
309
- ```tsx
310
- import { useState } from 'react';
311
- import { Button } from '@customafk/lunas-ui/ui/button';
312
- import { ConfirmDialog } from '@customafk/lunas-ui/dialogs/confirm-dialog';
313
-
314
- export function DeleteUserButton({ userId, onDeleted }: {
315
- userId: string;
316
- onDeleted: () => void;
317
- }) {
318
- const [open, setOpen] = useState(false);
319
- const [isPending, setIsPending] = useState(false);
320
-
321
- const handleConfirm = async () => {
322
- setIsPending(true);
323
- try {
324
- await deleteUser(userId);
325
- setOpen(false);
326
- onDeleted();
327
- } finally {
328
- setIsPending(false);
329
- }
330
- };
331
-
332
- return (
333
- <>
334
- <Button variant="outline" color="danger" onClick={() => setOpen(true)}>
335
- Delete user
336
- </Button>
337
- <ConfirmDialog
338
- open={open}
339
- title="Delete user?"
340
- description="This action is permanent and cannot be undone."
341
- submitText="Yes, delete"
342
- isLoading={isPending}
343
- onOpenChange={setOpen}
344
- onConfirm={handleConfirm}
345
- />
346
- </>
347
- );
348
- }
349
- ```
350
-
351
- ### Pattern 2 — Entity detail panel with Description + Data Display
352
-
353
- ```tsx
354
- import {
355
- Description,
356
- DescriptionHeader,
357
- DescriptionItem,
358
- DescriptionSection,
359
- } from '@customafk/lunas-ui/features/descriptions';
360
- import { UserDataDisplay } from '@customafk/lunas-ui/data-display/user';
361
- import { DateDisplay } from '@customafk/lunas-ui/data-display/date';
362
- import { RoleBadge } from '@customafk/lunas-ui/data-display/role-badge';
363
- import { Statistic } from '@customafk/lunas-ui/data-display/statistic';
364
-
365
- export function OrderDetailPanel({ order }: { order: Order }) {
366
- return (
367
- <Description>
368
- <DescriptionHeader title="Order Details" description={`#${order.id}`} />
369
- <DescriptionSection title="Customer" />
370
- <DescriptionItem label="Account">
371
- <UserDataDisplay uuid={order.customer.id} username={order.customer.name} email={order.customer.email} />
372
- </DescriptionItem>
373
- <DescriptionItem label="Created at">
374
- <DateDisplay date={order.createdAt} showTime />
375
- </DescriptionItem>
376
- <DescriptionSection title="Order" />
377
- <DescriptionItem label="Status">
378
- <RoleBadge status={order.status} />
379
- </DescriptionItem>
380
- <DescriptionItem label="Total">
381
- <Statistic label="VND" value={order.total} />
382
- </DescriptionItem>
383
- </Description>
384
- );
385
- }
386
- ```
387
-
388
- ---
389
-
390
- ## Semantic Color Tokens (TailwindCSS)
391
-
392
- | Token | Usage |
393
- |---|---|
394
- | `text-text-positive` | Primary body text |
395
- | `text-text-positive-weak` | Secondary / muted text |
396
- | `text-text-positive-strong` | Emphasis / heading text |
397
- | `text-text-positive-muted` | Placeholder / disabled text |
398
- | `bg-primary` | Primary brand fill |
399
- | `bg-secondary-muted` | Light gray surface (table headers, label columns) |
400
- | `bg-card` | Card / panel background |
401
- | `border-border` | Default border |
402
- | `border-border-weak` | Subtle border / divider |
403
- | `text-success` | Positive / success value |
404
- | `text-danger` | Error / destructive value |
405
- | `text-warning` | Cautionary value |
406
-
407
- ---
408
-
409
- ## Anti-patterns to Avoid
410
-
411
- | ❌ Don't | ✅ Do instead |
412
- |---|---|
413
- | `import Button from '…/ui/button'` | `import { Button } from '…/ui/button'` |
414
- | `import { Button } from '…/button'` | Include category: `'…/ui/button'` |
415
- | Import from `@radix-ui/*` directly | Use the lunas-ui wrapper |
416
- | Skip stylesheet imports | Always import `styles/base` + `styles/theme` |
417
- | `window.confirm()` for destructive actions | Use `<ConfirmDialog>` |
418
- | `<div className="flex gap-2">` | Use `<Flex gap="sm">` |
419
- | Add `disabled` manually during loading | Use `isLoading` on `<Button>` |
@@ -1,2 +0,0 @@
1
- import{Button as e}from"./ui/button.mjs";import{K as t}from"./tanstack-form-q9hDCc0Y.mjs";import{useCallback as n}from"react";import{cn as r}from"@customafk/react-toolkit/utils";import{jsx as i}from"react/jsx-runtime";const a=({label:a,className:o})=>{let s=t(),c=n(async()=>{await s.handleSubmit({submitAction:`submit`}),s.state.isSubmitSuccessful&&s.reset()},[s]);return i(s.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:n})=>i(e,{type:`button`,size:`md`,disabled:t,isLoading:n,className:r(`min-h-8 min-w-32`,o),onClick:c,children:a??`Xác nhận`})})};export{a as TanStackActionSubmit};
2
- //# sourceMappingURL=action-submit-DVNxnW4-.mjs.map
@@ -1,2 +0,0 @@
1
- const e=require("./ui/button.cjs"),t=require("./tanstack-form-BxqS40rB.cjs");let n=require("react"),r=require("@customafk/react-toolkit/utils"),i=require("react/jsx-runtime");const a=({label:a,className:o})=>{let s=t.K(),c=(0,n.useCallback)(async()=>{await s.handleSubmit({submitAction:`submit`}),s.state.isSubmitSuccessful&&s.reset()},[s]);return(0,i.jsx)(s.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:n})=>(0,i.jsx)(e.Button,{type:`button`,size:`md`,disabled:t,isLoading:n,className:(0,r.cn)(`min-h-8 min-w-32`,o),onClick:c,children:a??`Xác nhận`})})};exports.TanStackActionSubmit=a;
2
- //# sourceMappingURL=action-submit-kYjq-iPD.cjs.map
@@ -1,2 +0,0 @@
1
- const e=require("./ui/button.cjs"),t=require("./tanstack-form-BxqS40rB.cjs");let n=require("lucide-react"),r=require("react/jsx-runtime");const i=({type:i=`create`})=>{let a=t.K();return(0,r.jsxs)(`div`,{className:`flex h-8 items-center justify-between`,children:[(0,r.jsx)(a.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:t})=>(0,r.jsx)(e.Button,{color:`muted`,variant:`outline`,type:`button`,size:`md`,disabled:t,className:`h-full min-w-32`,onClick:()=>a.reset(),children:`Hủy bỏ`})}),i===`create`&&(0,r.jsx)(a.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:i})=>(0,r.jsxs)(e.Button,{type:`submit`,size:`md`,disabled:t,isLoading:i,className:`h-full min-w-32`,onClick:async()=>{await a.handleSubmit({submitAction:`create`}),a.state.isSubmitSuccessful&&a.reset()},children:[(0,r.jsx)(n.PlusIcon,{}),`Thêm mới`]})}),i===`update`&&(0,r.jsx)(a.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:i})=>(0,r.jsxs)(e.Button,{type:`submit`,size:`md`,disabled:t,isLoading:i,className:`h-full min-w-32`,onClick:async()=>{await a.handleSubmit({submitAction:`update`}),a.state.isSubmitSuccessful&&a.reset()},children:[(0,r.jsx)(n.ArrowDownToLine,{}),`Cập nhật`]})})]})};exports.TanStackActionsForm=i;
2
- //# sourceMappingURL=actions-form-CwicJU89.cjs.map
@@ -1,2 +0,0 @@
1
- import{Button as e}from"./ui/button.mjs";import{K as t}from"./tanstack-form-q9hDCc0Y.mjs";import{ArrowDownToLine as n,PlusIcon as r}from"lucide-react";import{jsx as i,jsxs as a}from"react/jsx-runtime";const o=({type:o=`create`})=>{let s=t();return a(`div`,{className:`flex h-8 items-center justify-between`,children:[i(s.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:t})=>i(e,{color:`muted`,variant:`outline`,type:`button`,size:`md`,disabled:t,className:`h-full min-w-32`,onClick:()=>s.reset(),children:`Hủy bỏ`})}),o===`create`&&i(s.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:n})=>a(e,{type:`submit`,size:`md`,disabled:t,isLoading:n,className:`h-full min-w-32`,onClick:async()=>{await s.handleSubmit({submitAction:`create`}),s.state.isSubmitSuccessful&&s.reset()},children:[i(r,{}),`Thêm mới`]})}),o===`update`&&i(s.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:r})=>a(e,{type:`submit`,size:`md`,disabled:t,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await s.handleSubmit({submitAction:`update`}),s.state.isSubmitSuccessful&&s.reset()},children:[i(n,{}),`Cập nhật`]})})]})};export{o as TanStackActionsForm};
2
- //# sourceMappingURL=actions-form-DRrkiGzh.mjs.map
@@ -1,2 +0,0 @@
1
- import{Checkbox as e}from"./ui/checkbox.mjs";import{G as t}from"./tanstack-form-q9hDCc0Y.mjs";import{Field as n,FieldContent as r,FieldContentMain as i,FieldDescription as a,FieldGroup as o,FieldLabel as s,FieldNote as c,FieldSeparator as l,FieldTooltip as u}from"./field-V2DoD8qL.mjs";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{useStore as p}from"@tanstack/react-form";const m=({label:m,description:h,options:g,tooltip:_,helperText:v,orientation:y})=>{let b=t(),x=p(b.form.store,({isSubmitting:e})=>e);return f(o,{className:`gap-y-4 px-4`,children:[f(n,{orientation:y,children:[f(r,{children:[f(s,{children:[m,_&&d(u,{tooltip:_})]}),d(a,{children:h}),d(c,{isShow:!!v,children:v})]}),d(i,{children:d(o,{className:`flex flex-col gap-y-2`,children:g.map(t=>f(n,{orientation:`horizontal`,children:[d(e,{id:`${b.name}-${t.value}`,name:b.name,checked:b.state.value?.includes(t.value)??!1,disabled:x,onCheckedChange:e=>{if(e&&b.state.value!==null)b.pushValue(t.value);else if(e&&b.state.value===null)b.setValue([t.value]);else if(!e&&b.state.value!==null){let e=b.state.value.indexOf(t.value);e>-1&&b.removeValue(e)}else b.setValue(null)}}),d(s,{htmlFor:`${b.name}-${t.value}`,className:`text-text-positive`,children:t.label})]},t.value))})})]}),d(l,{})]})};export{m as CheckboxField};
2
- //# sourceMappingURL=checkbox-field-BN3Vd9qq.mjs.map
@@ -1,2 +0,0 @@
1
- const e=require("./ui/checkbox.cjs"),t=require("./tanstack-form-BxqS40rB.cjs"),n=require("./field-BSLi-P0Q.cjs");let r=require("react/jsx-runtime"),i=require("@tanstack/react-form");const a=({label:a,description:o,options:s,tooltip:c,helperText:l,orientation:u})=>{let d=t.G(),f=(0,i.useStore)(d.form.store,({isSubmitting:e})=>e);return(0,r.jsxs)(n.FieldGroup,{className:`gap-y-4 px-4`,children:[(0,r.jsxs)(n.Field,{orientation:u,children:[(0,r.jsxs)(n.FieldContent,{children:[(0,r.jsxs)(n.FieldLabel,{children:[a,c&&(0,r.jsx)(n.FieldTooltip,{tooltip:c})]}),(0,r.jsx)(n.FieldDescription,{children:o}),(0,r.jsx)(n.FieldNote,{isShow:!!l,children:l})]}),(0,r.jsx)(n.FieldContentMain,{children:(0,r.jsx)(n.FieldGroup,{className:`flex flex-col gap-y-2`,children:s.map(t=>(0,r.jsxs)(n.Field,{orientation:`horizontal`,children:[(0,r.jsx)(e.Checkbox,{id:`${d.name}-${t.value}`,name:d.name,checked:d.state.value?.includes(t.value)??!1,disabled:f,onCheckedChange:e=>{if(e&&d.state.value!==null)d.pushValue(t.value);else if(e&&d.state.value===null)d.setValue([t.value]);else if(!e&&d.state.value!==null){let e=d.state.value.indexOf(t.value);e>-1&&d.removeValue(e)}else d.setValue(null)}}),(0,r.jsx)(n.FieldLabel,{htmlFor:`${d.name}-${t.value}`,className:`text-text-positive`,children:t.label})]},t.value))})})]}),(0,r.jsx)(n.FieldSeparator,{})]})};exports.CheckboxField=a;
2
- //# sourceMappingURL=checkbox-field-DBUjQC_4.cjs.map
@@ -1,2 +0,0 @@
1
- import{Button as e}from"./ui/button.mjs";import{Badge as t}from"./ui/badge.mjs";import{Command as n,CommandGroup as r,CommandItem as i,CommandList as ee}from"./ui/command.mjs";import{Spinner as te}from"./ui/spinner.mjs";import{Popover as ne,PopoverContent as re,PopoverTrigger as ie}from"./ui/popover.mjs";import{inputVariants as ae}from"./ui/input.mjs";import{CheckIcon as oe,ChevronDownIcon as se,PlusIcon as ce,XIcon as a}from"lucide-react";import{forwardRef as o,useCallback as s,useEffect as c,useImperativeHandle as le,useMemo as l,useRef as u,useState as d}from"react";import{cn as f}from"@customafk/react-toolkit/utils";import{cva as ue}from"class-variance-authority";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";import{Command as de,useCommandState as g}from"cmdk";const fe=ue([`relative flex flex-wrap items-center gap-1 rounded border bg-transparent text-sm transition-shadow`,`outline-hidden`,`aria-disabled:cursor-not-allowed aria-disabled:bg-muted-muted aria-disabled:text-text-positive-weak`],{variants:{color:{normal:[`border-border-weak`,`focus-visible:border-primary focus-visible:ring-4 focus-visible:ring-primary-weak`,`data-[state=open]:border-primary data-[state=open]:ring-4 data-[state=open]:ring-primary-weak`].join(` `),danger:[`border-danger bg-danger-bg-subtle`,`focus-visible:border-danger focus-visible:ring-4 focus-visible:ring-danger-weak`,`data-[state=open]:border-danger data-[state=open]:ring-4 data-[state=open]:ring-danger-weak`].join(` `)},size:{sm:`min-h-8 text-xs`,md:`min-h-9 text-sm`,lg:`min-h-10 text-base`}},defaultVariants:{color:`normal`,size:`md`}});function _(e){e.preventDefault(),e.stopPropagation()}function pe(e,t){let[n,r]=d(e);return c(()=>{let n=setTimeout(()=>r(e),t??500);return()=>clearTimeout(n)},[e,t]),n}function v(e,t){if(e.length===0)return{};if(!t)return{"":e};let n={};return e.forEach(e=>{let r=e[t]||``;n[r]||(n[r]=[]),n[r].push(e)}),n}function me(e,t){let n={};for(let[r,i]of Object.entries(e))n[r]=i.filter(e=>!t.has(e.value));return n}function he(e,t){return e.length===t.length&&e.every((e,n)=>e.value===t[n]?.value)}const y=o(({className:e,...t},n)=>g(e=>e.filtered.count===0)?m(`div`,{ref:n,className:f(`p-2.5 pt-1 text-center text-xs`,e),"cmdk-empty":``,role:`presentation`,...t}):null);y.displayName=`ComboboxCommandEmpty`;const b=o(({value:o,defaultValue:ue=[],onChange:g,options:b,defaultOptions:ge=[],onSearch:x,delay:_e,triggerSearchOnFocus:S=!1,groupBy:C,placeholder:w,disabled:T,color:E,size:D=`md`,loadingIndicator:ve,loadingText:ye,emptyIndicator:be,creatable:O=!1,createHint:k,createLabel:A,onCreateOption:j,maxSelected:M=2**53-1,onMaxSelected:N,hideSelectedFromList:P=!1,hideClearAllButton:xe=!1,onClearAll:Se,hideClearQueryButton:Ce=!1,onClearQuery:we,className:Te,badgeClassName:Ee,contentClassName:De,commandProps:F,inputProps:I},Oe)=>{let L=u(null),R=u(0),z=u(!0),[B,V]=d(!1),[H,ke]=d(!1),[Ae,je]=d(ue),[U,Me]=d(v(ge,C)),[W,G]=d(``),K=o??Ae,q=W.trim(),J=pe(W,_e??500),Y=s(e=>{o===void 0&&je(e),g?.(e)},[g,o]);le(Oe,()=>({selectedValue:[...K],input:L.current,focus:()=>{V(!0),L.current?.focus()},reset:()=>Y([]),clearQuery:()=>G(``)}),[K,Y]),c(()=>(z.current=!0,()=>{z.current=!1}),[]),c(()=>{B||G(``)},[B]);let X=l(()=>new Set(K.map(e=>e.value)),[K]),Z=s(e=>{Y(K.filter(t=>t.value!==e.value))},[K,Y]),Ne=s(e=>{if(X.has(e.value)){e.fixed||Z(e);return}if(K.length>=M){N?.(M);return}G(``),Y([...K,e])},[Z,M,N,K,X,Y]);c(()=>{!b||x||Me(e=>he(b,Object.values(e).flat())?e:v(b,C))},[b,C,x]),c(()=>{(async()=>{if(!x||!B||!S&&!J)return;let e=++R.current;ke(!0);let t=await x(J);!z.current||e!==R.current||(Me(v(t,C)),ke(!1))})()},[J,C,B,S,x]);let Pe=l(()=>P?me(U,X):U,[P,U,X]),Q=l(()=>{if(!O||!q||H)return!1;let e=q.toLowerCase(),t=Object.values(U).some(t=>t.some(t=>t.label.toLowerCase()===e)),n=K.some(t=>t.label.toLowerCase()===e);return!t&&!n},[O,q,H,U,K]),Fe=typeof A==`function`?A(q):A??`Create "${q}"`,Ie=typeof k==`function`?k(q):k,$=s(()=>{if(K.length>=M){N?.(M);return}let e=q;G(``),Y([...K,{value:e,label:e}]),j?.(e),V(!1)},[q,M,j,N,K,Y]),Le=s(e=>{let t=L.current;if(t){if((e.key===`Delete`||e.key===`Backspace`)&&t.value===``&&K.length>0){let e=K[K.length-1];e.fixed||Z(e)}e.key===`Enter`&&Q&&(e.preventDefault(),$())}},[$,Z,K,Q]),Re=K.some(e=>!e.fixed);return h(ne,{open:B,onOpenChange:e=>!T&&V(e),children:[m(ie,{asChild:!0,children:h(`div`,{"data-slot":`combobox-trigger`,role:`combobox`,"aria-expanded":B,"aria-haspopup":`listbox`,"aria-disabled":T||void 0,tabIndex:T?-1:0,className:f(fe({color:E,size:D}),K.length!==0&&`p-1`,!T&&`cursor-pointer`,T&&`pointer-events-none`,Te),onKeyDown:e=>{T||(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),V(e=>!e))},children:[K.length===0&&m(`span`,{className:`flex-1 truncate px-3 py-2 text-text-positive-muted`,children:w}),K.map(e=>h(t,{"data-slot":`combobox-chip`,"data-fixed":e.fixed||void 0,variant:`soft`,color:E===`danger`?`danger`:`secondary`,size:D,pill:!1,className:f(`gap-1 text-xs bg-muted-muted font-normal`,T&&`opacity-50`,Ee),children:[e.label,!e.fixed&&!T&&m(`button`,{type:`button`,"data-slot":`combobox-chip-remove`,"aria-label":`Remove ${e.label}`,onMouseDown:_,onClick:t=>{t.stopPropagation(),Z(e)},className:`ms-0.5 -me-0.5 rounded-sm outline-hidden hover:text-text-positive text-text-positive-muted`,children:m(a,{size:12,strokeWidth:2,"aria-hidden":`true`})})]},e.value)),m(se,{size:16,"aria-hidden":`true`,className:f(`ms-auto me-2 shrink-0 text-text-positive-muted transition-transform`,B&&`rotate-180`)})]})}),m(re,{align:`start`,"data-slot":`combobox-content`,className:f(`w-(--radix-popover-trigger-width) p-0`,De),children:h(n,{...F,onKeyDown:e=>{Le(e),F?.onKeyDown?.(e)},"data-slot":`combobox`,className:f(`overflow-visible bg-white`,F?.className),shouldFilter:F?.shouldFilter??!x,children:[!xe&&Re&&h(e,{type:`button`,"data-slot":`combobox-clear-all`,tabIndex:-1,size:`xs`,variant:`ghost`,color:`muted`,className:`w-fit mt-1 font-normal hover:text-text-positive`,onMouseDown:_,onClick:()=>{let e=K.filter(e=>e.fixed);Y(e),Se?.()},children:[m(a,{size:10,strokeWidth:2,"aria-hidden":`true`,className:`size-3!`}),`Clear Selected Input`]}),h(`div`,{"data-slot":`combobox-search`,className:`relative px-2.5 pt-2.5 pb-1 border-t border-t-border`,children:[m(de.Input,{...I,ref:L,"data-slot":`combobox-input`,value:W,onValueChange:e=>{G(e),I?.onValueChange?.(e)},placeholder:w,className:f(ae({size:`sm`}),`pe-8`,I?.className)}),!Ce&&W.length>0&&m(`button`,{type:`button`,"data-slot":`combobox-clear-query`,"aria-label":`Clear search`,onMouseDown:_,onClick:()=>{G(``),we?.(),L.current?.focus()},className:`absolute inset-y-6 inset-e-4 flex items-center justify-center text-text-positive-muted transition-colors hover:text-text-positive`,children:m(a,{size:14,strokeWidth:2,"aria-hidden":`true`})})]}),m(ee,{"data-slot":`combobox-list`,className:`shadow-lg outline-hidden`,onMouseDown:e=>e.preventDefault(),children:H?m(`div`,{"data-slot":`combobox-loading`,className:`flex items-center justify-center gap-2 px-2 py-6 text-sm text-text-positive-muted`,children:ve??h(p,{children:[m(te,{className:`size-4`}),ye]})}):Q?h(`div`,{"data-slot":`combobox-create`,className:`flex flex-col gap-2 p-3`,children:[Ie&&m(`p`,{className:`pe-10 text-text-positive-weak text-xs`,children:Ie}),m(`div`,{className:`flex justify-end`,children:h(e,{type:`button`,"data-slot":`combobox-create-confirm`,"aria-label":Fe,size:`xs`,variant:`outline`,color:`muted`,onMouseDown:_,onClick:$,children:[m(ce,{}),`Thêm mới`]})})]}):h(p,{children:[m(y,{"data-slot":`combobox-empty`,children:m(`div`,{className:`bg-muted-muted size-full min-h-14 flex items-center justify-center`,children:be??`No results found.`})}),m(i,{value:`__combobox-first-item-guard__`,className:`hidden`,"aria-hidden":`true`}),Object.entries(Pe).map(([e,t])=>m(r,{heading:e||void 0,value:e||`__combobox-options__`,children:t.map(e=>{let t=X.has(e.value);return h(i,{value:e.value,keywords:[e.label],disabled:e.disable,"data-picked":t||void 0,onMouseDown:_,onSelect:()=>Ne(e),className:f(`cursor-pointer justify-between`,e.disable&&`cursor-not-allowed opacity-50`,t&&`bg-primary-bg-subtle! text-primary!`),children:[e.label,t&&h(p,{children:[m(oe,{size:14,className:`ms-auto text-primary`,"aria-hidden":`true`}),m(`span`,{className:`sr-only`,children:`, selected`})]})]},e.value)})},e))]})})]})})]})});b.displayName=`Combobox`;export{b as t};
2
- //# sourceMappingURL=combobox-C64Rvd7n.mjs.map
@@ -1,2 +0,0 @@
1
- const e=require("./ui/button.cjs"),t=require("./ui/dialog.cjs"),n=require("./ui/command.cjs"),r=require("./tanstack-form-BxqS40rB.cjs"),i=require("./ui/popover.cjs"),a=require("./field-BSLi-P0Q.cjs");let o=require("lucide-react"),s=require("react"),c=require("@customafk/react-toolkit/utils"),l=require("react/jsx-runtime"),u=require("radix-ui"),d=require("@tanstack/react-form"),f=require("@customafk/react-toolkit/hooks/useMobile");const p=(0,s.memo)(({label:p,description:m,placeholder:h,tooltip:g,helperText:_,orientation:v=`responsive`,options:y,required:b=!1,disabled:x=!1,clearable:S=!1,showErrorMessage:C=!0,modal:w})=>{let T=(0,s.useId)(),E=r.G(),D=(0,f.useIsMobile)(),[O,k]=(0,s.useState)(!1),[A,j]=(0,s.useState)(!1),M=(0,d.useStore)(E.form.store,({isSubmitting:e})=>e),N=x||M,P=E.state.meta.isDirty||E.state.meta.isTouched,F=P&&!E.state.meta.isValid,I=b&&E.state.value===null,L=S&&!!E.state.value&&!N,R=E.state.meta.errors.length>0,z=y.find(({value:e})=>e===E.state.value)?.label,B=()=>{E.handleChange(null),E.handleBlur()},V=t=>(0,l.jsx)(e.Button,{variant:`outline`,color:`muted`,size:`lg`,disabled:N,"aria-invalid":F?!0:void 0,"aria-describedby":T,className:(0,c.cn)(`flex w-full items-center justify-start rounded outline-border`,`hover:bg-transparent`,`focus-visible:outline-1 focus-visible:outline-primary-strong focus-visible:ring-4 focus-visible:ring-primary-weak`,`data-[state=open]:text-text-positive-muted data-[state=open]:outline-1 data-[state=open]:outline-primary-strong data-[state=open]:ring-4 data-[state=open]:ring-primary-weak`,L&&`pr-8`,!E.state.value&&`text-text-positive-muted`,F&&`outline-danger bg-danger-bg-subtle ring-4 ring-danger-weak`),onClick:t,children:z?(0,l.jsx)(`p`,{className:`flex min-w-0 flex-1 items-center gap-2 truncate text-start`,children:z}):(0,l.jsx)(`p`,{className:`flex-1 text-start text-text-positive-muted`,children:h})}),H=e=>(0,l.jsxs)(n.Command,{className:`border-none`,children:[(0,l.jsx)(n.CommandInput,{placeholder:h??`Tìm kiếm…`}),(0,l.jsxs)(n.CommandList,{children:[(0,l.jsx)(n.CommandEmpty,{className:`flex min-h-30 items-center justify-center text-sm text-text-positive-weak`,children:`Không tìm thấy kết quả nào phù hợp.`}),(0,l.jsx)(n.CommandGroup,{className:`max-h-60 overflow-y-auto`,children:y.map(({value:t,label:r})=>(0,l.jsx)(n.CommandItem,{value:r,onSelect:()=>e(t),children:r},t))})]})]});return(0,l.jsxs)(a.FieldGroup,{className:`gap-y-4 px-4`,children:[(0,l.jsxs)(a.Field,{orientation:v,"data-invalid":F,children:[(0,l.jsxs)(a.FieldContent,{children:[(0,l.jsxs)(a.FieldLabel,{"aria-required":I,htmlFor:E.name,children:[p,g&&(0,l.jsx)(a.FieldTooltip,{tooltip:g})]}),(0,l.jsx)(a.FieldDescription,{children:m})]}),(0,l.jsx)(a.FieldContentMain,{className:`flex justify-end`,children:(0,l.jsxs)(`div`,{className:`flex w-full flex-col`,children:[(0,l.jsxs)(`div`,{className:`relative`,children:[D?(0,l.jsxs)(l.Fragment,{children:[V(()=>k(!0)),(0,l.jsx)(t.Dialog,{open:O,onOpenChange:e=>{k(e),e||E.handleBlur()},children:(0,l.jsxs)(t.DialogPortal,{children:[(0,l.jsx)(t.DialogOverlay,{}),(0,l.jsxs)(u.Dialog.Content,{onOpenAutoFocus:e=>e.preventDefault(),className:(0,c.cn)(`fixed inset-x-0 bottom-0 z-50`,`flex flex-col bg-background rounded-t-2xl outline-none`,`max-h-[80dvh] shadow-[0_-4px_24px_rgba(0,0,0,0.08)]`,`data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom data-[state=open]:fade-in-0`,`data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=closed]:fade-out-0`,`duration-300`),children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-border shrink-0`,children:[(0,l.jsx)(`span`,{className:`font-semibold text-sm text-text-positive`,children:p}),(0,l.jsx)(t.DialogClose,{asChild:!0,children:(0,l.jsx)(`button`,{type:`button`,"aria-label":`Đóng`,className:`flex size-7 items-center justify-center rounded-md text-text-positive-weak transition-colors hover:bg-muted-muted hover:text-text-positive`,children:(0,l.jsx)(o.XIcon,{size:16})})})]}),(0,l.jsxs)(`div`,{className:`flex flex-col overflow-y-auto`,children:[L&&(0,l.jsx)(t.DialogClose,{asChild:!0,children:(0,l.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-x-2 px-4 py-3 text-left text-sm text-danger-strong transition-colors hover:bg-danger-bg-subtle`,onClick:B,children:[(0,l.jsx)(o.XIcon,{size:14}),`Xóa lựa chọn`]})}),H(e=>{E.handleChange(e),k(!1),E.handleBlur()})]}),(0,l.jsx)(`div`,{className:`shrink-0 h-safe-bottom`})]})]})})]}):(0,l.jsxs)(i.Popover,{open:A,modal:w,onOpenChange:e=>{j(e),e||E.handleBlur()},children:[(0,l.jsx)(i.PopoverTrigger,{asChild:!0,children:V()}),(0,l.jsx)(i.PopoverContent,{align:`end`,side:`bottom`,className:`flex w-fit rounded p-0`,children:H(e=>{E.handleChange(e),j(!1),E.handleBlur()})})]}),L&&(0,l.jsx)(`button`,{type:`button`,"aria-label":`Xóa lựa chọn`,className:`absolute right-2 top-1/2 -translate-y-1/2 flex size-4 cursor-pointer items-center justify-center rounded-md text-text-positive-weak outline-none transition-[color,transform] hover:text-text-positive focus-visible:text-primary-strong focus-visible:[&>svg]:scale-125 [&>svg]:size-3.5 [&>svg]:transition-transform`,onClick:B,children:(0,l.jsx)(o.XIcon,{"aria-hidden":`true`})})]}),P&&C&&R&&(0,l.jsx)(a.FieldError,{id:T,className:`mt-1`,errors:E.state.meta.errors}),(0,l.jsx)(a.FieldNote,{isShow:!!_,children:_})]})})]}),(0,l.jsx)(a.FieldSeparator,{})]})});p.displayName=`ComboboxField`,exports.ComboboxField=p;
2
- //# sourceMappingURL=combobox-field-BE9miJ3D.cjs.map
@@ -1,2 +0,0 @@
1
- import{Button as e}from"./ui/button.mjs";import{Dialog as t,DialogClose as n,DialogOverlay as ee,DialogPortal as te}from"./ui/dialog.mjs";import{Command as r,CommandEmpty as i,CommandGroup as a,CommandInput as o,CommandItem as s,CommandList as ne}from"./ui/command.mjs";import{G as re}from"./tanstack-form-q9hDCc0Y.mjs";import{Popover as ie,PopoverContent as c,PopoverTrigger as l}from"./ui/popover.mjs";import{Field as u,FieldContent as d,FieldContentMain as f,FieldDescription as p,FieldError as m,FieldGroup as h,FieldLabel as g,FieldNote as ae,FieldSeparator as oe,FieldTooltip as se}from"./field-V2DoD8qL.mjs";import{XIcon as _}from"lucide-react";import{memo as v,useId as y,useState as b}from"react";import{cn as x}from"@customafk/react-toolkit/utils";import{Fragment as S,jsx as C,jsxs as w}from"react/jsx-runtime";import{Dialog as T}from"radix-ui";import{useStore as E}from"@tanstack/react-form";import{useIsMobile as D}from"@customafk/react-toolkit/hooks/useMobile";const O=v(({label:v,description:O,placeholder:k,tooltip:A,helperText:j,orientation:M=`responsive`,options:N,required:P=!1,disabled:ce=!1,clearable:F=!1,showErrorMessage:I=!0,modal:L})=>{let R=y(),z=re(),B=D(),[V,H]=b(!1),[U,W]=b(!1),G=E(z.form.store,({isSubmitting:e})=>e),K=ce||G,q=z.state.meta.isDirty||z.state.meta.isTouched,J=q&&!z.state.meta.isValid,le=P&&z.state.value===null,Y=F&&!!z.state.value&&!K,ue=z.state.meta.errors.length>0,X=N.find(({value:e})=>e===z.state.value)?.label,Z=()=>{z.handleChange(null),z.handleBlur()},Q=t=>C(e,{variant:`outline`,color:`muted`,size:`lg`,disabled:K,"aria-invalid":J?!0:void 0,"aria-describedby":R,className:x(`flex w-full items-center justify-start rounded outline-border`,`hover:bg-transparent`,`focus-visible:outline-1 focus-visible:outline-primary-strong focus-visible:ring-4 focus-visible:ring-primary-weak`,`data-[state=open]:text-text-positive-muted data-[state=open]:outline-1 data-[state=open]:outline-primary-strong data-[state=open]:ring-4 data-[state=open]:ring-primary-weak`,Y&&`pr-8`,!z.state.value&&`text-text-positive-muted`,J&&`outline-danger bg-danger-bg-subtle ring-4 ring-danger-weak`),onClick:t,children:X?C(`p`,{className:`flex min-w-0 flex-1 items-center gap-2 truncate text-start`,children:X}):C(`p`,{className:`flex-1 text-start text-text-positive-muted`,children:k})}),$=e=>w(r,{className:`border-none`,children:[C(o,{placeholder:k??`Tìm kiếm…`}),w(ne,{children:[C(i,{className:`flex min-h-30 items-center justify-center text-sm text-text-positive-weak`,children:`Không tìm thấy kết quả nào phù hợp.`}),C(a,{className:`max-h-60 overflow-y-auto`,children:N.map(({value:t,label:n})=>C(s,{value:n,onSelect:()=>e(t),children:n},t))})]})]});return w(h,{className:`gap-y-4 px-4`,children:[w(u,{orientation:M,"data-invalid":J,children:[w(d,{children:[w(g,{"aria-required":le,htmlFor:z.name,children:[v,A&&C(se,{tooltip:A})]}),C(p,{children:O})]}),C(f,{className:`flex justify-end`,children:w(`div`,{className:`flex w-full flex-col`,children:[w(`div`,{className:`relative`,children:[B?w(S,{children:[Q(()=>H(!0)),C(t,{open:V,onOpenChange:e=>{H(e),e||z.handleBlur()},children:w(te,{children:[C(ee,{}),w(T.Content,{onOpenAutoFocus:e=>e.preventDefault(),className:x(`fixed inset-x-0 bottom-0 z-50`,`flex flex-col bg-background rounded-t-2xl outline-none`,`max-h-[80dvh] shadow-[0_-4px_24px_rgba(0,0,0,0.08)]`,`data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom data-[state=open]:fade-in-0`,`data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=closed]:fade-out-0`,`duration-300`),children:[w(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-border shrink-0`,children:[C(`span`,{className:`font-semibold text-sm text-text-positive`,children:v}),C(n,{asChild:!0,children:C(`button`,{type:`button`,"aria-label":`Đóng`,className:`flex size-7 items-center justify-center rounded-md text-text-positive-weak transition-colors hover:bg-muted-muted hover:text-text-positive`,children:C(_,{size:16})})})]}),w(`div`,{className:`flex flex-col overflow-y-auto`,children:[Y&&C(n,{asChild:!0,children:w(`button`,{type:`button`,className:`flex w-full items-center gap-x-2 px-4 py-3 text-left text-sm text-danger-strong transition-colors hover:bg-danger-bg-subtle`,onClick:Z,children:[C(_,{size:14}),`Xóa lựa chọn`]})}),$(e=>{z.handleChange(e),H(!1),z.handleBlur()})]}),C(`div`,{className:`shrink-0 h-safe-bottom`})]})]})})]}):w(ie,{open:U,modal:L,onOpenChange:e=>{W(e),e||z.handleBlur()},children:[C(l,{asChild:!0,children:Q()}),C(c,{align:`end`,side:`bottom`,className:`flex w-fit rounded p-0`,children:$(e=>{z.handleChange(e),W(!1),z.handleBlur()})})]}),Y&&C(`button`,{type:`button`,"aria-label":`Xóa lựa chọn`,className:`absolute right-2 top-1/2 -translate-y-1/2 flex size-4 cursor-pointer items-center justify-center rounded-md text-text-positive-weak outline-none transition-[color,transform] hover:text-text-positive focus-visible:text-primary-strong focus-visible:[&>svg]:scale-125 [&>svg]:size-3.5 [&>svg]:transition-transform`,onClick:Z,children:C(_,{"aria-hidden":`true`})})]}),q&&I&&ue&&C(m,{id:R,className:`mt-1`,errors:z.state.meta.errors}),C(ae,{isShow:!!j,children:j})]})})]}),C(oe,{})]})});O.displayName=`ComboboxField`;export{O as ComboboxField};
2
- //# sourceMappingURL=combobox-field-Bug1qI5B.mjs.map
@@ -1,2 +0,0 @@
1
- const e=require("./ui/button.cjs"),t=require("./ui/badge.cjs"),n=require("./ui/command.cjs"),r=require("./ui/spinner.cjs"),i=require("./ui/popover.cjs"),ee=require("./ui/input.cjs");let a=require("lucide-react"),o=require("react"),s=require("@customafk/react-toolkit/utils"),c=require("class-variance-authority"),l=require("react/jsx-runtime"),u=require("cmdk");const te=(0,c.cva)([`relative flex flex-wrap items-center gap-1 rounded border bg-transparent text-sm transition-shadow`,`outline-hidden`,`aria-disabled:cursor-not-allowed aria-disabled:bg-muted-muted aria-disabled:text-text-positive-weak`],{variants:{color:{normal:[`border-border-weak`,`focus-visible:border-primary focus-visible:ring-4 focus-visible:ring-primary-weak`,`data-[state=open]:border-primary data-[state=open]:ring-4 data-[state=open]:ring-primary-weak`].join(` `),danger:[`border-danger bg-danger-bg-subtle`,`focus-visible:border-danger focus-visible:ring-4 focus-visible:ring-danger-weak`,`data-[state=open]:border-danger data-[state=open]:ring-4 data-[state=open]:ring-danger-weak`].join(` `)},size:{sm:`min-h-8 text-xs`,md:`min-h-9 text-sm`,lg:`min-h-10 text-base`}},defaultVariants:{color:`normal`,size:`md`}});function d(e){e.preventDefault(),e.stopPropagation()}function ne(e,t){let[n,r]=(0,o.useState)(e);return(0,o.useEffect)(()=>{let n=setTimeout(()=>r(e),t??500);return()=>clearTimeout(n)},[e,t]),n}function f(e,t){if(e.length===0)return{};if(!t)return{"":e};let n={};return e.forEach(e=>{let r=e[t]||``;n[r]||(n[r]=[]),n[r].push(e)}),n}function re(e,t){let n={};for(let[r,i]of Object.entries(e))n[r]=i.filter(e=>!t.has(e.value));return n}function p(e,t){return e.length===t.length&&e.every((e,n)=>e.value===t[n]?.value)}const m=(0,o.forwardRef)(({className:e,...t},n)=>(0,u.useCommandState)(e=>e.filtered.count===0)?(0,l.jsx)(`div`,{ref:n,className:(0,s.cn)(`p-2.5 pt-1 text-center text-xs`,e),"cmdk-empty":``,role:`presentation`,...t}):null);m.displayName=`ComboboxCommandEmpty`;const h=(0,o.forwardRef)(({value:c,defaultValue:h=[],onChange:g,options:_,defaultOptions:ie=[],onSearch:v,delay:ae,triggerSearchOnFocus:y=!1,groupBy:b,placeholder:x,disabled:S,color:C,size:w=`md`,loadingIndicator:oe,loadingText:se,emptyIndicator:ce,creatable:T=!1,createHint:E,createLabel:D,onCreateOption:O,maxSelected:k=2**53-1,onMaxSelected:A,hideSelectedFromList:j=!1,hideClearAllButton:le=!1,onClearAll:ue,hideClearQueryButton:de=!1,onClearQuery:fe,className:pe,badgeClassName:me,contentClassName:he,commandProps:M,inputProps:N},ge)=>{let P=(0,o.useRef)(null),F=(0,o.useRef)(0),I=(0,o.useRef)(!0),[L,R]=(0,o.useState)(!1),[z,B]=(0,o.useState)(!1),[_e,ve]=(0,o.useState)(h),[V,H]=(0,o.useState)(f(ie,b)),[U,W]=(0,o.useState)(``),G=c??_e,K=U.trim(),q=ne(U,ae??500),J=(0,o.useCallback)(e=>{c===void 0&&ve(e),g?.(e)},[g,c]);(0,o.useImperativeHandle)(ge,()=>({selectedValue:[...G],input:P.current,focus:()=>{R(!0),P.current?.focus()},reset:()=>J([]),clearQuery:()=>W(``)}),[G,J]),(0,o.useEffect)(()=>(I.current=!0,()=>{I.current=!1}),[]),(0,o.useEffect)(()=>{L||W(``)},[L]);let Y=(0,o.useMemo)(()=>new Set(G.map(e=>e.value)),[G]),X=(0,o.useCallback)(e=>{J(G.filter(t=>t.value!==e.value))},[G,J]),ye=(0,o.useCallback)(e=>{if(Y.has(e.value)){e.fixed||X(e);return}if(G.length>=k){A?.(k);return}W(``),J([...G,e])},[X,k,A,G,Y,J]);(0,o.useEffect)(()=>{!_||v||H(e=>p(_,Object.values(e).flat())?e:f(_,b))},[_,b,v]),(0,o.useEffect)(()=>{(async()=>{if(!v||!L||!y&&!q)return;let e=++F.current;B(!0);let t=await v(q);!I.current||e!==F.current||(H(f(t,b)),B(!1))})()},[q,b,L,y,v]);let be=(0,o.useMemo)(()=>j?re(V,Y):V,[j,V,Y]),Z=(0,o.useMemo)(()=>{if(!T||!K||z)return!1;let e=K.toLowerCase(),t=Object.values(V).some(t=>t.some(t=>t.label.toLowerCase()===e)),n=G.some(t=>t.label.toLowerCase()===e);return!t&&!n},[T,K,z,V,G]),xe=typeof D==`function`?D(K):D??`Create "${K}"`,Q=typeof E==`function`?E(K):E,$=(0,o.useCallback)(()=>{if(G.length>=k){A?.(k);return}let e=K;W(``),J([...G,{value:e,label:e}]),O?.(e),R(!1)},[K,k,O,A,G,J]),Se=(0,o.useCallback)(e=>{let t=P.current;if(t){if((e.key===`Delete`||e.key===`Backspace`)&&t.value===``&&G.length>0){let e=G[G.length-1];e.fixed||X(e)}e.key===`Enter`&&Z&&(e.preventDefault(),$())}},[$,X,G,Z]),Ce=G.some(e=>!e.fixed);return(0,l.jsxs)(i.Popover,{open:L,onOpenChange:e=>!S&&R(e),children:[(0,l.jsx)(i.PopoverTrigger,{asChild:!0,children:(0,l.jsxs)(`div`,{"data-slot":`combobox-trigger`,role:`combobox`,"aria-expanded":L,"aria-haspopup":`listbox`,"aria-disabled":S||void 0,tabIndex:S?-1:0,className:(0,s.cn)(te({color:C,size:w}),G.length!==0&&`p-1`,!S&&`cursor-pointer`,S&&`pointer-events-none`,pe),onKeyDown:e=>{S||(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),R(e=>!e))},children:[G.length===0&&(0,l.jsx)(`span`,{className:`flex-1 truncate px-3 py-2 text-text-positive-muted`,children:x}),G.map(e=>(0,l.jsxs)(t.Badge,{"data-slot":`combobox-chip`,"data-fixed":e.fixed||void 0,variant:`soft`,color:C===`danger`?`danger`:`secondary`,size:w,pill:!1,className:(0,s.cn)(`gap-1 text-xs bg-muted-muted font-normal`,S&&`opacity-50`,me),children:[e.label,!e.fixed&&!S&&(0,l.jsx)(`button`,{type:`button`,"data-slot":`combobox-chip-remove`,"aria-label":`Remove ${e.label}`,onMouseDown:d,onClick:t=>{t.stopPropagation(),X(e)},className:`ms-0.5 -me-0.5 rounded-sm outline-hidden hover:text-text-positive text-text-positive-muted`,children:(0,l.jsx)(a.XIcon,{size:12,strokeWidth:2,"aria-hidden":`true`})})]},e.value)),(0,l.jsx)(a.ChevronDownIcon,{size:16,"aria-hidden":`true`,className:(0,s.cn)(`ms-auto me-2 shrink-0 text-text-positive-muted transition-transform`,L&&`rotate-180`)})]})}),(0,l.jsx)(i.PopoverContent,{align:`start`,"data-slot":`combobox-content`,className:(0,s.cn)(`w-(--radix-popover-trigger-width) p-0`,he),children:(0,l.jsxs)(n.Command,{...M,onKeyDown:e=>{Se(e),M?.onKeyDown?.(e)},"data-slot":`combobox`,className:(0,s.cn)(`overflow-visible bg-white`,M?.className),shouldFilter:M?.shouldFilter??!v,children:[!le&&Ce&&(0,l.jsxs)(e.Button,{type:`button`,"data-slot":`combobox-clear-all`,tabIndex:-1,size:`xs`,variant:`ghost`,color:`muted`,className:`w-fit mt-1 font-normal hover:text-text-positive`,onMouseDown:d,onClick:()=>{let e=G.filter(e=>e.fixed);J(e),ue?.()},children:[(0,l.jsx)(a.XIcon,{size:10,strokeWidth:2,"aria-hidden":`true`,className:`size-3!`}),`Clear Selected Input`]}),(0,l.jsxs)(`div`,{"data-slot":`combobox-search`,className:`relative px-2.5 pt-2.5 pb-1 border-t border-t-border`,children:[(0,l.jsx)(u.Command.Input,{...N,ref:P,"data-slot":`combobox-input`,value:U,onValueChange:e=>{W(e),N?.onValueChange?.(e)},placeholder:x,className:(0,s.cn)(ee.inputVariants({size:`sm`}),`pe-8`,N?.className)}),!de&&U.length>0&&(0,l.jsx)(`button`,{type:`button`,"data-slot":`combobox-clear-query`,"aria-label":`Clear search`,onMouseDown:d,onClick:()=>{W(``),fe?.(),P.current?.focus()},className:`absolute inset-y-6 inset-e-4 flex items-center justify-center text-text-positive-muted transition-colors hover:text-text-positive`,children:(0,l.jsx)(a.XIcon,{size:14,strokeWidth:2,"aria-hidden":`true`})})]}),(0,l.jsx)(n.CommandList,{"data-slot":`combobox-list`,className:`shadow-lg outline-hidden`,onMouseDown:e=>e.preventDefault(),children:z?(0,l.jsx)(`div`,{"data-slot":`combobox-loading`,className:`flex items-center justify-center gap-2 px-2 py-6 text-sm text-text-positive-muted`,children:oe??(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.Spinner,{className:`size-4`}),se]})}):Z?(0,l.jsxs)(`div`,{"data-slot":`combobox-create`,className:`flex flex-col gap-2 p-3`,children:[Q&&(0,l.jsx)(`p`,{className:`pe-10 text-text-positive-weak text-xs`,children:Q}),(0,l.jsx)(`div`,{className:`flex justify-end`,children:(0,l.jsxs)(e.Button,{type:`button`,"data-slot":`combobox-create-confirm`,"aria-label":xe,size:`xs`,variant:`outline`,color:`muted`,onMouseDown:d,onClick:$,children:[(0,l.jsx)(a.PlusIcon,{}),`Thêm mới`]})})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m,{"data-slot":`combobox-empty`,children:(0,l.jsx)(`div`,{className:`bg-muted-muted size-full min-h-14 flex items-center justify-center`,children:ce??`No results found.`})}),(0,l.jsx)(n.CommandItem,{value:`__combobox-first-item-guard__`,className:`hidden`,"aria-hidden":`true`}),Object.entries(be).map(([e,t])=>(0,l.jsx)(n.CommandGroup,{heading:e||void 0,value:e||`__combobox-options__`,children:t.map(e=>{let t=Y.has(e.value);return(0,l.jsxs)(n.CommandItem,{value:e.value,keywords:[e.label],disabled:e.disable,"data-picked":t||void 0,onMouseDown:d,onSelect:()=>ye(e),className:(0,s.cn)(`cursor-pointer justify-between`,e.disable&&`cursor-not-allowed opacity-50`,t&&`bg-primary-bg-subtle! text-primary!`),children:[e.label,t&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a.CheckIcon,{size:14,className:`ms-auto text-primary`,"aria-hidden":`true`}),(0,l.jsx)(`span`,{className:`sr-only`,children:`, selected`})]})]},e.value)})},e))]})})]})})]})});h.displayName=`Combobox`,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
2
- //# sourceMappingURL=combobox-kp_kPY8o.cjs.map
@@ -1,2 +0,0 @@
1
- const e=require("./ui/button.cjs"),t=require("./tanstack-form-BxqS40rB.cjs"),n=require("./ui/popover.cjs"),r=require("./ui/calendar.cjs"),i=require("./field-BSLi-P0Q.cjs");let a=require("lucide-react"),o=require("react"),s=require("@customafk/react-toolkit/utils"),c=require("react/jsx-runtime"),l=require("@customafk/react-toolkit/date-fns"),u=require("@tanstack/react-form");const d=(0,o.memo)(({label:d,description:f,placeholder:p,orientation:m=`responsive`,tooltip:h,helperText:g,showErrorMessage:_=!0,required:v=!1,disabled:y=!1,minDate:b,maxDate:x})=>{let S=(0,o.useId)(),C=t.G(),[w,T]=(0,o.useState)(!1),E=(0,u.useStore)(C.form.store,({isSubmitting:e})=>e),D=y||E,O=C.state.meta.isDirty||C.state.meta.isTouched,k=O&&!C.state.meta.isValid,A=v&&C.state.value===null,j=O&&C.state.meta.errors.length>0,M=e=>{C.handleChange(e),T(!1)};return(0,c.jsxs)(i.FieldGroup,{className:`px-4`,children:[(0,c.jsxs)(i.Field,{orientation:m,"data-invalid":k,children:[(0,c.jsxs)(i.FieldContent,{children:[(0,c.jsxs)(i.FieldLabel,{htmlFor:C.name,"aria-required":A,children:[d,h&&(0,c.jsx)(i.FieldTooltip,{tooltip:h})]}),(0,c.jsx)(i.FieldDescription,{children:f})]}),(0,c.jsx)(i.FieldContentMain,{className:`flex flex-col space-y-1`,children:(0,c.jsxs)(`div`,{className:`flex w-full flex-col`,children:[(0,c.jsxs)(n.Popover,{open:w,onOpenChange:e=>{T(e),e||C.handleBlur()},children:[(0,c.jsx)(n.PopoverTrigger,{asChild:!0,children:(0,c.jsxs)(e.Button,{variant:`outline`,color:`muted`,size:`lg`,disabled:D,"aria-invalid":k?!0:void 0,"aria-describedby":S,className:(0,s.cn)(`flex items-center justify-between rounded font-normal outline-border`,`hover:bg-transparent`,`focus:outline-1 focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`data-[state=open]:outline-1 data-[state=open]:outline-primary-strong data-[state=open]:ring-4 data-[state=open]:ring-primary-weak`,C.state.value===null&&`text-text-positive-muted`,k&&`outline-danger bg-danger-bg-subtle ring-4 ring-danger-weak`),children:[(0,c.jsx)(`p`,{children:C.state.value===null?p??`Select date`:(0,l.format)(C.state.value,`PPPP`)}),(0,c.jsx)(a.CalendarDaysIcon,{strokeWidth:1})]})}),(0,c.jsxs)(n.PopoverContent,{align:`start`,side:`bottom`,className:`flex w-fit min-w-0 overflow-y-auto rounded p-0`,children:[(0,c.jsxs)(`div`,{className:`flex h-full flex-col space-y-2 border-r border-r-border p-2 [&>button]:justify-start [&>button]:text-sm`,children:[(0,c.jsx)(e.Button,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>M((0,l.endOfToday)()),children:`Hôm nay`}),(0,c.jsx)(e.Button,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>M((0,l.endOfTomorrow)()),children:`Ngày mai`}),(0,c.jsx)(e.Button,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>M((0,l.endOfYesterday)()),children:`Hôm qua`}),(0,c.jsx)(e.Button,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>M((0,l.subDays)((0,l.endOfToday)(),3)),children:`3 ngày qua`}),(0,c.jsx)(e.Button,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>M((0,l.subDays)((0,l.endOfToday)(),7)),children:`7 ngày qua`}),(0,c.jsx)(e.Button,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>M((0,l.subDays)((0,l.endOfToday)(),30)),children:`30 ngày qua`}),(0,c.jsx)(e.Button,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>M((0,l.startOfMonth)((0,l.endOfToday)())),children:`Tháng này`}),(0,c.jsx)(e.Button,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>M((0,l.lastDayOfMonth)((0,l.endOfToday)())),children:`Tháng trước`})]}),(0,c.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,c.jsx)(`div`,{className:`min-w-73 border-b border-b-border p-2`,children:(0,c.jsx)(r.Calendar,{mode:`single`,selected:C.state.value??void 0,hidden:{before:b??new Date(1900,0,1),after:x??new Date(2100,11,31)},onSelect:e=>{e&&M(e)}})})})]})]}),O&&_&&j&&(0,c.jsx)(i.FieldError,{id:S,className:`mt-1`,errors:C.state.meta.errors}),(0,c.jsx)(i.FieldNote,{isShow:!!g,children:g})]})})]}),(0,c.jsx)(i.FieldSeparator,{})]})});d.displayName=`DateField`,exports.DateField=d;
2
- //# sourceMappingURL=date-field-CYoPe74G.cjs.map
@@ -1,2 +0,0 @@
1
- import{Button as e}from"./ui/button.mjs";import{G as t}from"./tanstack-form-q9hDCc0Y.mjs";import{Popover as n,PopoverContent as r,PopoverTrigger as i}from"./ui/popover.mjs";import{Calendar as a}from"./ui/calendar.mjs";import{Field as o,FieldContent as s,FieldContentMain as c,FieldDescription as l,FieldError as u,FieldGroup as d,FieldLabel as f,FieldNote as p,FieldSeparator as m,FieldTooltip as h}from"./field-V2DoD8qL.mjs";import{CalendarDaysIcon as g}from"lucide-react";import{memo as _,useId as v,useState as y}from"react";import{cn as b}from"@customafk/react-toolkit/utils";import{jsx as x,jsxs as S}from"react/jsx-runtime";import{endOfToday as C,endOfTomorrow as w,endOfYesterday as T,format as E,lastDayOfMonth as D,startOfMonth as O,subDays as k}from"@customafk/react-toolkit/date-fns";import{useStore as A}from"@tanstack/react-form";const j=_(({label:_,description:j,placeholder:M,orientation:N=`responsive`,tooltip:P,helperText:F,showErrorMessage:I=!0,required:L=!1,disabled:R=!1,minDate:z,maxDate:B})=>{let V=v(),H=t(),[U,W]=y(!1),G=A(H.form.store,({isSubmitting:e})=>e),K=R||G,q=H.state.meta.isDirty||H.state.meta.isTouched,J=q&&!H.state.meta.isValid,Y=L&&H.state.value===null,X=q&&H.state.meta.errors.length>0,Z=e=>{H.handleChange(e),W(!1)};return S(d,{className:`px-4`,children:[S(o,{orientation:N,"data-invalid":J,children:[S(s,{children:[S(f,{htmlFor:H.name,"aria-required":Y,children:[_,P&&x(h,{tooltip:P})]}),x(l,{children:j})]}),x(c,{className:`flex flex-col space-y-1`,children:S(`div`,{className:`flex w-full flex-col`,children:[S(n,{open:U,onOpenChange:e=>{W(e),e||H.handleBlur()},children:[x(i,{asChild:!0,children:S(e,{variant:`outline`,color:`muted`,size:`lg`,disabled:K,"aria-invalid":J?!0:void 0,"aria-describedby":V,className:b(`flex items-center justify-between rounded font-normal outline-border`,`hover:bg-transparent`,`focus:outline-1 focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`data-[state=open]:outline-1 data-[state=open]:outline-primary-strong data-[state=open]:ring-4 data-[state=open]:ring-primary-weak`,H.state.value===null&&`text-text-positive-muted`,J&&`outline-danger bg-danger-bg-subtle ring-4 ring-danger-weak`),children:[x(`p`,{children:H.state.value===null?M??`Select date`:E(H.state.value,`PPPP`)}),x(g,{strokeWidth:1})]})}),S(r,{align:`start`,side:`bottom`,className:`flex w-fit min-w-0 overflow-y-auto rounded p-0`,children:[S(`div`,{className:`flex h-full flex-col space-y-2 border-r border-r-border p-2 [&>button]:justify-start [&>button]:text-sm`,children:[x(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>Z(C()),children:`Hôm nay`}),x(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>Z(w()),children:`Ngày mai`}),x(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>Z(T()),children:`Hôm qua`}),x(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>Z(k(C(),3)),children:`3 ngày qua`}),x(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>Z(k(C(),7)),children:`7 ngày qua`}),x(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>Z(k(C(),30)),children:`30 ngày qua`}),x(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>Z(O(C())),children:`Tháng này`}),x(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>Z(D(C())),children:`Tháng trước`})]}),x(`div`,{className:`flex flex-1 flex-col`,children:x(`div`,{className:`min-w-73 border-b border-b-border p-2`,children:x(a,{mode:`single`,selected:H.state.value??void 0,hidden:{before:z??new Date(1900,0,1),after:B??new Date(2100,11,31)},onSelect:e=>{e&&Z(e)}})})})]})]}),q&&I&&X&&x(u,{id:V,className:`mt-1`,errors:H.state.meta.errors}),x(p,{isShow:!!F,children:F})]})})]}),x(m,{})]})});j.displayName=`DateField`;export{j as DateField};
2
- //# sourceMappingURL=date-field-D_qpBb-t.mjs.map
@@ -1,2 +0,0 @@
1
- const e=require("./ui/dialog.cjs"),t=require("./tanstack-form-BxqS40rB.cjs"),n=require("./ui/separator.cjs"),r=require("./submit-button-CvINfld5.cjs");let i=require("react"),a=require("@customafk/react-toolkit/utils"),o=require("react/jsx-runtime");const s=({title:s,submitText:c,width:l,maxWidth:u,className:d,open:f,onOpenChange:p,children:m})=>{let h=t.K(),g=(0,i.useCallback)(e=>{e||h.reset(),p?.(e)},[h.reset,p]);return(0,o.jsx)(e.Dialog,{open:f,onOpenChange:g,children:(0,o.jsxs)(e.DialogPortal,{"data-slot":`dialog-portal`,children:[(0,o.jsx)(e.DialogOverlay,{}),(0,o.jsxs)(e.DialogContent,{style:{"--width":l,"--max-width":u},className:(0,a.cn)(`flex size-full max-h-dvh max-w-dvw flex-col gap-0 overflow-y-auto rounded-none p-0 shadow-dialog sm:h-auto sm:max-h-[85dvh] sm:max-w-5xl sm:rounded-md`,l&&`sm:w-(--width)`,u&&`sm:max-w-(--max-width)`,d),onOpenAutoFocus:e=>{e.preventDefault()},onInteractOutside:e=>{e.preventDefault()},children:[(0,o.jsx)(`div`,{"data-slot":`dialog-header`,className:`flex items-center justify-center gap-2 px-6 py-5 text-center sm:text-left`,children:(0,o.jsx)(e.DialogTitle,{"data-slot":`dialog-title`,className:`font-semibold text-lg tracking-tight`,children:s})}),(0,o.jsx)(n.Separator,{}),(0,o.jsx)(`div`,{"data-slot":`dialog-content`,className:`relative flex flex-col overflow-y-auto p-0 pt-4 max-sm:flex-1 sm:p-4`,children:m}),(0,o.jsx)(n.Separator,{}),(0,o.jsxs)(`div`,{"data-slot":`dialog-footer`,className:`flex flex-col-reverse items-center justify-end gap-2 px-6 py-4 sm:flex-row max-sm:[&>button]:w-full`,children:[(0,o.jsx)(h.Subscribe,{selector:e=>({disabled:e.isSubmitting}),children:({disabled:e})=>(0,o.jsx)(r.n,{disabled:e,onClick:()=>{h.reset(),g(!1)}})}),(0,o.jsx)(h.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:t})=>(0,o.jsx)(r.t,{isSubmitting:e,disabled:t,submitText:c,onClick:()=>h.handleSubmit()})})]})]})]})})};exports.TanStackDialogForm=s;
2
- //# sourceMappingURL=dialog-form-BTZZwz3T.cjs.map
@@ -1,2 +0,0 @@
1
- import{Dialog as e,DialogContent as t,DialogOverlay as n,DialogPortal as r,DialogTitle as i}from"./ui/dialog.mjs";import{K as a}from"./tanstack-form-q9hDCc0Y.mjs";import{Separator as o}from"./ui/separator.mjs";import{n as s,t as c}from"./submit-button-CGBaPzE9.mjs";import{useCallback as l}from"react";import{cn as u}from"@customafk/react-toolkit/utils";import{jsx as d,jsxs as f}from"react/jsx-runtime";const p=({title:p,submitText:m,width:h,maxWidth:g,className:_,open:v,onOpenChange:y,children:b})=>{let x=a(),S=l(e=>{e||x.reset(),y?.(e)},[x.reset,y]);return d(e,{open:v,onOpenChange:S,children:f(r,{"data-slot":`dialog-portal`,children:[d(n,{}),f(t,{style:{"--width":h,"--max-width":g},className:u(`flex size-full max-h-dvh max-w-dvw flex-col gap-0 overflow-y-auto rounded-none p-0 shadow-dialog sm:h-auto sm:max-h-[85dvh] sm:max-w-5xl sm:rounded-md`,h&&`sm:w-(--width)`,g&&`sm:max-w-(--max-width)`,_),onOpenAutoFocus:e=>{e.preventDefault()},onInteractOutside:e=>{e.preventDefault()},children:[d(`div`,{"data-slot":`dialog-header`,className:`flex items-center justify-center gap-2 px-6 py-5 text-center sm:text-left`,children:d(i,{"data-slot":`dialog-title`,className:`font-semibold text-lg tracking-tight`,children:p})}),d(o,{}),d(`div`,{"data-slot":`dialog-content`,className:`relative flex flex-col overflow-y-auto p-0 pt-4 max-sm:flex-1 sm:p-4`,children:b}),d(o,{}),f(`div`,{"data-slot":`dialog-footer`,className:`flex flex-col-reverse items-center justify-end gap-2 px-6 py-4 sm:flex-row max-sm:[&>button]:w-full`,children:[d(x.Subscribe,{selector:e=>({disabled:e.isSubmitting}),children:({disabled:e})=>d(s,{disabled:e,onClick:()=>{x.reset(),S(!1)}})}),d(x.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:t})=>d(c,{isSubmitting:e,disabled:t,submitText:m,onClick:()=>x.handleSubmit()})})]})]})]})})};export{p as TanStackDialogForm};
2
- //# sourceMappingURL=dialog-form-CCIcht28.mjs.map
@@ -1,2 +0,0 @@
1
- const e=require("./tanstack-form-BxqS40rB.cjs"),t=require("./ui/input.cjs"),n=require("./field-BSLi-P0Q.cjs");let r=require("lucide-react"),i=require("react"),a=require("@customafk/react-toolkit/utils"),o=require("react/jsx-runtime"),s=require("@tanstack/react-form");const c=({label:c,description:l,placeholder:u,tooltip:d,helperText:f,orientation:p=`responsive`,showErrorMessage:m=!0,required:h=!1,maxLength:g})=>{let{form:_,name:v,state:y,handleBlur:b,handleChange:x}=e.G(),S=(0,s.useStore)(_.store,({isSubmitting:e})=>e),C=y.meta.isDirty&&y.meta.isTouched&&!y.meta.isValid,w=h&&y.value===null,T=!S&&!!y.value,E=(0,i.useCallback)(({target:{value:e}})=>{S||g&&e.length>g||x(e||null)},[S,g,x]),D=(0,i.useCallback)(()=>{S||x(null)},[S,x]);return(0,o.jsxs)(n.FieldGroup,{className:`gap-y-4 px-4`,children:[(0,o.jsxs)(n.Field,{"data-invalid":C,orientation:p,children:[(0,o.jsxs)(n.FieldContent,{children:[(0,o.jsxs)(n.FieldLabel,{htmlFor:v,"aria-required":w,children:[c,d&&(0,o.jsx)(n.FieldTooltip,{tooltip:d})]}),(0,o.jsx)(n.FieldDescription,{children:l})]}),(0,o.jsxs)(n.FieldContentMain,{children:[(0,o.jsx)(t.Input,{id:v,name:v,value:y.value===null?``:y.value,"aria-invalid":C,autoComplete:`email`,placeholder:u,className:(0,a.cn)(`pl-9`,T&&`pr-9`,S&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:b,onChange:E}),(0,o.jsx)(`div`,{className:`absolute top-0 left-0 flex size-9 items-center justify-center text-muted`,children:(0,o.jsx)(r.AtSignIcon,{size:14})}),T&&(0,o.jsx)(`button`,{type:`button`,"aria-label":`Xóa`,className:`absolute inset-e-0 inset-y-0 top-3 flex h-fit w-8 cursor-pointer items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:text-text-positive-strong`,onClick:D,children:(0,o.jsx)(r.XIcon,{size:14,"aria-hidden":`true`})}),(0,o.jsx)(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:m&&y.meta.isDirty&&(0,o.jsx)(n.FieldError,{errors:y.meta.errors})}),(0,o.jsx)(n.FieldNote,{isShow:!!f,children:f})]})]}),(0,o.jsx)(n.FieldSeparator,{})]})};exports.EmailField=c;
2
- //# sourceMappingURL=email-field-DJa7iASY.cjs.map
@@ -1,2 +0,0 @@
1
- import{G as e}from"./tanstack-form-q9hDCc0Y.mjs";import{Input as t}from"./ui/input.mjs";import{Field as n,FieldContent as r,FieldContentMain as i,FieldDescription as a,FieldError as o,FieldGroup as s,FieldLabel as c,FieldNote as l,FieldSeparator as u,FieldTooltip as d}from"./field-V2DoD8qL.mjs";import{AtSignIcon as f,XIcon as p}from"lucide-react";import{useCallback as m}from"react";import{cn as h}from"@customafk/react-toolkit/utils";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{useStore as v}from"@tanstack/react-form";const y=({label:y,description:b,placeholder:x,tooltip:S,helperText:C,orientation:w=`responsive`,showErrorMessage:T=!0,required:E=!1,maxLength:D})=>{let{form:O,name:k,state:A,handleBlur:j,handleChange:M}=e(),N=v(O.store,({isSubmitting:e})=>e),P=A.meta.isDirty&&A.meta.isTouched&&!A.meta.isValid,F=E&&A.value===null,I=!N&&!!A.value,L=m(({target:{value:e}})=>{N||D&&e.length>D||M(e||null)},[N,D,M]),R=m(()=>{N||M(null)},[N,M]);return _(s,{className:`gap-y-4 px-4`,children:[_(n,{"data-invalid":P,orientation:w,children:[_(r,{children:[_(c,{htmlFor:k,"aria-required":F,children:[y,S&&g(d,{tooltip:S})]}),g(a,{children:b})]}),_(i,{children:[g(t,{id:k,name:k,value:A.value===null?``:A.value,"aria-invalid":P,autoComplete:`email`,placeholder:x,className:h(`pl-9`,I&&`pr-9`,N&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:j,onChange:L}),g(`div`,{className:`absolute top-0 left-0 flex size-9 items-center justify-center text-muted`,children:g(f,{size:14})}),I&&g(`button`,{type:`button`,"aria-label":`Xóa`,className:`absolute inset-e-0 inset-y-0 top-3 flex h-fit w-8 cursor-pointer items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:text-text-positive-strong`,onClick:R,children:g(p,{size:14,"aria-hidden":`true`})}),g(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:T&&A.meta.isDirty&&g(o,{errors:A.meta.errors})}),g(l,{isShow:!!C,children:C})]})]}),g(u,{})]})};export{y as EmailField};
2
- //# sourceMappingURL=email-field-DxSNJ6tf.mjs.map