@televet/kibble-ui 5.0.1-beta.3 → 5.0.1

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 (236) hide show
  1. package/dist/chunks/{alert.types-CjIUiK5M.js → alert.types-BKSqs9qY.js} +2 -2
  2. package/dist/chunks/{alert.types-CjIUiK5M.js.map → alert.types-BKSqs9qY.js.map} +1 -1
  3. package/dist/chunks/{alert.types--ZQbhwi3.js → alert.types-C_ygg7fh.js} +3 -3
  4. package/dist/chunks/{alert.types--ZQbhwi3.js.map → alert.types-C_ygg7fh.js.map} +1 -1
  5. package/dist/chunks/{avatar.component-C2OoiZW6.js → avatar.component-B1HGlwVW.js} +2 -2
  6. package/dist/chunks/{avatar.component-C2OoiZW6.js.map → avatar.component-B1HGlwVW.js.map} +1 -1
  7. package/dist/chunks/{avatar.component-DAaI4wvh.js → avatar.component-C-365mx3.js} +2 -2
  8. package/dist/chunks/{avatar.component-DAaI4wvh.js.map → avatar.component-C-365mx3.js.map} +1 -1
  9. package/dist/chunks/{avatarGroup.component-BUhsZBv0.js → avatarGroup.component-B-ZOhj7i.js} +5 -5
  10. package/dist/chunks/{avatarGroup.component-BUhsZBv0.js.map → avatarGroup.component-B-ZOhj7i.js.map} +1 -1
  11. package/dist/chunks/{avatarGroup.component-BihQ8qWV.js → avatarGroup.component-CTBfGiSm.js} +2 -2
  12. package/dist/chunks/{avatarGroup.component-BihQ8qWV.js.map → avatarGroup.component-CTBfGiSm.js.map} +1 -1
  13. package/dist/chunks/{buttonGroup.component-DsJK4ZJ9.js → buttonGroup.component-CowJsbr7.js} +2 -2
  14. package/dist/chunks/{buttonGroup.component-DsJK4ZJ9.js.map → buttonGroup.component-CowJsbr7.js.map} +1 -1
  15. package/dist/chunks/{buttonGroup.component-BgGh75k6.js → buttonGroup.component-DUK2FgFn.js} +2 -2
  16. package/dist/chunks/{buttonGroup.component-BgGh75k6.js.map → buttonGroup.component-DUK2FgFn.js.map} +1 -1
  17. package/dist/chunks/{calendar.component-CMnBc46u.js → calendar.component-CHIhplfO.js} +2 -2
  18. package/dist/chunks/{calendar.component-CMnBc46u.js.map → calendar.component-CHIhplfO.js.map} +1 -1
  19. package/dist/chunks/{calendar.component-D-2KzF9Q.js → calendar.component-tOoK1NrU.js} +2 -2
  20. package/dist/chunks/{calendar.component-D-2KzF9Q.js.map → calendar.component-tOoK1NrU.js.map} +1 -1
  21. package/dist/chunks/{characterCounter.component-CKAR4aCe.js → characterCounter.component-CKDigkoD.js} +2 -2
  22. package/dist/chunks/{characterCounter.component-CKAR4aCe.js.map → characterCounter.component-CKDigkoD.js.map} +1 -1
  23. package/dist/chunks/{characterCounter.component-Cd2r4VAV.js → characterCounter.component-Ch3P3GqC.js} +2 -2
  24. package/dist/chunks/{characterCounter.component-Cd2r4VAV.js.map → characterCounter.component-Ch3P3GqC.js.map} +1 -1
  25. package/dist/chunks/{checkbox.component-CtPp_vbo.js → checkbox.component-CiA3Z1zR.js} +2 -2
  26. package/dist/chunks/{checkbox.component-CtPp_vbo.js.map → checkbox.component-CiA3Z1zR.js.map} +1 -1
  27. package/dist/chunks/{checkbox.component-ClEOcUPl.js → checkbox.component-DE35wBj-.js} +3 -3
  28. package/dist/chunks/{checkbox.component-ClEOcUPl.js.map → checkbox.component-DE35wBj-.js.map} +1 -1
  29. package/dist/chunks/{checkboxGroup.component-QCbAP8s8.js → checkboxGroup.component-BGBd-roJ.js} +2 -2
  30. package/dist/chunks/{checkboxGroup.component-QCbAP8s8.js.map → checkboxGroup.component-BGBd-roJ.js.map} +1 -1
  31. package/dist/chunks/{checkboxGroup.component-BumixbJk.js → checkboxGroup.component-CYwGlktu.js} +3 -3
  32. package/dist/chunks/{checkboxGroup.component-BumixbJk.js.map → checkboxGroup.component-CYwGlktu.js.map} +1 -1
  33. package/dist/chunks/{conversationCard.component-dt3EZO6p.js → conversationCard.component-BrDGshOG.js} +2 -2
  34. package/dist/chunks/{conversationCard.component-dt3EZO6p.js.map → conversationCard.component-BrDGshOG.js.map} +1 -1
  35. package/dist/chunks/{conversationCard.component-TgMvo1z9.js → conversationCard.component-CMdqD3yN.js} +8 -8
  36. package/dist/chunks/{conversationCard.component-TgMvo1z9.js.map → conversationCard.component-CMdqD3yN.js.map} +1 -1
  37. package/dist/chunks/{datePicker.component-93K2sTq4.js → datePicker.component-C6cD1_HR.js} +2 -2
  38. package/dist/chunks/{datePicker.component-93K2sTq4.js.map → datePicker.component-C6cD1_HR.js.map} +1 -1
  39. package/dist/chunks/{datePicker.component-Du7VlqPw.js → datePicker.component-eHU7IZgC.js} +4 -4
  40. package/dist/chunks/{datePicker.component-Du7VlqPw.js.map → datePicker.component-eHU7IZgC.js.map} +1 -1
  41. package/dist/chunks/{datePicker.provider-BUseysTP.js → datePicker.provider-BWHE-9FA.js} +3 -3
  42. package/dist/chunks/{datePicker.provider-BUseysTP.js.map → datePicker.provider-BWHE-9FA.js.map} +1 -1
  43. package/dist/chunks/{datePicker.provider-BsFRDkt9.js → datePicker.provider-DgarjPPd.js} +2 -2
  44. package/dist/chunks/{datePicker.provider-BsFRDkt9.js.map → datePicker.provider-DgarjPPd.js.map} +1 -1
  45. package/dist/chunks/{dateTimePicker.component-BCKIB5nl.js → dateTimePicker.component-Byjxg2lJ.js} +5 -5
  46. package/dist/chunks/{dateTimePicker.component-BCKIB5nl.js.map → dateTimePicker.component-Byjxg2lJ.js.map} +1 -1
  47. package/dist/chunks/{dateTimePicker.component-CloZHAY9.js → dateTimePicker.component-REz9iX4S.js} +2 -2
  48. package/dist/chunks/{dateTimePicker.component-CloZHAY9.js.map → dateTimePicker.component-REz9iX4S.js.map} +1 -1
  49. package/dist/chunks/{heading.component-D2GevGaf.js → heading.component-7ikcgDco.js} +2 -2
  50. package/dist/chunks/{heading.component-D2GevGaf.js.map → heading.component-7ikcgDco.js.map} +1 -1
  51. package/dist/chunks/{heading.component-BJF9w89n.js → heading.component-DMAQO_-m.js} +2 -2
  52. package/dist/chunks/{heading.component-BJF9w89n.js.map → heading.component-DMAQO_-m.js.map} +1 -1
  53. package/dist/chunks/logo.types-88a31xCx.js.map +1 -1
  54. package/dist/chunks/logo.types-C5GwpHjM.js.map +1 -1
  55. package/dist/chunks/{menu.component-DGRYx9uq.js → menu.component-D4-4xRDj.js} +2 -2
  56. package/dist/chunks/{menu.component-DGRYx9uq.js.map → menu.component-D4-4xRDj.js.map} +1 -1
  57. package/dist/chunks/{menu.component-DP2EIgRW.js → menu.component-DwTen8Uv.js} +6 -6
  58. package/dist/chunks/{menu.component-DP2EIgRW.js.map → menu.component-DwTen8Uv.js.map} +1 -1
  59. package/dist/chunks/{modal.types-CTysHKuo.js → modal.types-74os4Bqi.js} +2 -2
  60. package/dist/chunks/{modal.types-CTysHKuo.js.map → modal.types-74os4Bqi.js.map} +1 -1
  61. package/dist/chunks/{modal.types-CDDJUW93.js → modal.types-B0rK6xJy.js} +2 -2
  62. package/dist/chunks/{modal.types-CDDJUW93.js.map → modal.types-B0rK6xJy.js.map} +1 -1
  63. package/dist/chunks/{notificationCounter.component-BG67N0hr.js → notificationCounter.component-BexkISUl.js} +2 -2
  64. package/dist/chunks/{notificationCounter.component-BG67N0hr.js.map → notificationCounter.component-BexkISUl.js.map} +1 -1
  65. package/dist/chunks/{notificationCounter.component-BZ-p6nJc.js → notificationCounter.component-DJpUXeXm.js} +2 -2
  66. package/dist/chunks/{notificationCounter.component-BZ-p6nJc.js.map → notificationCounter.component-DJpUXeXm.js.map} +1 -1
  67. package/dist/chunks/{numberInput.component-BEhyTG0A.js → numberInput.component-DIABzNV6.js} +2 -2
  68. package/dist/chunks/{numberInput.component-BEhyTG0A.js.map → numberInput.component-DIABzNV6.js.map} +1 -1
  69. package/dist/chunks/{numberInput.component-CWzidXQY.js → numberInput.component-RCwUUzmH.js} +2 -2
  70. package/dist/chunks/{numberInput.component-CWzidXQY.js.map → numberInput.component-RCwUUzmH.js.map} +1 -1
  71. package/dist/chunks/{pinInput.types-CeoFuSCZ.js → pinInput.types-BCzsoF9r.js} +2 -2
  72. package/dist/chunks/{pinInput.types-CeoFuSCZ.js.map → pinInput.types-BCzsoF9r.js.map} +1 -1
  73. package/dist/chunks/{pinInput.types-CyWr2uk3.js → pinInput.types-CcaAN6P2.js} +2 -2
  74. package/dist/chunks/{pinInput.types-CyWr2uk3.js.map → pinInput.types-CcaAN6P2.js.map} +1 -1
  75. package/dist/chunks/{popover.component-Bekht4aK.js → popover.component-BBp_5m8e.js} +2 -2
  76. package/dist/chunks/{popover.component-Bekht4aK.js.map → popover.component-BBp_5m8e.js.map} +1 -1
  77. package/dist/chunks/{popover.component-BzwIWHoc.js → popover.component-DEOUdSu3.js} +4 -4
  78. package/dist/chunks/{popover.component-BzwIWHoc.js.map → popover.component-DEOUdSu3.js.map} +1 -1
  79. package/dist/chunks/{radioGroup.types-CH1qqib7.js → radioGroup.types-C7A8mLMz.js} +2 -2
  80. package/dist/chunks/{radioGroup.types-CH1qqib7.js.map → radioGroup.types-C7A8mLMz.js.map} +1 -1
  81. package/dist/chunks/{radioGroup.types-UuaVft7f.js → radioGroup.types-DJ68ERdO.js} +4 -4
  82. package/dist/chunks/{radioGroup.types-UuaVft7f.js.map → radioGroup.types-DJ68ERdO.js.map} +1 -1
  83. package/dist/chunks/{rating.component-oGPlxXt7.js → rating.component-BsuGbcxP.js} +2 -2
  84. package/dist/chunks/{rating.component-oGPlxXt7.js.map → rating.component-BsuGbcxP.js.map} +1 -1
  85. package/dist/chunks/{rating.component-CXdTeL70.js → rating.component-ChzcvUl6.js} +2 -2
  86. package/dist/chunks/{rating.component-CXdTeL70.js.map → rating.component-ChzcvUl6.js.map} +1 -1
  87. package/dist/chunks/{ratingDots.component-CcKLD_YN.js → ratingDots.component-CVjSZ9JJ.js} +2 -2
  88. package/dist/chunks/{ratingDots.component-CcKLD_YN.js.map → ratingDots.component-CVjSZ9JJ.js.map} +1 -1
  89. package/dist/chunks/{ratingDots.component-Cn_b7XNL.js → ratingDots.component-D9WQGVcj.js} +3 -3
  90. package/dist/chunks/{ratingDots.component-Cn_b7XNL.js.map → ratingDots.component-D9WQGVcj.js.map} +1 -1
  91. package/dist/chunks/{select.component-MOdtL7IW.js → select.component-B4mAPqzN.js} +5 -5
  92. package/dist/chunks/{select.component-MOdtL7IW.js.map → select.component-B4mAPqzN.js.map} +1 -1
  93. package/dist/chunks/{select.component-BUQW4vnf.js → select.component-CCNxMGvb.js} +2 -2
  94. package/dist/chunks/{select.component-BUQW4vnf.js.map → select.component-CCNxMGvb.js.map} +1 -1
  95. package/dist/chunks/{sortableList.component-VTqxs2NN.js → sortableList.component-BlwtnxVj.js} +2 -2
  96. package/dist/chunks/{sortableList.component-VTqxs2NN.js.map → sortableList.component-BlwtnxVj.js.map} +1 -1
  97. package/dist/chunks/{sortableList.component-Yf5Y7vkk.js → sortableList.component-XfURY7C2.js} +2 -2
  98. package/dist/chunks/{sortableList.component-Yf5Y7vkk.js.map → sortableList.component-XfURY7C2.js.map} +1 -1
  99. package/dist/chunks/{spinner.component-BZMXHES5.js → spinner.component-B3dkvoO9.js} +2 -2
  100. package/dist/chunks/{spinner.component-BZMXHES5.js.map → spinner.component-B3dkvoO9.js.map} +1 -1
  101. package/dist/chunks/{spinner.component-DqgNewM2.js → spinner.component-DuW1_IWM.js} +2 -2
  102. package/dist/chunks/{spinner.component-DqgNewM2.js.map → spinner.component-DuW1_IWM.js.map} +1 -1
  103. package/dist/chunks/{styledAvatar.types-BGGW1QZW.js → styledAvatar.types-CcP-Vl9c.js} +2 -2
  104. package/dist/chunks/{styledAvatar.types-BGGW1QZW.js.map → styledAvatar.types-CcP-Vl9c.js.map} +1 -1
  105. package/dist/chunks/{styledAvatar.types-C80hus3q.js → styledAvatar.types-cR6PNPxA.js} +2 -2
  106. package/dist/chunks/{styledAvatar.types-C80hus3q.js.map → styledAvatar.types-cR6PNPxA.js.map} +1 -1
  107. package/dist/chunks/{switch.component-CkaMRTup.js → switch.component-CgzCLoTB.js} +2 -2
  108. package/dist/chunks/{switch.component-CkaMRTup.js.map → switch.component-CgzCLoTB.js.map} +1 -1
  109. package/dist/chunks/{switch.component-B8HgMP8D.js → switch.component-CpV7mnhR.js} +2 -2
  110. package/dist/chunks/{switch.component-B8HgMP8D.js.map → switch.component-CpV7mnhR.js.map} +1 -1
  111. package/dist/chunks/{tab.types-Cb7HyYq8.js → tab.types-DaJfFBvr.js} +3 -3
  112. package/dist/chunks/{tab.types-Cb7HyYq8.js.map → tab.types-DaJfFBvr.js.map} +1 -1
  113. package/dist/chunks/{tab.types-Bq-A5YO-.js → tab.types-DwPEP_5N.js} +2 -2
  114. package/dist/chunks/{tab.types-Bq-A5YO-.js.map → tab.types-DwPEP_5N.js.map} +1 -1
  115. package/dist/chunks/{tagBlock.component-B3frcT_b.js → tagBlock.component-BGEvRu81.js} +2 -2
  116. package/dist/chunks/{tagBlock.component-B3frcT_b.js.map → tagBlock.component-BGEvRu81.js.map} +1 -1
  117. package/dist/chunks/{tagBlock.component-DbFhjAD4.js → tagBlock.component-Cor6eakc.js} +5 -5
  118. package/dist/chunks/{tagBlock.component-DbFhjAD4.js.map → tagBlock.component-Cor6eakc.js.map} +1 -1
  119. package/dist/chunks/{text.component-Cv7odzlt.js → text.component-CdTyTFds.js} +2 -2
  120. package/dist/chunks/{text.component-Cv7odzlt.js.map → text.component-CdTyTFds.js.map} +1 -1
  121. package/dist/chunks/{text.component-DNNttvId.js → text.component-CeioUl0G.js} +2 -2
  122. package/dist/chunks/{text.component-DNNttvId.js.map → text.component-CeioUl0G.js.map} +1 -1
  123. package/dist/chunks/{textInput.component-Bagp9Z4m.js → textInput.component-BC0Hi8R_.js} +3 -3
  124. package/dist/chunks/{textInput.component-Bagp9Z4m.js.map → textInput.component-BC0Hi8R_.js.map} +1 -1
  125. package/dist/chunks/{textInput.component-D_MEzg3q.js → textInput.component-C1vwy6pL.js} +2 -2
  126. package/dist/chunks/{textInput.component-D_MEzg3q.js.map → textInput.component-C1vwy6pL.js.map} +1 -1
  127. package/dist/chunks/{textarea.component-DYCiC_cs.js → textarea.component-D15hA9Jb.js} +2 -2
  128. package/dist/chunks/{textarea.component-DYCiC_cs.js.map → textarea.component-D15hA9Jb.js.map} +1 -1
  129. package/dist/chunks/{textarea.component-BfNOFIoI.js → textarea.component-axjxiv82.js} +3 -3
  130. package/dist/chunks/{textarea.component-BfNOFIoI.js.map → textarea.component-axjxiv82.js.map} +1 -1
  131. package/dist/chunks/{theme.provider-DYOpOJIR.js → theme.provider-BD7qyu-B.js} +3 -3
  132. package/dist/chunks/{theme.provider-DYOpOJIR.js.map → theme.provider-BD7qyu-B.js.map} +1 -1
  133. package/dist/chunks/{theme.provider-B4WZvGfo.js → theme.provider-DFwAy7tr.js} +2 -2
  134. package/dist/chunks/{theme.provider-B4WZvGfo.js.map → theme.provider-DFwAy7tr.js.map} +1 -1
  135. package/dist/chunks/{timePicker.component-D6EIwWok.js → timePicker.component-Cz2XxVL6.js} +2 -2
  136. package/dist/chunks/{timePicker.component-D6EIwWok.js.map → timePicker.component-Cz2XxVL6.js.map} +1 -1
  137. package/dist/chunks/{timePicker.component-CE4pX9KG.js → timePicker.component-u34pHrzr.js} +3 -3
  138. package/dist/chunks/{timePicker.component-CE4pX9KG.js.map → timePicker.component-u34pHrzr.js.map} +1 -1
  139. package/dist/chunks/{timeRange.component-yx_l4Utm.js → timeRange.component-BiA1VWQ8.js} +2 -2
  140. package/dist/chunks/{timeRange.component-yx_l4Utm.js.map → timeRange.component-BiA1VWQ8.js.map} +1 -1
  141. package/dist/chunks/{timeRange.component-URBrUmwi.js → timeRange.component-tU_nCTmS.js} +2 -2
  142. package/dist/chunks/{timeRange.component-URBrUmwi.js.map → timeRange.component-tU_nCTmS.js.map} +1 -1
  143. package/dist/chunks/{timestamp.component-DgIXMBc6.js → timestamp.component-DBmc7D23.js} +3 -3
  144. package/dist/chunks/{timestamp.component-DgIXMBc6.js.map → timestamp.component-DBmc7D23.js.map} +1 -1
  145. package/dist/chunks/{timestamp.component-DtTGEtPG.js → timestamp.component-DYZHgaas.js} +2 -2
  146. package/dist/chunks/{timestamp.component-DtTGEtPG.js.map → timestamp.component-DYZHgaas.js.map} +1 -1
  147. package/dist/chunks/{tooltip.component-Cn9JSqUn.js → tooltip.component-BkFDi5yK.js} +2 -2
  148. package/dist/chunks/{tooltip.component-Cn9JSqUn.js.map → tooltip.component-BkFDi5yK.js.map} +1 -1
  149. package/dist/chunks/{tooltip.component-CiiT7r7V.js → tooltip.component-C_NS-AoH.js} +12 -12
  150. package/dist/chunks/{tooltip.component-CiiT7r7V.js.map → tooltip.component-C_NS-AoH.js.map} +1 -1
  151. package/dist/chunks/{withFormControl-B8dsRsaO.js → withFormControl-DePFf9SY.js} +2 -2
  152. package/dist/chunks/{withFormControl-B8dsRsaO.js.map → withFormControl-DePFf9SY.js.map} +1 -1
  153. package/dist/chunks/{withFormControl-BlRmmpmv.js → withFormControl-wZA87Sd4.js} +2 -2
  154. package/dist/chunks/{withFormControl-BlRmmpmv.js.map → withFormControl-wZA87Sd4.js.map} +1 -1
  155. package/dist/chunks/{withTruncation-DrxrJuSQ.js → withTruncation-DE3FFPE7.js} +2 -2
  156. package/dist/chunks/{withTruncation-DrxrJuSQ.js.map → withTruncation-DE3FFPE7.js.map} +1 -1
  157. package/dist/chunks/{withTruncation-DeEu1ylr.js → withTruncation-DTCfQ2yk.js} +2 -2
  158. package/dist/chunks/{withTruncation-DeEu1ylr.js.map → withTruncation-DTCfQ2yk.js.map} +1 -1
  159. package/dist/cjs/components/Alert/index.cjs +1 -1
  160. package/dist/cjs/components/Avatar/index.cjs +1 -1
  161. package/dist/cjs/components/AvatarGroup/index.cjs +1 -1
  162. package/dist/cjs/components/ButtonGroup/index.cjs +1 -1
  163. package/dist/cjs/components/Calendar/index.cjs +1 -1
  164. package/dist/cjs/components/CharacterCounter/index.cjs +1 -1
  165. package/dist/cjs/components/Checkbox/index.cjs +1 -1
  166. package/dist/cjs/components/CheckboxGroup/index.cjs +1 -1
  167. package/dist/cjs/components/ConversationCard/index.cjs +1 -1
  168. package/dist/cjs/components/DatePicker/index.cjs +1 -1
  169. package/dist/cjs/components/DateTimePicker/index.cjs +1 -1
  170. package/dist/cjs/components/Heading/index.cjs +1 -1
  171. package/dist/cjs/components/Menu/index.cjs +1 -1
  172. package/dist/cjs/components/Modal/index.cjs +1 -1
  173. package/dist/cjs/components/NotificationCounter/index.cjs +1 -1
  174. package/dist/cjs/components/NumberInput/index.cjs +1 -1
  175. package/dist/cjs/components/PinInput/index.cjs +1 -1
  176. package/dist/cjs/components/Popover/index.cjs +1 -1
  177. package/dist/cjs/components/RadioGroup/index.cjs +1 -1
  178. package/dist/cjs/components/Rating/index.cjs +1 -1
  179. package/dist/cjs/components/RatingDots/index.cjs +1 -1
  180. package/dist/cjs/components/Select/index.cjs +1 -1
  181. package/dist/cjs/components/SortableList/index.cjs +1 -1
  182. package/dist/cjs/components/Spinner/index.cjs +1 -1
  183. package/dist/cjs/components/StyledAvatar/index.cjs +1 -1
  184. package/dist/cjs/components/Switch/index.cjs +1 -1
  185. package/dist/cjs/components/Tabs/index.cjs +1 -1
  186. package/dist/cjs/components/TagBlock/index.cjs +1 -1
  187. package/dist/cjs/components/Text/index.cjs +1 -1
  188. package/dist/cjs/components/TextInput/index.cjs +1 -1
  189. package/dist/cjs/components/Textarea/index.cjs +1 -1
  190. package/dist/cjs/components/TimePicker/index.cjs +1 -1
  191. package/dist/cjs/components/TimeRange/index.cjs +1 -1
  192. package/dist/cjs/components/Timestamp/index.cjs +1 -1
  193. package/dist/cjs/components/Tooltip/index.cjs +1 -1
  194. package/dist/cjs/components/index.cjs +1 -1
  195. package/dist/cjs/index.cjs +1 -1
  196. package/dist/cjs/theme/index.cjs +1 -1
  197. package/dist/esm/components/Alert/index.js +1 -1
  198. package/dist/esm/components/Avatar/index.js +1 -1
  199. package/dist/esm/components/AvatarGroup/index.js +1 -1
  200. package/dist/esm/components/ButtonGroup/index.js +1 -1
  201. package/dist/esm/components/Calendar/index.js +1 -1
  202. package/dist/esm/components/CharacterCounter/index.js +1 -1
  203. package/dist/esm/components/Checkbox/index.js +1 -1
  204. package/dist/esm/components/CheckboxGroup/index.js +1 -1
  205. package/dist/esm/components/ConversationCard/index.js +1 -1
  206. package/dist/esm/components/DatePicker/index.js +2 -2
  207. package/dist/esm/components/DateTimePicker/index.js +1 -1
  208. package/dist/esm/components/Heading/index.js +1 -1
  209. package/dist/esm/components/Menu/index.js +1 -1
  210. package/dist/esm/components/Modal/index.js +1 -1
  211. package/dist/esm/components/NotificationCounter/index.js +1 -1
  212. package/dist/esm/components/NumberInput/index.js +1 -1
  213. package/dist/esm/components/PinInput/index.js +1 -1
  214. package/dist/esm/components/Popover/index.js +1 -1
  215. package/dist/esm/components/RadioGroup/index.js +1 -1
  216. package/dist/esm/components/Rating/index.js +1 -1
  217. package/dist/esm/components/RatingDots/index.js +1 -1
  218. package/dist/esm/components/Select/index.js +1 -1
  219. package/dist/esm/components/SortableList/index.js +1 -1
  220. package/dist/esm/components/Spinner/index.js +1 -1
  221. package/dist/esm/components/StyledAvatar/index.js +1 -1
  222. package/dist/esm/components/Switch/index.js +1 -1
  223. package/dist/esm/components/Tabs/index.js +1 -1
  224. package/dist/esm/components/TagBlock/index.js +1 -1
  225. package/dist/esm/components/Text/index.js +1 -1
  226. package/dist/esm/components/TextInput/index.js +1 -1
  227. package/dist/esm/components/Textarea/index.js +1 -1
  228. package/dist/esm/components/TimePicker/index.js +1 -1
  229. package/dist/esm/components/TimeRange/index.js +1 -1
  230. package/dist/esm/components/Timestamp/index.js +1 -1
  231. package/dist/esm/components/Tooltip/index.js +1 -1
  232. package/dist/esm/components/index.js +36 -36
  233. package/dist/esm/index.js +37 -37
  234. package/dist/esm/theme/index.js +1 -1
  235. package/dist/types/components/Logo/logo.component.d.ts +2 -2
  236. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"withFormControl-B8dsRsaO.js","sources":["../../node_modules/@ark-ui/react/dist/components/field/field-error-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-helper-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-label.js","../../node_modules/@ark-ui/react/dist/utils/use-safe-layout-effect.js","../../node_modules/@ark-ui/react/dist/components/fieldset/use-fieldset-context.js","../../node_modules/@ark-ui/react/dist/components/field/use-field.js","../../node_modules/@ark-ui/react/dist/components/field/field-root.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/create-icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/field/field.js","../../src/hocs/withFormControl/withFormControl.records.ts","../../src/hocs/withFormControl/withFormControl.tsx"],"sourcesContent":["'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldErrorText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field.getErrorTextProps(), props);\n if (field?.invalid) {\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n }\n return null;\n});\nFieldErrorText.displayName = \"FieldErrorText\";\n\nexport { FieldErrorText };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldHelperText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getHelperTextProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nFieldHelperText.displayName = \"FieldHelperText\";\n\nexport { FieldHelperText };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldLabel = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref });\n});\nFieldLabel.displayName = \"FieldLabel\";\n\nexport { FieldLabel };\n","'use client';\nimport { useLayoutEffect, useEffect } from 'react';\n\nconst useSafeLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\nexport { useSafeLayoutEffect };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [FieldsetProvider, useFieldsetContext] = createContext({\n name: \"FieldsetContext\",\n hookName: \"useFieldsetContext\",\n providerName: \"<FieldsetProvider />\",\n strict: false\n});\n\nexport { FieldsetProvider, useFieldsetContext };\n","'use client';\nimport { dataAttr, ariaAttr } from '@zag-js/dom-query';\nimport { useState, useId, useRef, useMemo } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\nimport { useSafeLayoutEffect } from '../../utils/use-safe-layout-effect.js';\nimport { useFieldsetContext } from '../fieldset/use-fieldset-context.js';\nimport { parts } from './field.anatomy.js';\n\nconst useField = (props = {}) => {\n const fieldset = useFieldsetContext();\n const env = useEnvironmentContext();\n const { ids, disabled = Boolean(fieldset?.disabled), invalid = false, readOnly = false, required = false } = props;\n const [hasErrorText, setHasErrorText] = useState(false);\n const [hasHelperText, setHasHelperText] = useState(false);\n const uid = useId();\n const id = props.id ?? uid;\n const rootRef = useRef(null);\n const rootId = ids?.control ?? `field::${id}`;\n const errorTextId = ids?.errorText ?? `field::${id}::error-text`;\n const helperTextId = ids?.helperText ?? `field::${id}::helper-text`;\n const labelId = ids?.label ?? `field::${id}::label`;\n useSafeLayoutEffect(() => {\n const rootNode = rootRef.current;\n if (!rootNode) return;\n const checkTextElements = () => {\n const docOrShadowRoot = env.getRootNode();\n setHasErrorText(!!docOrShadowRoot.getElementById(errorTextId));\n setHasHelperText(!!docOrShadowRoot.getElementById(helperTextId));\n };\n checkTextElements();\n const win = env.getWindow();\n const observer = new win.MutationObserver(checkTextElements);\n observer.observe(rootNode, { childList: true, subtree: true });\n return () => observer.disconnect();\n }, [env, errorTextId, helperTextId]);\n const labelIds = useMemo(() => {\n const ids2 = [];\n if (hasErrorText && invalid) ids2.push(errorTextId);\n if (hasHelperText) ids2.push(helperTextId);\n return ids2.join(\" \") || void 0;\n }, [invalid, errorTextId, helperTextId, hasErrorText, hasHelperText]);\n const getRootProps = useMemo(\n () => () => ({\n ...parts.root.attrs,\n id: rootId,\n ref: rootRef,\n role: \"group\",\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly)\n }),\n [disabled, invalid, readOnly, rootId]\n );\n const getLabelProps = useMemo(\n () => () => ({\n ...parts.label.attrs,\n id: labelId,\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly),\n htmlFor: id\n }),\n [disabled, invalid, readOnly, id, labelId]\n );\n const getControlProps = useMemo(\n () => () => ({\n \"aria-describedby\": labelIds,\n \"aria-invalid\": ariaAttr(invalid),\n \"data-invalid\": dataAttr(invalid),\n \"data-required\": dataAttr(required),\n \"data-readonly\": dataAttr(readOnly),\n id,\n required,\n disabled,\n readOnly\n }),\n [labelIds, invalid, required, readOnly, id, disabled]\n );\n const getInputProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.input.attrs\n }),\n [getControlProps]\n );\n const getTextareaProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.textarea.attrs\n }),\n [getControlProps]\n );\n const getSelectProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.select.attrs\n }),\n [getControlProps]\n );\n const getHelperTextProps = useMemo(\n () => () => ({\n id: helperTextId,\n ...parts.helperText.attrs,\n \"data-disabled\": dataAttr(disabled)\n }),\n [disabled, helperTextId]\n );\n const getErrorTextProps = useMemo(\n () => () => ({\n id: errorTextId,\n ...parts.errorText.attrs,\n \"aria-live\": \"polite\"\n }),\n [errorTextId]\n );\n const getRequiredIndicatorProps = useMemo(\n () => () => ({\n \"aria-hidden\": true,\n ...parts.requiredIndicator.attrs\n }),\n []\n );\n return {\n ariaDescribedby: labelIds,\n ids: {\n root: rootId,\n control: id,\n label: labelId,\n errorText: errorTextId,\n helperText: helperTextId\n },\n refs: {\n rootRef\n },\n disabled,\n invalid,\n readOnly,\n required,\n getLabelProps,\n getRootProps,\n getInputProps,\n getTextareaProps,\n getSelectProps,\n getHelperTextProps,\n getErrorTextProps,\n getRequiredIndicatorProps\n };\n};\n\nexport { useField };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { composeRefs } from '../../utils/compose-refs.js';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useField } from './use-field.js';\nimport { FieldProvider } from './use-field-context.js';\n\nconst FieldRoot = forwardRef((props, ref) => {\n const [useFieldProps, localProps] = createSplitProps()(props, [\n \"id\",\n \"ids\",\n \"disabled\",\n \"invalid\",\n \"readOnly\",\n \"required\"\n ]);\n const field = useField(useFieldProps);\n const mergedProps = mergeProps(field.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(FieldProvider, { value: field, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(ref, field.refs.rootRef) }) });\n});\nFieldRoot.displayName = \"FieldRoot\";\n\nexport { FieldRoot };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createRecipeContext } from '../../styled-system/create-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst { useRecipeResult, PropsProvider } = createRecipeContext({ key: \"icon\" });\nconst Icon = React.forwardRef(\n function Icon2(props, ref) {\n const {\n styles,\n className,\n props: otherProps\n } = useRecipeResult({ asChild: !props.as, ...props });\n return /* @__PURE__ */ jsx(\n chakra.svg,\n {\n ref,\n focusable: false,\n \"aria-hidden\": \"true\",\n ...otherProps,\n css: [styles, props.css],\n className: cx(className, props.className)\n }\n );\n }\n);\nconst IconPropsProvider = PropsProvider;\n\nexport { Icon, IconPropsProvider };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Children, forwardRef } from 'react';\nimport { Icon } from './icon.js';\n\nfunction createIcon(options) {\n const {\n viewBox = \"0 0 24 24\",\n d: pathDefinition,\n displayName,\n defaultProps = {}\n } = options;\n const path = Children.toArray(options.path);\n const Comp = forwardRef((props, ref) => /* @__PURE__ */ jsx(\n Icon,\n {\n ref,\n asChild: false,\n viewBox,\n ...defaultProps,\n ...props,\n children: path.length ? path : /* @__PURE__ */ jsx(\"path\", { fill: \"currentColor\", d: pathDefinition })\n }\n ));\n Comp.displayName = displayName;\n return Comp;\n}\n\nexport { createIcon };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Field, useFieldContext } from '@ark-ui/react/field';\nimport { forwardRef } from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\nimport { createIcon } from '../icon/create-icon.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useFieldStyles,\n useClassNames,\n PropsProvider\n} = createSlotRecipeContext({ key: \"field\" });\nconst FieldRoot = withProvider(\n Field.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst FieldPropsProvider = PropsProvider;\nconst FieldLabel = withContext(\n Field.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst FieldHelperText = withContext(Field.HelperText, \"helperText\", { forwardAsChild: true });\nconst FieldErrorText = withContext(\n Field.ErrorText,\n \"errorText\",\n { forwardAsChild: true }\n);\nconst FieldErrorIcon = createIcon({\n d: \"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z\"\n});\nconst FieldRequiredIndicator = forwardRef(function RequiredIndicator(props, ref) {\n const { fallback, children = \"*\", ...restProps } = props;\n const field = useFieldContext();\n const classNames = useClassNames();\n const styles = useFieldStyles();\n if (!field?.required) {\n return fallback;\n }\n return /* @__PURE__ */ jsx(\n chakra.span,\n {\n ref,\n \"aria-hidden\": \"true\",\n ...restProps,\n className: cx(classNames.requiredIndicator, props.className),\n css: [styles.requiredIndicator, props.css],\n children\n }\n );\n});\n\nexport { FieldErrorIcon, FieldErrorText, FieldHelperText, FieldLabel, FieldPropsProvider, FieldRequiredIndicator, FieldRoot, useFieldStyles };\n","import { FormControlSize } from './withFormControl.types';\n\nexport const optionalTextSizeMap: Record<FormControlSize, number> = {\n sm: 10,\n md: 12,\n lg: 14,\n};\n","import React from 'react';\nimport { Field } from '@chakra-ui/react/field';\nimport { FormControlLabelPosition, FormControlSize } from './withFormControl.types';\nimport { SystemStyleObject } from '@chakra-ui/react/styled-system';\nimport { TypographyVariant } from 'shared/types/typography';\nimport { Text } from 'components/Text/text.component';\nimport { optionalTextSizeMap } from './withFormControl.records';\nimport { fontSizes } from 'theme/tokens/typography/typography.records';\nimport { Flex } from '@chakra-ui/react/flex';\nimport { Icon } from 'components/Icon/icon.component';\nimport { Box } from '@chakra-ui/react/box';\n\nexport interface WithFormControlProps {\n /** If true, the form control will be disabled.\n * @default false\n */\n disabled?: boolean;\n /** The error text to be displayed when the form control is invalid.\n * @default Field is invalid\n */\n errorText?: string;\n /** Props to customize the form control. */\n formControlStyle?: SystemStyleObject;\n /** If true, the form control will take the full width of its container.\n * @default true\n */\n fullWidth?: boolean;\n /** The helper text to be displayed below the form control. */\n helperText?: string;\n /** If true, the form control will be displayed inline with the label. */\n inlineField?: boolean;\n /** If true, the form control will be invalid.\n * @default false\n */\n invalid?: boolean;\n /** The variant of the invalid icon.\n * @default danger\n */\n invalidIconColor?: TypographyVariant;\n /** The label to be displayed above the form control. */\n label?: string | React.ReactNode;\n /** The position of the label relative to the form control.\n * @default start\n */\n labelPosition?: FormControlLabelPosition;\n /** Props to customize the label. */\n labelStyle?: SystemStyleObject;\n /** If true, the form control will be styled for contrast mode.\n * @default false\n */\n onContrast?: boolean;\n /** If true, the form element will be read only.\n * @default false\n */\n readOnly?: boolean;\n /** If true, the form control will be required.\n * @default false\n */\n required?: boolean;\n /** If true, the form control will show an optional text.\n * @default false\n */\n showOptionalElement?: boolean;\n /** The size of the form control.\n * @default md\n */\n size?: FormControlSize;\n /** If true, the form control will show an invalid icon.\n * @default false\n */\n useInvalidIcon?: boolean;\n /** If true, the form control will show an invalid text.\n * @default true\n */\n useInvalidText?: boolean;\n}\n\nexport const withFormControl = <P extends WithFormControlProps>(Component: React.ComponentType<P>): React.FC<P> => {\n const WithFormControl = ({\n disabled = false,\n errorText = 'Field is invalid',\n formControlStyle,\n fullWidth = true,\n helperText,\n inlineField = false,\n invalid = false,\n invalidIconColor = 'danger',\n label,\n labelPosition = 'start',\n labelStyle,\n onContrast = false,\n readOnly = false,\n required = false,\n showOptionalElement = false,\n size = 'md',\n useInvalidIcon = false,\n useInvalidText = true,\n ...props\n }: WithFormControlProps): React.JSX.Element => {\n const labelComponent = (\n <Field.Label\n className=\"FormControl__Label\"\n color={onContrast ? 'text.contrast' : 'text'}\n display=\"flex\"\n flexDirection=\"row\"\n gap={1}\n fontSize={fontSizes[size]}\n fontWeight=\"semibold\"\n {...labelStyle}\n onClick={(e) => {\n e.stopPropagation();\n }}\n >\n <Box as=\"span\">{label}</Box>\n <Field.RequiredIndicator\n className=\"FormControl__RequiredIndicator\"\n color={onContrast ? 'text.danger.contrast' : 'text.danger'}\n {...(!required && {\n fallback: showOptionalElement ? (\n <Text\n as=\"span\"\n variant={onContrast ? 'subtleOnContrast' : 'subtle'}\n fontSize={optionalTextSizeMap[size]}\n display=\"contents\"\n ml={1}\n >\n (Optional)\n </Text>\n ) : (\n <></>\n ),\n })}\n />\n </Field.Label>\n );\n\n return (\n <Field.Root\n className=\"FormControl group\"\n disabled={disabled}\n invalid={invalid}\n readOnly={readOnly}\n required={required}\n width={fullWidth ? '100%' : 'auto'}\n {...formControlStyle}\n >\n <Flex\n className=\"FormControl__Container\"\n flexDirection={inlineField ? 'row' : 'column'}\n w={inlineField ? 'max-content' : '100%'}\n gap={2}\n alignItems={inlineField ? 'center' : 'flex-start'}\n >\n {label && labelPosition === 'start' && labelComponent}\n <Flex className=\"FormControl__Content\" alignItems=\"center\" gap={2} w={inlineField ? 'max-content' : '100%'}>\n <Component\n disabled={disabled}\n invalid={invalid}\n onContrast={onContrast}\n readOnly={readOnly}\n required={required}\n size={size}\n {...(props as P)}\n />\n {useInvalidIcon && invalid && (\n <Icon className=\"FormControl__InvalidIcon\" name=\"warningSign\" variant={invalidIconColor} size={size} />\n )}\n </Flex>\n {label && labelPosition === 'end' && labelComponent}\n </Flex>\n {useInvalidText && invalid && (\n <Field.ErrorText\n className=\"FormControl__ErrorText\"\n fontSize=\"xs\"\n color={onContrast ? 'text.danger.contrast' : 'text.danger'}\n >\n {errorText}\n </Field.ErrorText>\n )}\n {helperText && (\n <Field.HelperText\n className=\"FormControl__HelperText\"\n fontSize=\"xs\"\n color={onContrast ? 'text.subtle.contrast' : 'text.subtle'}\n >\n {helperText}\n </Field.HelperText>\n )}\n </Field.Root>\n );\n };\n\n WithFormControl.displayName = `withFormControl(${Component.displayName || Component.name}`;\n return WithFormControl;\n};\n"],"names":["FieldErrorText","forwardRef","props","ref","field","useFieldContext","mergedProps","mergeProps","jsx","ark","FieldHelperText","FieldLabel","useSafeLayoutEffect","useLayoutEffect","useEffect","FieldsetProvider","useFieldsetContext","createContext","useField","fieldset","env","useEnvironmentContext","ids","disabled","invalid","readOnly","required","hasErrorText","setHasErrorText","useState","hasHelperText","setHasHelperText","uid","useId","id","rootRef","useRef","rootId","errorTextId","helperTextId","labelId","rootNode","checkTextElements","docOrShadowRoot","win","observer","labelIds","useMemo","ids2","getRootProps","parts","dataAttr","getLabelProps","getControlProps","ariaAttr","getInputProps","getTextareaProps","getSelectProps","getHelperTextProps","getErrorTextProps","getRequiredIndicatorProps","FieldRoot","useFieldProps","localProps","createSplitProps","FieldProvider","composeRefs","useRecipeResult","createRecipeContext","Icon","React","styles","className","otherProps","chakra","cx","createIcon","options","viewBox","pathDefinition","displayName","defaultProps","path","Children","Comp","withProvider","withContext","useFieldStyles","useClassNames","createSlotRecipeContext","Field.Root","Field.Label","Field.HelperText","Field.ErrorText","FieldRequiredIndicator","fallback","children","restProps","classNames","optionalTextSizeMap","withFormControl","Component","WithFormControl","errorText","formControlStyle","fullWidth","helperText","inlineField","invalidIconColor","label","labelPosition","labelStyle","onContrast","showOptionalElement","size","useInvalidIcon","useInvalidText","labelComponent","jsxs","fontSizes","e","Box","Field.RequiredIndicator","Text","Fragment","Flex"],"mappings":";;;;;;;;;;;;;;;AAOA,MAAMA,IAAiBC,EAAW,CAACC,GAAOC,MAAQ;AAChD,QAAMC,IAAQC,EAAiB,GACzBC,IAAcC,EAAWH,EAAM,kBAAiB,GAAIF,CAAK;AAC/D,SAAIE,GAAO,UACcI,gBAAAA,EAAAA,IAAIC,EAAI,MAAM,EAAE,GAAGH,GAAa,KAAAH,GAAK,IAEvD;AACT,CAAC;AACDH,EAAe,cAAc;ACR7B,MAAMU,IAAkBT,EAAW,CAACC,GAAOC,MAAQ;AACjD,QAAMC,IAAQC,EAAiB,GACzBC,IAAcC,EAAWH,GAAO,mBAAkB,GAAIF,CAAK;AACjE,SAAuBM,gBAAAA,EAAAA,IAAIC,EAAI,MAAM,EAAE,GAAGH,GAAa,KAAAH,GAAK;AAC9D,CAAC;AACDO,EAAgB,cAAc;ACL9B,MAAMC,IAAaV,EAAW,CAACC,GAAOC,MAAQ;AAC5C,QAAMC,IAAQC,EAAiB,GACzBC,IAAcC,EAAWH,G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,sBACA,YAAAwF;AAAA,sBACA,UAAAvF;AAAA,sBACA,UAAAC;AAAA,sBACA,MAAAwF;AAAA,sBACC,GAAIhH;AAAA,oBAAA;AAAA,kBACP;AAAA,kBACCiH,KAAkB3F,KACjBhB,gBAAAA,MAAC6D,GAAK,EAAA,WAAU,4BAA2B,MAAK,eAAc,SAASuC,GAAkB,MAAAM,EAAY,CAAA;AAAA,gBAAA,GAEzG;AAAA,gBACCL,KAASC,MAAkB,SAASO;AAAA,cAAA;AAAA,YAAA;AAAA,UACvC;AAAA,UACCD,KAAkB5F,KACjBhB,gBAAAA,EAAA;AAAA,YAACqF;AAAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,UAAS;AAAA,cACT,OAAOmB,IAAa,yBAAyB;AAAA,cAE5C,UAAAT;AAAA,YAAA;AAAA,UACH;AAAA,UAEDG,KACClG,gBAAAA,EAAA;AAAA,YAACoF;AAAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,UAAS;AAAA,cACT,OAAOoB,IAAa,yBAAyB;AAAA,cAE5C,UAAAN;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAEJ;AAAA,EAEJ;AAEA,SAAAJ,EAAgB,cAAc,mBAAmBD,EAAU,eAAeA,EAAU,IAAI,IACjFC;AACT;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9]}
1
+ {"version":3,"file":"withFormControl-DePFf9SY.js","sources":["../../node_modules/@ark-ui/react/dist/components/field/field-error-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-helper-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-label.js","../../node_modules/@ark-ui/react/dist/utils/use-safe-layout-effect.js","../../node_modules/@ark-ui/react/dist/components/fieldset/use-fieldset-context.js","../../node_modules/@ark-ui/react/dist/components/field/use-field.js","../../node_modules/@ark-ui/react/dist/components/field/field-root.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/create-icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/field/field.js","../../src/hocs/withFormControl/withFormControl.records.ts","../../src/hocs/withFormControl/withFormControl.tsx"],"sourcesContent":["'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldErrorText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field.getErrorTextProps(), props);\n if (field?.invalid) {\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n }\n return null;\n});\nFieldErrorText.displayName = \"FieldErrorText\";\n\nexport { FieldErrorText };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldHelperText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getHelperTextProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nFieldHelperText.displayName = \"FieldHelperText\";\n\nexport { FieldHelperText };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldLabel = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref });\n});\nFieldLabel.displayName = \"FieldLabel\";\n\nexport { FieldLabel };\n","'use client';\nimport { useLayoutEffect, useEffect } from 'react';\n\nconst useSafeLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\nexport { useSafeLayoutEffect };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [FieldsetProvider, useFieldsetContext] = createContext({\n name: \"FieldsetContext\",\n hookName: \"useFieldsetContext\",\n providerName: \"<FieldsetProvider />\",\n strict: false\n});\n\nexport { FieldsetProvider, useFieldsetContext };\n","'use client';\nimport { dataAttr, ariaAttr } from '@zag-js/dom-query';\nimport { useState, useId, useRef, useMemo } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\nimport { useSafeLayoutEffect } from '../../utils/use-safe-layout-effect.js';\nimport { useFieldsetContext } from '../fieldset/use-fieldset-context.js';\nimport { parts } from './field.anatomy.js';\n\nconst useField = (props = {}) => {\n const fieldset = useFieldsetContext();\n const env = useEnvironmentContext();\n const { ids, disabled = Boolean(fieldset?.disabled), invalid = false, readOnly = false, required = false } = props;\n const [hasErrorText, setHasErrorText] = useState(false);\n const [hasHelperText, setHasHelperText] = useState(false);\n const uid = useId();\n const id = props.id ?? uid;\n const rootRef = useRef(null);\n const rootId = ids?.control ?? `field::${id}`;\n const errorTextId = ids?.errorText ?? `field::${id}::error-text`;\n const helperTextId = ids?.helperText ?? `field::${id}::helper-text`;\n const labelId = ids?.label ?? `field::${id}::label`;\n useSafeLayoutEffect(() => {\n const rootNode = rootRef.current;\n if (!rootNode) return;\n const checkTextElements = () => {\n const docOrShadowRoot = env.getRootNode();\n setHasErrorText(!!docOrShadowRoot.getElementById(errorTextId));\n setHasHelperText(!!docOrShadowRoot.getElementById(helperTextId));\n };\n checkTextElements();\n const win = env.getWindow();\n const observer = new win.MutationObserver(checkTextElements);\n observer.observe(rootNode, { childList: true, subtree: true });\n return () => observer.disconnect();\n }, [env, errorTextId, helperTextId]);\n const labelIds = useMemo(() => {\n const ids2 = [];\n if (hasErrorText && invalid) ids2.push(errorTextId);\n if (hasHelperText) ids2.push(helperTextId);\n return ids2.join(\" \") || void 0;\n }, [invalid, errorTextId, helperTextId, hasErrorText, hasHelperText]);\n const getRootProps = useMemo(\n () => () => ({\n ...parts.root.attrs,\n id: rootId,\n ref: rootRef,\n role: \"group\",\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly)\n }),\n [disabled, invalid, readOnly, rootId]\n );\n const getLabelProps = useMemo(\n () => () => ({\n ...parts.label.attrs,\n id: labelId,\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly),\n htmlFor: id\n }),\n [disabled, invalid, readOnly, id, labelId]\n );\n const getControlProps = useMemo(\n () => () => ({\n \"aria-describedby\": labelIds,\n \"aria-invalid\": ariaAttr(invalid),\n \"data-invalid\": dataAttr(invalid),\n \"data-required\": dataAttr(required),\n \"data-readonly\": dataAttr(readOnly),\n id,\n required,\n disabled,\n readOnly\n }),\n [labelIds, invalid, required, readOnly, id, disabled]\n );\n const getInputProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.input.attrs\n }),\n [getControlProps]\n );\n const getTextareaProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.textarea.attrs\n }),\n [getControlProps]\n );\n const getSelectProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.select.attrs\n }),\n [getControlProps]\n );\n const getHelperTextProps = useMemo(\n () => () => ({\n id: helperTextId,\n ...parts.helperText.attrs,\n \"data-disabled\": dataAttr(disabled)\n }),\n [disabled, helperTextId]\n );\n const getErrorTextProps = useMemo(\n () => () => ({\n id: errorTextId,\n ...parts.errorText.attrs,\n \"aria-live\": \"polite\"\n }),\n [errorTextId]\n );\n const getRequiredIndicatorProps = useMemo(\n () => () => ({\n \"aria-hidden\": true,\n ...parts.requiredIndicator.attrs\n }),\n []\n );\n return {\n ariaDescribedby: labelIds,\n ids: {\n root: rootId,\n control: id,\n label: labelId,\n errorText: errorTextId,\n helperText: helperTextId\n },\n refs: {\n rootRef\n },\n disabled,\n invalid,\n readOnly,\n required,\n getLabelProps,\n getRootProps,\n getInputProps,\n getTextareaProps,\n getSelectProps,\n getHelperTextProps,\n getErrorTextProps,\n getRequiredIndicatorProps\n };\n};\n\nexport { useField };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { composeRefs } from '../../utils/compose-refs.js';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useField } from './use-field.js';\nimport { FieldProvider } from './use-field-context.js';\n\nconst FieldRoot = forwardRef((props, ref) => {\n const [useFieldProps, localProps] = createSplitProps()(props, [\n \"id\",\n \"ids\",\n \"disabled\",\n \"invalid\",\n \"readOnly\",\n \"required\"\n ]);\n const field = useField(useFieldProps);\n const mergedProps = mergeProps(field.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(FieldProvider, { value: field, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(ref, field.refs.rootRef) }) });\n});\nFieldRoot.displayName = \"FieldRoot\";\n\nexport { FieldRoot };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createRecipeContext } from '../../styled-system/create-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst { useRecipeResult, PropsProvider } = createRecipeContext({ key: \"icon\" });\nconst Icon = React.forwardRef(\n function Icon2(props, ref) {\n const {\n styles,\n className,\n props: otherProps\n } = useRecipeResult({ asChild: !props.as, ...props });\n return /* @__PURE__ */ jsx(\n chakra.svg,\n {\n ref,\n focusable: false,\n \"aria-hidden\": \"true\",\n ...otherProps,\n css: [styles, props.css],\n className: cx(className, props.className)\n }\n );\n }\n);\nconst IconPropsProvider = PropsProvider;\n\nexport { Icon, IconPropsProvider };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Children, forwardRef } from 'react';\nimport { Icon } from './icon.js';\n\nfunction createIcon(options) {\n const {\n viewBox = \"0 0 24 24\",\n d: pathDefinition,\n displayName,\n defaultProps = {}\n } = options;\n const path = Children.toArray(options.path);\n const Comp = forwardRef((props, ref) => /* @__PURE__ */ jsx(\n Icon,\n {\n ref,\n asChild: false,\n viewBox,\n ...defaultProps,\n ...props,\n children: path.length ? path : /* @__PURE__ */ jsx(\"path\", { fill: \"currentColor\", d: pathDefinition })\n }\n ));\n Comp.displayName = displayName;\n return Comp;\n}\n\nexport { createIcon };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Field, useFieldContext } from '@ark-ui/react/field';\nimport { forwardRef } from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\nimport { createIcon } from '../icon/create-icon.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useFieldStyles,\n useClassNames,\n PropsProvider\n} = createSlotRecipeContext({ key: \"field\" });\nconst FieldRoot = withProvider(\n Field.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst FieldPropsProvider = PropsProvider;\nconst FieldLabel = withContext(\n Field.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst FieldHelperText = withContext(Field.HelperText, \"helperText\", { forwardAsChild: true });\nconst FieldErrorText = withContext(\n Field.ErrorText,\n \"errorText\",\n { forwardAsChild: true }\n);\nconst FieldErrorIcon = createIcon({\n d: \"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z\"\n});\nconst FieldRequiredIndicator = forwardRef(function RequiredIndicator(props, ref) {\n const { fallback, children = \"*\", ...restProps } = props;\n const field = useFieldContext();\n const classNames = useClassNames();\n const styles = useFieldStyles();\n if (!field?.required) {\n return fallback;\n }\n return /* @__PURE__ */ jsx(\n chakra.span,\n {\n ref,\n \"aria-hidden\": \"true\",\n ...restProps,\n className: cx(classNames.requiredIndicator, props.className),\n css: [styles.requiredIndicator, props.css],\n children\n }\n );\n});\n\nexport { FieldErrorIcon, FieldErrorText, FieldHelperText, FieldLabel, FieldPropsProvider, FieldRequiredIndicator, FieldRoot, useFieldStyles };\n","import { FormControlSize } from './withFormControl.types';\n\nexport const optionalTextSizeMap: Record<FormControlSize, number> = {\n sm: 10,\n md: 12,\n lg: 14,\n};\n","import React from 'react';\nimport { Field } from '@chakra-ui/react/field';\nimport { FormControlLabelPosition, FormControlSize } from './withFormControl.types';\nimport { SystemStyleObject } from '@chakra-ui/react/styled-system';\nimport { TypographyVariant } from 'shared/types/typography';\nimport { Text } from 'components/Text/text.component';\nimport { optionalTextSizeMap } from './withFormControl.records';\nimport { fontSizes } from 'theme/tokens/typography/typography.records';\nimport { Flex } from '@chakra-ui/react/flex';\nimport { Icon } from 'components/Icon/icon.component';\nimport { Box } from '@chakra-ui/react/box';\n\nexport interface WithFormControlProps {\n /** If true, the form control will be disabled.\n * @default false\n */\n disabled?: boolean;\n /** The error text to be displayed when the form control is invalid.\n * @default Field is invalid\n */\n errorText?: string;\n /** Props to customize the form control. */\n formControlStyle?: SystemStyleObject;\n /** If true, the form control will take the full width of its container.\n * @default true\n */\n fullWidth?: boolean;\n /** The helper text to be displayed below the form control. */\n helperText?: string;\n /** If true, the form control will be displayed inline with the label. */\n inlineField?: boolean;\n /** If true, the form control will be invalid.\n * @default false\n */\n invalid?: boolean;\n /** The variant of the invalid icon.\n * @default danger\n */\n invalidIconColor?: TypographyVariant;\n /** The label to be displayed above the form control. */\n label?: string | React.ReactNode;\n /** The position of the label relative to the form control.\n * @default start\n */\n labelPosition?: FormControlLabelPosition;\n /** Props to customize the label. */\n labelStyle?: SystemStyleObject;\n /** If true, the form control will be styled for contrast mode.\n * @default false\n */\n onContrast?: boolean;\n /** If true, the form element will be read only.\n * @default false\n */\n readOnly?: boolean;\n /** If true, the form control will be required.\n * @default false\n */\n required?: boolean;\n /** If true, the form control will show an optional text.\n * @default false\n */\n showOptionalElement?: boolean;\n /** The size of the form control.\n * @default md\n */\n size?: FormControlSize;\n /** If true, the form control will show an invalid icon.\n * @default false\n */\n useInvalidIcon?: boolean;\n /** If true, the form control will show an invalid text.\n * @default true\n */\n useInvalidText?: boolean;\n}\n\nexport const withFormControl = <P extends WithFormControlProps>(Component: React.ComponentType<P>): React.FC<P> => {\n const WithFormControl = ({\n disabled = false,\n errorText = 'Field is invalid',\n formControlStyle,\n fullWidth = true,\n helperText,\n inlineField = false,\n invalid = false,\n invalidIconColor = 'danger',\n label,\n labelPosition = 'start',\n labelStyle,\n onContrast = false,\n readOnly = false,\n required = false,\n showOptionalElement = false,\n size = 'md',\n useInvalidIcon = false,\n useInvalidText = true,\n ...props\n }: WithFormControlProps): React.JSX.Element => {\n const labelComponent = (\n <Field.Label\n className=\"FormControl__Label\"\n color={onContrast ? 'text.contrast' : 'text'}\n display=\"flex\"\n flexDirection=\"row\"\n gap={1}\n fontSize={fontSizes[size]}\n fontWeight=\"semibold\"\n {...labelStyle}\n onClick={(e) => {\n e.stopPropagation();\n }}\n >\n <Box as=\"span\">{label}</Box>\n <Field.RequiredIndicator\n className=\"FormControl__RequiredIndicator\"\n color={onContrast ? 'text.danger.contrast' : 'text.danger'}\n {...(!required && {\n fallback: showOptionalElement ? (\n <Text\n as=\"span\"\n variant={onContrast ? 'subtleOnContrast' : 'subtle'}\n fontSize={optionalTextSizeMap[size]}\n display=\"contents\"\n ml={1}\n >\n (Optional)\n </Text>\n ) : (\n <></>\n ),\n })}\n />\n </Field.Label>\n );\n\n return (\n <Field.Root\n className=\"FormControl group\"\n disabled={disabled}\n invalid={invalid}\n readOnly={readOnly}\n required={required}\n width={fullWidth ? '100%' : 'auto'}\n {...formControlStyle}\n >\n <Flex\n className=\"FormControl__Container\"\n flexDirection={inlineField ? 'row' : 'column'}\n w={inlineField ? 'max-content' : '100%'}\n gap={2}\n alignItems={inlineField ? 'center' : 'flex-start'}\n >\n {label && labelPosition === 'start' && labelComponent}\n <Flex className=\"FormControl__Content\" alignItems=\"center\" gap={2} w={inlineField ? 'max-content' : '100%'}>\n <Component\n disabled={disabled}\n invalid={invalid}\n onContrast={onContrast}\n readOnly={readOnly}\n required={required}\n size={size}\n {...(props as P)}\n />\n {useInvalidIcon && invalid && (\n <Icon className=\"FormControl__InvalidIcon\" name=\"warningSign\" variant={invalidIconColor} size={size} />\n )}\n </Flex>\n {label && labelPosition === 'end' && labelComponent}\n </Flex>\n {useInvalidText && invalid && (\n <Field.ErrorText\n className=\"FormControl__ErrorText\"\n fontSize=\"xs\"\n color={onContrast ? 'text.danger.contrast' : 'text.danger'}\n >\n {errorText}\n </Field.ErrorText>\n )}\n {helperText && (\n <Field.HelperText\n className=\"FormControl__HelperText\"\n fontSize=\"xs\"\n color={onContrast ? 'text.subtle.contrast' : 'text.subtle'}\n >\n {helperText}\n </Field.HelperText>\n )}\n </Field.Root>\n );\n };\n\n WithFormControl.displayName = `withFormControl(${Component.displayName || Component.name}`;\n return WithFormControl;\n};\n"],"names":["FieldErrorText","forwardRef","props","ref","field","useFieldContext","mergedProps","mergeProps","jsx","ark","FieldHelperText","FieldLabel","useSafeLayoutEffect","useLayoutEffect","useEffect","FieldsetProvider","useFieldsetContext","createContext","useField","fieldset","env","useEnvironmentContext","ids","disabled","invalid","readOnly","required","hasErrorText","setHasErrorText","useState","hasHelperText","setHasHelperText","uid","useId","id","rootRef","useRef","rootId","errorTextId","helperTextId","labelId","rootNode","checkTextElements","docOrShadowRoot","win","observer","labelIds","useMemo","ids2","getRootProps","parts","dataAttr","getLabelProps","getControlProps","ariaAttr","getInputProps","getTextareaProps","getSelectProps","getHelperTextProps","getErrorTextProps","getRequiredIndicatorProps","FieldRoot","useFieldProps","localProps","createSplitProps","FieldProvider","composeRefs","useRecipeResult","createRecipeContext","Icon","React","styles","className","otherProps","chakra","cx","createIcon","options","viewBox","pathDefinition","displayName","defaultProps","path","Children","Comp","withProvider","withContext","useFieldStyles","useClassNames","createSlotRecipeContext","Field.Root","Field.Label","Field.HelperText","Field.ErrorText","FieldRequiredIndicator","fallback","children","restProps","classNames","optionalTextSizeMap","withFormControl","Component","WithFormControl","errorText","formControlStyle","fullWidth","helperText","inlineField","invalidIconColor","label","labelPosition","labelStyle","onContrast","showOptionalElement","size","useInvalidIcon","useInvalidText","labelComponent","jsxs","fontSizes","e","Box","Field.RequiredIndicator","Text","Fragment","Flex"],"mappings":";;;;;;;;;;;;;;;AAOA,MAAMA,IAAiBC,EAAW,CAACC,GAAOC,MAAQ;AAChD,QAAMC,IAAQC,EAAiB,GACzBC,IAAcC,EAAWH,EAAM,kBAAiB,GAAIF,CAAK;AAC/D,SAAIE,GAAO,UACcI,gBAAAA,EAAAA,IAAIC,EAAI,MAAM,EAAE,GAAGH,GAAa,KAAAH,GAAK,IAEvD;AACT,CAAC;AACDH,EAAe,cAAc;ACR7B,MAAMU,IAAkBT,EAAW,CAACC,GAAOC,MAAQ;AACjD,QAAMC,IAAQC,EAAiB,GACzBC,IAAcC,EAAWH,GAAO,mBAAkB,GAAIF,CAAK;AACjE,SAAuBM,gBAAAA,EAAAA,IAAIC,EAAI,MAAM,EAAE,GAAGH,GAAa,KAAAH,GAAK;AAC9D,CAAC;AACDO,EAAgB,cAAc;ACL9B,MAAMC,IAAaV,EAAW,CAACC,GAAOC,MAAQ;AAC5C,QAAMC,IAAQC,EAAiB,GACzBC,IAAcC,EAAWH,GAAO,cAAa,GAAIF,CAAK;AAC5D,SAAuBM,gBAAAA,EAAAA,IAAIC,EAAI,OAAO,EAAE,GAAGH,GAAa,KAAAH,GAAK;AAC/D,CAAC;AACDQ,EAAW,cAAc;ACTzB,MAAMC,KAAsB,OAAO,SAAW,MAAcC,KAAkBC,ICAxE,CAACC,IAAkBC,EAAkB,IAAIC,GAAc;AAAA,EAC3D,MAAM;AAAA,EACN,UAAU;AA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gBACCL,KAASC,MAAkB,SAASO;AAAA,cAAA;AAAA,YAAA;AAAA,UACvC;AAAA,UACCD,KAAkB5F,KACjBhB,gBAAAA,EAAA;AAAA,YAACqF;AAAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,UAAS;AAAA,cACT,OAAOmB,IAAa,yBAAyB;AAAA,cAE5C,UAAAT;AAAA,YAAA;AAAA,UACH;AAAA,UAEDG,KACClG,gBAAAA,EAAA;AAAA,YAACoF;AAAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,UAAS;AAAA,cACT,OAAOoB,IAAa,yBAAyB;AAAA,cAE5C,UAAAN;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAEJ;AAAA,EAEJ;AAEA,SAAAJ,EAAgB,cAAc,mBAAmBD,EAAU,eAAeA,EAAU,IAAI,IACjFC;AACT;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9]}
@@ -1,2 +1,2 @@
1
- "use strict";const a=require("./jsx-runtime-BjDatQAs.js"),J=require("./text.component-DNNttvId.js"),K=require("./typography.records-Cg_lT1Z3.js"),Q=require("./icon.component-B1hr5lLa.js"),U=require("./index-BQRnVsAg.js"),M=require("./flex-BOU6tYUd.js"),s=require("react"),T=require("./factory-a2SJjEvR.js"),V=require("./create-slot-recipe-context-HXE1VazG.js"),X=require("./create-recipe-context-CDw-39SC.js"),y=require("./use-field-context-Cm29IQ7H.js"),R=require("./use-locale-context-ym21RUxU.js"),c=require("./index-CQURjLlA.js"),h=require("./field.anatomy-Bhj7Mlr7.js");function Y(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const ee=Y(s),k=s.forwardRef((e,t)=>{const r=y.useFieldContext(),o=c.mergeProps(r.getErrorTextProps(),e);return r?.invalid?a.jsxRuntimeExports.jsx(R.ark.span,{...o,ref:t}):null});k.displayName="FieldErrorText";const H=s.forwardRef((e,t)=>{const r=y.useFieldContext(),o=c.mergeProps(r?.getHelperTextProps(),e);return a.jsxRuntimeExports.jsx(R.ark.span,{...o,ref:t})});H.displayName="FieldHelperText";const L=s.forwardRef((e,t)=>{const r=y.useFieldContext(),o=c.mergeProps(r?.getLabelProps(),e);return a.jsxRuntimeExports.jsx(R.ark.label,{...o,ref:t})});L.displayName="FieldLabel";const te=typeof window<"u"?s.useLayoutEffect:s.useEffect,[Re,re]=R.createContext({name:"FieldsetContext",hookName:"useFieldsetContext",providerName:"<FieldsetProvider />",strict:!1}),se=(e={})=>{const t=re(),r=R.useEnvironmentContext(),{ids:o,disabled:n=!!t?.disabled,invalid:i=!1,readOnly:l=!1,required:u=!1}=e,[p,N]=s.useState(!1),[j,P]=s.useState(!1),v=s.useId(),d=e.id??v,F=s.useRef(null),g=o?.control??`field::${d}`,m=o?.errorText??`field::${d}::error-text`,x=o?.helperText??`field::${d}::helper-text`,C=o?.label??`field::${d}::label`;te(()=>{const b=F.current;if(!b)return;const _=()=>{const S=r.getRootNode();N(!!S.getElementById(m)),P(!!S.getElementById(x))};_();const G=r.getWindow(),A=new G.MutationObserver(_);return A.observe(b,{childList:!0,subtree:!0}),()=>A.disconnect()},[r,m,x]);const E=s.useMemo(()=>{const b=[];return p&&i&&b.push(m),j&&b.push(x),b.join(" ")||void 0},[i,m,x,p,j]),I=s.useMemo(()=>()=>({...h.parts.root.attrs,id:g,ref:F,role:"group","data-disabled":c.dataAttr(n),"data-invalid":c.dataAttr(i),"data-readonly":c.dataAttr(l)}),[n,i,l,g]),w=s.useMemo(()=>()=>({...h.parts.label.attrs,id:C,"data-disabled":c.dataAttr(n),"data-invalid":c.dataAttr(i),"data-readonly":c.dataAttr(l),htmlFor:d}),[n,i,l,d,C]),f=s.useMemo(()=>()=>({"aria-describedby":E,"aria-invalid":c.ariaAttr(i),"data-invalid":c.dataAttr(i),"data-required":c.dataAttr(u),"data-readonly":c.dataAttr(l),id:d,required:u,disabled:n,readOnly:l}),[E,i,u,l,d,n]),$=s.useMemo(()=>()=>({...f(),...h.parts.input.attrs}),[f]),B=s.useMemo(()=>()=>({...f(),...h.parts.textarea.attrs}),[f]),D=s.useMemo(()=>()=>({...f(),...h.parts.select.attrs}),[f]),z=s.useMemo(()=>()=>({id:x,...h.parts.helperText.attrs,"data-disabled":c.dataAttr(n)}),[n,x]),W=s.useMemo(()=>()=>({id:m,...h.parts.errorText.attrs,"aria-live":"polite"}),[m]),Z=s.useMemo(()=>()=>({"aria-hidden":!0,...h.parts.requiredIndicator.attrs}),[]);return{ariaDescribedby:E,ids:{root:g,control:d,label:C,errorText:m,helperText:x},refs:{rootRef:F},disabled:n,invalid:i,readOnly:l,required:u,getLabelProps:w,getRootProps:I,getInputProps:$,getTextareaProps:B,getSelectProps:D,getHelperTextProps:z,getErrorTextProps:W,getRequiredIndicatorProps:Z}},O=s.forwardRef((e,t)=>{const[r,o]=R.createSplitProps()(e,["id","ids","disabled","invalid","readOnly","required"]),n=se(r),i=c.mergeProps(n.getRootProps(),o);return a.jsxRuntimeExports.jsx(y.FieldProvider,{value:n,children:a.jsxRuntimeExports.jsx(R.ark.div,{...i,ref:R.composeRefs(t,n.refs.rootRef)})})});O.displayName="FieldRoot";const{useRecipeResult:oe}=X.createRecipeContext({key:"icon"}),ae=ee.forwardRef(function(t,r){const{styles:o,className:n,props:i}=oe({asChild:!t.as,...t});return a.jsxRuntimeExports.jsx(T.chakra.svg,{ref:r,focusable:!1,"aria-hidden":"true",...i,css:[o,t.css],className:T.cx(n,t.className)})});function ne(e){const{viewBox:t="0 0 24 24",d:r,displayName:o,defaultProps:n={}}=e,i=s.Children.toArray(e.path),l=s.forwardRef((u,p)=>a.jsxRuntimeExports.jsx(ae,{ref:p,asChild:!1,viewBox:t,...n,...u,children:i.length?i:a.jsxRuntimeExports.jsx("path",{fill:"currentColor",d:r})}));return l.displayName=o,l}const{withProvider:ie,withContext:q,useStyles:le,useClassNames:de}=V.createSlotRecipeContext({key:"field"}),ce=ie(O,"root",{forwardAsChild:!0}),ue=q(L,"label",{forwardAsChild:!0}),xe=q(H,"helperText",{forwardAsChild:!0}),pe=q(k,"errorText",{forwardAsChild:!0});ne({d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"});const me=s.forwardRef(function(t,r){const{fallback:o,children:n="*",...i}=t,l=y.useFieldContext(),u=de(),p=le();return l?.required?a.jsxRuntimeExports.jsx(T.chakra.span,{ref:r,"aria-hidden":"true",...i,className:T.cx(u.requiredIndicator,t.className),css:[p.requiredIndicator,t.css],children:n}):o}),fe={sm:10,md:12,lg:14},he=e=>{const t=({disabled:r=!1,errorText:o="Field is invalid",formControlStyle:n,fullWidth:i=!0,helperText:l,inlineField:u=!1,invalid:p=!1,invalidIconColor:N="danger",label:j,labelPosition:P="start",labelStyle:v,onContrast:d=!1,readOnly:F=!1,required:g=!1,showOptionalElement:m=!1,size:x="md",useInvalidIcon:C=!1,useInvalidText:E=!0,...I})=>{const w=a.jsxRuntimeExports.jsxs(ue,{className:"FormControl__Label",color:d?"text.contrast":"text",display:"flex",flexDirection:"row",gap:1,fontSize:K.fontSizes[x],fontWeight:"semibold",...v,onClick:f=>{f.stopPropagation()},children:[a.jsxRuntimeExports.jsx(U.Box,{as:"span",children:j}),a.jsxRuntimeExports.jsx(me,{className:"FormControl__RequiredIndicator",color:d?"text.danger.contrast":"text.danger",...!g&&{fallback:m?a.jsxRuntimeExports.jsx(J.WrappedText,{as:"span",variant:d?"subtleOnContrast":"subtle",fontSize:fe[x],display:"contents",ml:1,children:"(Optional)"}):a.jsxRuntimeExports.jsx(a.jsxRuntimeExports.Fragment,{})}})]});return a.jsxRuntimeExports.jsxs(ce,{className:"FormControl group",disabled:r,invalid:p,readOnly:F,required:g,width:i?"100%":"auto",...n,children:[a.jsxRuntimeExports.jsxs(M.Flex,{className:"FormControl__Container",flexDirection:u?"row":"column",w:u?"max-content":"100%",gap:2,alignItems:u?"center":"flex-start",children:[j&&P==="start"&&w,a.jsxRuntimeExports.jsxs(M.Flex,{className:"FormControl__Content",alignItems:"center",gap:2,w:u?"max-content":"100%",children:[a.jsxRuntimeExports.jsx(e,{disabled:r,invalid:p,onContrast:d,readOnly:F,required:g,size:x,...I}),C&&p&&a.jsxRuntimeExports.jsx(Q.Icon,{className:"FormControl__InvalidIcon",name:"warningSign",variant:N,size:x})]}),j&&P==="end"&&w]}),E&&p&&a.jsxRuntimeExports.jsx(pe,{className:"FormControl__ErrorText",fontSize:"xs",color:d?"text.danger.contrast":"text.danger",children:o}),l&&a.jsxRuntimeExports.jsx(xe,{className:"FormControl__HelperText",fontSize:"xs",color:d?"text.subtle.contrast":"text.subtle",children:l})]})};return t.displayName=`withFormControl(${e.displayName||e.name}`,t};exports.withFormControl=he;
2
- //# sourceMappingURL=withFormControl-BlRmmpmv.js.map
1
+ "use strict";const a=require("./jsx-runtime-BjDatQAs.js"),J=require("./text.component-CeioUl0G.js"),K=require("./typography.records-Cg_lT1Z3.js"),Q=require("./icon.component-B1hr5lLa.js"),U=require("./index-BQRnVsAg.js"),M=require("./flex-BOU6tYUd.js"),s=require("react"),T=require("./factory-a2SJjEvR.js"),V=require("./create-slot-recipe-context-HXE1VazG.js"),X=require("./create-recipe-context-CDw-39SC.js"),y=require("./use-field-context-Cm29IQ7H.js"),R=require("./use-locale-context-ym21RUxU.js"),c=require("./index-CQURjLlA.js"),h=require("./field.anatomy-Bhj7Mlr7.js");function Y(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const ee=Y(s),k=s.forwardRef((e,t)=>{const r=y.useFieldContext(),o=c.mergeProps(r.getErrorTextProps(),e);return r?.invalid?a.jsxRuntimeExports.jsx(R.ark.span,{...o,ref:t}):null});k.displayName="FieldErrorText";const H=s.forwardRef((e,t)=>{const r=y.useFieldContext(),o=c.mergeProps(r?.getHelperTextProps(),e);return a.jsxRuntimeExports.jsx(R.ark.span,{...o,ref:t})});H.displayName="FieldHelperText";const L=s.forwardRef((e,t)=>{const r=y.useFieldContext(),o=c.mergeProps(r?.getLabelProps(),e);return a.jsxRuntimeExports.jsx(R.ark.label,{...o,ref:t})});L.displayName="FieldLabel";const te=typeof window<"u"?s.useLayoutEffect:s.useEffect,[Re,re]=R.createContext({name:"FieldsetContext",hookName:"useFieldsetContext",providerName:"<FieldsetProvider />",strict:!1}),se=(e={})=>{const t=re(),r=R.useEnvironmentContext(),{ids:o,disabled:n=!!t?.disabled,invalid:i=!1,readOnly:l=!1,required:u=!1}=e,[p,N]=s.useState(!1),[j,P]=s.useState(!1),v=s.useId(),d=e.id??v,F=s.useRef(null),g=o?.control??`field::${d}`,m=o?.errorText??`field::${d}::error-text`,x=o?.helperText??`field::${d}::helper-text`,C=o?.label??`field::${d}::label`;te(()=>{const b=F.current;if(!b)return;const _=()=>{const S=r.getRootNode();N(!!S.getElementById(m)),P(!!S.getElementById(x))};_();const G=r.getWindow(),A=new G.MutationObserver(_);return A.observe(b,{childList:!0,subtree:!0}),()=>A.disconnect()},[r,m,x]);const E=s.useMemo(()=>{const b=[];return p&&i&&b.push(m),j&&b.push(x),b.join(" ")||void 0},[i,m,x,p,j]),I=s.useMemo(()=>()=>({...h.parts.root.attrs,id:g,ref:F,role:"group","data-disabled":c.dataAttr(n),"data-invalid":c.dataAttr(i),"data-readonly":c.dataAttr(l)}),[n,i,l,g]),w=s.useMemo(()=>()=>({...h.parts.label.attrs,id:C,"data-disabled":c.dataAttr(n),"data-invalid":c.dataAttr(i),"data-readonly":c.dataAttr(l),htmlFor:d}),[n,i,l,d,C]),f=s.useMemo(()=>()=>({"aria-describedby":E,"aria-invalid":c.ariaAttr(i),"data-invalid":c.dataAttr(i),"data-required":c.dataAttr(u),"data-readonly":c.dataAttr(l),id:d,required:u,disabled:n,readOnly:l}),[E,i,u,l,d,n]),$=s.useMemo(()=>()=>({...f(),...h.parts.input.attrs}),[f]),B=s.useMemo(()=>()=>({...f(),...h.parts.textarea.attrs}),[f]),D=s.useMemo(()=>()=>({...f(),...h.parts.select.attrs}),[f]),z=s.useMemo(()=>()=>({id:x,...h.parts.helperText.attrs,"data-disabled":c.dataAttr(n)}),[n,x]),W=s.useMemo(()=>()=>({id:m,...h.parts.errorText.attrs,"aria-live":"polite"}),[m]),Z=s.useMemo(()=>()=>({"aria-hidden":!0,...h.parts.requiredIndicator.attrs}),[]);return{ariaDescribedby:E,ids:{root:g,control:d,label:C,errorText:m,helperText:x},refs:{rootRef:F},disabled:n,invalid:i,readOnly:l,required:u,getLabelProps:w,getRootProps:I,getInputProps:$,getTextareaProps:B,getSelectProps:D,getHelperTextProps:z,getErrorTextProps:W,getRequiredIndicatorProps:Z}},O=s.forwardRef((e,t)=>{const[r,o]=R.createSplitProps()(e,["id","ids","disabled","invalid","readOnly","required"]),n=se(r),i=c.mergeProps(n.getRootProps(),o);return a.jsxRuntimeExports.jsx(y.FieldProvider,{value:n,children:a.jsxRuntimeExports.jsx(R.ark.div,{...i,ref:R.composeRefs(t,n.refs.rootRef)})})});O.displayName="FieldRoot";const{useRecipeResult:oe}=X.createRecipeContext({key:"icon"}),ae=ee.forwardRef(function(t,r){const{styles:o,className:n,props:i}=oe({asChild:!t.as,...t});return a.jsxRuntimeExports.jsx(T.chakra.svg,{ref:r,focusable:!1,"aria-hidden":"true",...i,css:[o,t.css],className:T.cx(n,t.className)})});function ne(e){const{viewBox:t="0 0 24 24",d:r,displayName:o,defaultProps:n={}}=e,i=s.Children.toArray(e.path),l=s.forwardRef((u,p)=>a.jsxRuntimeExports.jsx(ae,{ref:p,asChild:!1,viewBox:t,...n,...u,children:i.length?i:a.jsxRuntimeExports.jsx("path",{fill:"currentColor",d:r})}));return l.displayName=o,l}const{withProvider:ie,withContext:q,useStyles:le,useClassNames:de}=V.createSlotRecipeContext({key:"field"}),ce=ie(O,"root",{forwardAsChild:!0}),ue=q(L,"label",{forwardAsChild:!0}),xe=q(H,"helperText",{forwardAsChild:!0}),pe=q(k,"errorText",{forwardAsChild:!0});ne({d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"});const me=s.forwardRef(function(t,r){const{fallback:o,children:n="*",...i}=t,l=y.useFieldContext(),u=de(),p=le();return l?.required?a.jsxRuntimeExports.jsx(T.chakra.span,{ref:r,"aria-hidden":"true",...i,className:T.cx(u.requiredIndicator,t.className),css:[p.requiredIndicator,t.css],children:n}):o}),fe={sm:10,md:12,lg:14},he=e=>{const t=({disabled:r=!1,errorText:o="Field is invalid",formControlStyle:n,fullWidth:i=!0,helperText:l,inlineField:u=!1,invalid:p=!1,invalidIconColor:N="danger",label:j,labelPosition:P="start",labelStyle:v,onContrast:d=!1,readOnly:F=!1,required:g=!1,showOptionalElement:m=!1,size:x="md",useInvalidIcon:C=!1,useInvalidText:E=!0,...I})=>{const w=a.jsxRuntimeExports.jsxs(ue,{className:"FormControl__Label",color:d?"text.contrast":"text",display:"flex",flexDirection:"row",gap:1,fontSize:K.fontSizes[x],fontWeight:"semibold",...v,onClick:f=>{f.stopPropagation()},children:[a.jsxRuntimeExports.jsx(U.Box,{as:"span",children:j}),a.jsxRuntimeExports.jsx(me,{className:"FormControl__RequiredIndicator",color:d?"text.danger.contrast":"text.danger",...!g&&{fallback:m?a.jsxRuntimeExports.jsx(J.WrappedText,{as:"span",variant:d?"subtleOnContrast":"subtle",fontSize:fe[x],display:"contents",ml:1,children:"(Optional)"}):a.jsxRuntimeExports.jsx(a.jsxRuntimeExports.Fragment,{})}})]});return a.jsxRuntimeExports.jsxs(ce,{className:"FormControl group",disabled:r,invalid:p,readOnly:F,required:g,width:i?"100%":"auto",...n,children:[a.jsxRuntimeExports.jsxs(M.Flex,{className:"FormControl__Container",flexDirection:u?"row":"column",w:u?"max-content":"100%",gap:2,alignItems:u?"center":"flex-start",children:[j&&P==="start"&&w,a.jsxRuntimeExports.jsxs(M.Flex,{className:"FormControl__Content",alignItems:"center",gap:2,w:u?"max-content":"100%",children:[a.jsxRuntimeExports.jsx(e,{disabled:r,invalid:p,onContrast:d,readOnly:F,required:g,size:x,...I}),C&&p&&a.jsxRuntimeExports.jsx(Q.Icon,{className:"FormControl__InvalidIcon",name:"warningSign",variant:N,size:x})]}),j&&P==="end"&&w]}),E&&p&&a.jsxRuntimeExports.jsx(pe,{className:"FormControl__ErrorText",fontSize:"xs",color:d?"text.danger.contrast":"text.danger",children:o}),l&&a.jsxRuntimeExports.jsx(xe,{className:"FormControl__HelperText",fontSize:"xs",color:d?"text.subtle.contrast":"text.subtle",children:l})]})};return t.displayName=`withFormControl(${e.displayName||e.name}`,t};exports.withFormControl=he;
2
+ //# sourceMappingURL=withFormControl-wZA87Sd4.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"withFormControl-BlRmmpmv.js","sources":["../../node_modules/@ark-ui/react/dist/components/field/field-error-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-helper-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-label.js","../../node_modules/@ark-ui/react/dist/utils/use-safe-layout-effect.js","../../node_modules/@ark-ui/react/dist/components/fieldset/use-fieldset-context.js","../../node_modules/@ark-ui/react/dist/components/field/use-field.js","../../node_modules/@ark-ui/react/dist/components/field/field-root.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/create-icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/field/field.js","../../src/hocs/withFormControl/withFormControl.records.ts","../../src/hocs/withFormControl/withFormControl.tsx"],"sourcesContent":["'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldErrorText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field.getErrorTextProps(), props);\n if (field?.invalid) {\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n }\n return null;\n});\nFieldErrorText.displayName = \"FieldErrorText\";\n\nexport { FieldErrorText };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldHelperText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getHelperTextProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nFieldHelperText.displayName = \"FieldHelperText\";\n\nexport { FieldHelperText };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldLabel = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref });\n});\nFieldLabel.displayName = \"FieldLabel\";\n\nexport { FieldLabel };\n","'use client';\nimport { useLayoutEffect, useEffect } from 'react';\n\nconst useSafeLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\nexport { useSafeLayoutEffect };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [FieldsetProvider, useFieldsetContext] = createContext({\n name: \"FieldsetContext\",\n hookName: \"useFieldsetContext\",\n providerName: \"<FieldsetProvider />\",\n strict: false\n});\n\nexport { FieldsetProvider, useFieldsetContext };\n","'use client';\nimport { dataAttr, ariaAttr } from '@zag-js/dom-query';\nimport { useState, useId, useRef, useMemo } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\nimport { useSafeLayoutEffect } from '../../utils/use-safe-layout-effect.js';\nimport { useFieldsetContext } from '../fieldset/use-fieldset-context.js';\nimport { parts } from './field.anatomy.js';\n\nconst useField = (props = {}) => {\n const fieldset = useFieldsetContext();\n const env = useEnvironmentContext();\n const { ids, disabled = Boolean(fieldset?.disabled), invalid = false, readOnly = false, required = false } = props;\n const [hasErrorText, setHasErrorText] = useState(false);\n const [hasHelperText, setHasHelperText] = useState(false);\n const uid = useId();\n const id = props.id ?? uid;\n const rootRef = useRef(null);\n const rootId = ids?.control ?? `field::${id}`;\n const errorTextId = ids?.errorText ?? `field::${id}::error-text`;\n const helperTextId = ids?.helperText ?? `field::${id}::helper-text`;\n const labelId = ids?.label ?? `field::${id}::label`;\n useSafeLayoutEffect(() => {\n const rootNode = rootRef.current;\n if (!rootNode) return;\n const checkTextElements = () => {\n const docOrShadowRoot = env.getRootNode();\n setHasErrorText(!!docOrShadowRoot.getElementById(errorTextId));\n setHasHelperText(!!docOrShadowRoot.getElementById(helperTextId));\n };\n checkTextElements();\n const win = env.getWindow();\n const observer = new win.MutationObserver(checkTextElements);\n observer.observe(rootNode, { childList: true, subtree: true });\n return () => observer.disconnect();\n }, [env, errorTextId, helperTextId]);\n const labelIds = useMemo(() => {\n const ids2 = [];\n if (hasErrorText && invalid) ids2.push(errorTextId);\n if (hasHelperText) ids2.push(helperTextId);\n return ids2.join(\" \") || void 0;\n }, [invalid, errorTextId, helperTextId, hasErrorText, hasHelperText]);\n const getRootProps = useMemo(\n () => () => ({\n ...parts.root.attrs,\n id: rootId,\n ref: rootRef,\n role: \"group\",\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly)\n }),\n [disabled, invalid, readOnly, rootId]\n );\n const getLabelProps = useMemo(\n () => () => ({\n ...parts.label.attrs,\n id: labelId,\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly),\n htmlFor: id\n }),\n [disabled, invalid, readOnly, id, labelId]\n );\n const getControlProps = useMemo(\n () => () => ({\n \"aria-describedby\": labelIds,\n \"aria-invalid\": ariaAttr(invalid),\n \"data-invalid\": dataAttr(invalid),\n \"data-required\": dataAttr(required),\n \"data-readonly\": dataAttr(readOnly),\n id,\n required,\n disabled,\n readOnly\n }),\n [labelIds, invalid, required, readOnly, id, disabled]\n );\n const getInputProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.input.attrs\n }),\n [getControlProps]\n );\n const getTextareaProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.textarea.attrs\n }),\n [getControlProps]\n );\n const getSelectProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.select.attrs\n }),\n [getControlProps]\n );\n const getHelperTextProps = useMemo(\n () => () => ({\n id: helperTextId,\n ...parts.helperText.attrs,\n \"data-disabled\": dataAttr(disabled)\n }),\n [disabled, helperTextId]\n );\n const getErrorTextProps = useMemo(\n () => () => ({\n id: errorTextId,\n ...parts.errorText.attrs,\n \"aria-live\": \"polite\"\n }),\n [errorTextId]\n );\n const getRequiredIndicatorProps = useMemo(\n () => () => ({\n \"aria-hidden\": true,\n ...parts.requiredIndicator.attrs\n }),\n []\n );\n return {\n ariaDescribedby: labelIds,\n ids: {\n root: rootId,\n control: id,\n label: labelId,\n errorText: errorTextId,\n helperText: helperTextId\n },\n refs: {\n rootRef\n },\n disabled,\n invalid,\n readOnly,\n required,\n getLabelProps,\n getRootProps,\n getInputProps,\n getTextareaProps,\n getSelectProps,\n getHelperTextProps,\n getErrorTextProps,\n getRequiredIndicatorProps\n };\n};\n\nexport { useField };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { composeRefs } from '../../utils/compose-refs.js';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useField } from './use-field.js';\nimport { FieldProvider } from './use-field-context.js';\n\nconst FieldRoot = forwardRef((props, ref) => {\n const [useFieldProps, localProps] = createSplitProps()(props, [\n \"id\",\n \"ids\",\n \"disabled\",\n \"invalid\",\n \"readOnly\",\n \"required\"\n ]);\n const field = useField(useFieldProps);\n const mergedProps = mergeProps(field.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(FieldProvider, { value: field, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(ref, field.refs.rootRef) }) });\n});\nFieldRoot.displayName = \"FieldRoot\";\n\nexport { FieldRoot };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createRecipeContext } from '../../styled-system/create-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst { useRecipeResult, PropsProvider } = createRecipeContext({ key: \"icon\" });\nconst Icon = React.forwardRef(\n function Icon2(props, ref) {\n const {\n styles,\n className,\n props: otherProps\n } = useRecipeResult({ asChild: !props.as, ...props });\n return /* @__PURE__ */ jsx(\n chakra.svg,\n {\n ref,\n focusable: false,\n \"aria-hidden\": \"true\",\n ...otherProps,\n css: [styles, props.css],\n className: cx(className, props.className)\n }\n );\n }\n);\nconst IconPropsProvider = PropsProvider;\n\nexport { Icon, IconPropsProvider };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Children, forwardRef } from 'react';\nimport { Icon } from './icon.js';\n\nfunction createIcon(options) {\n const {\n viewBox = \"0 0 24 24\",\n d: pathDefinition,\n displayName,\n defaultProps = {}\n } = options;\n const path = Children.toArray(options.path);\n const Comp = forwardRef((props, ref) => /* @__PURE__ */ jsx(\n Icon,\n {\n ref,\n asChild: false,\n viewBox,\n ...defaultProps,\n ...props,\n children: path.length ? path : /* @__PURE__ */ jsx(\"path\", { fill: \"currentColor\", d: pathDefinition })\n }\n ));\n Comp.displayName = displayName;\n return Comp;\n}\n\nexport { createIcon };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Field, useFieldContext } from '@ark-ui/react/field';\nimport { forwardRef } from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\nimport { createIcon } from '../icon/create-icon.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useFieldStyles,\n useClassNames,\n PropsProvider\n} = createSlotRecipeContext({ key: \"field\" });\nconst FieldRoot = withProvider(\n Field.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst FieldPropsProvider = PropsProvider;\nconst FieldLabel = withContext(\n Field.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst FieldHelperText = withContext(Field.HelperText, \"helperText\", { forwardAsChild: true });\nconst FieldErrorText = withContext(\n Field.ErrorText,\n \"errorText\",\n { forwardAsChild: true }\n);\nconst FieldErrorIcon = createIcon({\n d: \"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z\"\n});\nconst FieldRequiredIndicator = forwardRef(function RequiredIndicator(props, ref) {\n const { fallback, children = \"*\", ...restProps } = props;\n const field = useFieldContext();\n const classNames = useClassNames();\n const styles = useFieldStyles();\n if (!field?.required) {\n return fallback;\n }\n return /* @__PURE__ */ jsx(\n chakra.span,\n {\n ref,\n \"aria-hidden\": \"true\",\n ...restProps,\n className: cx(classNames.requiredIndicator, props.className),\n css: [styles.requiredIndicator, props.css],\n children\n }\n );\n});\n\nexport { FieldErrorIcon, FieldErrorText, FieldHelperText, FieldLabel, FieldPropsProvider, FieldRequiredIndicator, FieldRoot, useFieldStyles };\n","import { FormControlSize } from './withFormControl.types';\n\nexport const optionalTextSizeMap: Record<FormControlSize, number> = {\n sm: 10,\n md: 12,\n lg: 14,\n};\n","import React from 'react';\nimport { Field } from '@chakra-ui/react/field';\nimport { FormControlLabelPosition, FormControlSize } from './withFormControl.types';\nimport { SystemStyleObject } from '@chakra-ui/react/styled-system';\nimport { TypographyVariant } from 'shared/types/typography';\nimport { Text } from 'components/Text/text.component';\nimport { optionalTextSizeMap } from './withFormControl.records';\nimport { fontSizes } from 'theme/tokens/typography/typography.records';\nimport { Flex } from '@chakra-ui/react/flex';\nimport { Icon } from 'components/Icon/icon.component';\nimport { Box } from '@chakra-ui/react/box';\n\nexport interface WithFormControlProps {\n /** If true, the form control will be disabled.\n * @default false\n */\n disabled?: boolean;\n /** The error text to be displayed when the form control is invalid.\n * @default Field is invalid\n */\n errorText?: string;\n /** Props to customize the form control. */\n formControlStyle?: SystemStyleObject;\n /** If true, the form control will take the full width of its container.\n * @default true\n */\n fullWidth?: boolean;\n /** The helper text to be displayed below the form control. */\n helperText?: string;\n /** If true, the form control will be displayed inline with the label. */\n inlineField?: boolean;\n /** If true, the form control will be invalid.\n * @default false\n */\n invalid?: boolean;\n /** The variant of the invalid icon.\n * @default danger\n */\n invalidIconColor?: TypographyVariant;\n /** The label to be displayed above the form control. */\n label?: string | React.ReactNode;\n /** The position of the label relative to the form control.\n * @default start\n */\n labelPosition?: FormControlLabelPosition;\n /** Props to customize the label. */\n labelStyle?: SystemStyleObject;\n /** If true, the form control will be styled for contrast mode.\n * @default false\n */\n onContrast?: boolean;\n /** If true, the form element will be read only.\n * @default false\n */\n readOnly?: boolean;\n /** If true, the form control will be required.\n * @default false\n */\n required?: boolean;\n /** If true, the form control will show an optional text.\n * @default false\n */\n showOptionalElement?: boolean;\n /** The size of the form control.\n * @default md\n */\n size?: FormControlSize;\n /** If true, the form control will show an invalid icon.\n * @default false\n */\n useInvalidIcon?: boolean;\n /** If true, the form control will show an invalid text.\n * @default true\n */\n useInvalidText?: boolean;\n}\n\nexport const withFormControl = <P extends WithFormControlProps>(Component: React.ComponentType<P>): React.FC<P> => {\n const WithFormControl = ({\n disabled = false,\n errorText = 'Field is invalid',\n formControlStyle,\n fullWidth = true,\n helperText,\n inlineField = false,\n invalid = false,\n invalidIconColor = 'danger',\n label,\n labelPosition = 'start',\n labelStyle,\n onContrast = false,\n readOnly = false,\n required = false,\n showOptionalElement = false,\n size = 'md',\n useInvalidIcon = false,\n useInvalidText = true,\n ...props\n }: WithFormControlProps): React.JSX.Element => {\n const labelComponent = (\n <Field.Label\n className=\"FormControl__Label\"\n color={onContrast ? 'text.contrast' : 'text'}\n display=\"flex\"\n flexDirection=\"row\"\n gap={1}\n fontSize={fontSizes[size]}\n fontWeight=\"semibold\"\n {...labelStyle}\n onClick={(e) => {\n e.stopPropagation();\n }}\n >\n <Box as=\"span\">{label}</Box>\n <Field.RequiredIndicator\n className=\"FormControl__RequiredIndicator\"\n color={onContrast ? 'text.danger.contrast' : 'text.danger'}\n {...(!required && {\n fallback: showOptionalElement ? (\n <Text\n as=\"span\"\n variant={onContrast ? 'subtleOnContrast' : 'subtle'}\n fontSize={optionalTextSizeMap[size]}\n display=\"contents\"\n ml={1}\n >\n (Optional)\n </Text>\n ) : (\n <></>\n ),\n })}\n />\n </Field.Label>\n );\n\n return (\n <Field.Root\n className=\"FormControl group\"\n disabled={disabled}\n invalid={invalid}\n readOnly={readOnly}\n required={required}\n width={fullWidth ? '100%' : 'auto'}\n {...formControlStyle}\n >\n <Flex\n className=\"FormControl__Container\"\n flexDirection={inlineField ? 'row' : 'column'}\n w={inlineField ? 'max-content' : '100%'}\n gap={2}\n alignItems={inlineField ? 'center' : 'flex-start'}\n >\n {label && labelPosition === 'start' && labelComponent}\n <Flex className=\"FormControl__Content\" alignItems=\"center\" gap={2} w={inlineField ? 'max-content' : '100%'}>\n <Component\n disabled={disabled}\n invalid={invalid}\n onContrast={onContrast}\n readOnly={readOnly}\n required={required}\n size={size}\n {...(props as P)}\n />\n {useInvalidIcon && invalid && (\n <Icon className=\"FormControl__InvalidIcon\" name=\"warningSign\" variant={invalidIconColor} size={size} />\n )}\n </Flex>\n {label && labelPosition === 'end' && labelComponent}\n </Flex>\n {useInvalidText && invalid && (\n <Field.ErrorText\n className=\"FormControl__ErrorText\"\n fontSize=\"xs\"\n color={onContrast ? 'text.danger.contrast' : 'text.danger'}\n >\n {errorText}\n </Field.ErrorText>\n )}\n {helperText && (\n <Field.HelperText\n className=\"FormControl__HelperText\"\n fontSize=\"xs\"\n color={onContrast ? 'text.subtle.contrast' : 'text.subtle'}\n >\n {helperText}\n </Field.HelperText>\n )}\n </Field.Root>\n );\n };\n\n WithFormControl.displayName = `withFormControl(${Component.displayName || Component.name}`;\n return WithFormControl;\n};\n"],"names":["FieldErrorText","forwardRef","props","ref","field","useFieldContext","mergedProps","mergeProps","jsx","ark","FieldHelperText","FieldLabel","useSafeLayoutEffect","useLayoutEffect","useEffect","FieldsetProvider","useFieldsetContext","createContext","useField","fieldset","env","useEnvironmentContext","ids","disabled","invalid","readOnly","required","hasErrorText","setHasErrorText","useState","hasHelperText","setHasHelperText","uid","useId","id","rootRef","useRef","rootId","errorTextId","helperTextId","labelId","rootNode","checkTextElements","docOrShadowRoot","win","observer","labelIds","useMemo","ids2","getRootProps","parts","dataAttr","getLabelProps","getControlProps","ariaAttr","getInputProps","getTextareaProps","getSelectProps","getHelperTextProps","getErrorTextProps","getRequiredIndicatorProps","FieldRoot","useFieldProps","localProps","createSplitProps","FieldProvider","composeRefs","useRecipeResult","createRecipeContext","Icon","React","styles","className","otherProps","chakra","cx","createIcon","options","viewBox","pathDefinition","displayName","defaultProps","path","Children","Comp","withProvider","withContext","useFieldStyles","useClassNames","createSlotRecipeContext","Field.Root","Field.Label","Field.HelperText","Field.ErrorText","FieldRequiredIndicator","fallback","children","restProps","classNames","optionalTextSizeMap","withFormControl","Component","WithFormControl","errorText","formControlStyle","fullWidth","helperText","inlineField","invalidIconColor","label","labelPosition","labelStyle","onContrast","showOptionalElement","size","useInvalidIcon","useInvalidText","labelComponent","jsxs","fontSizes","e","Box","Field.RequiredIndicator","Text","Fragment","Flex"],"mappings":"s3BAOMA,EAAiBC,EAAU,WAAC,CAACC,EAAOC,IAAQ,CAChD,MAAMC,EAAQC,EAAAA,gBAAiB,EACzBC,EAAcC,EAAU,WAACH,EAAM,kBAAiB,EAAIF,CAAK,EAC/D,OAAIE,GAAO,QACcI,EAAAA,kBAAAA,IAAIC,EAAAA,IAAI,KAAM,CAAE,GAAGH,EAAa,IAAAH,EAAK,EAEvD,IACT,CAAC,EACDH,EAAe,YAAc,iBCR7B,MAAMU,EAAkBT,EAAU,WAAC,CAACC,EAAOC,IAAQ,CACjD,MAAMC,EAAQC,EAAAA,gBAAiB,EACzBC,EAAcC,EAAU,WAACH,GAAO,mBAAkB,EAAIF,CAAK,EACjE,OAAuBM,EAAAA,kBAAAA,IAAIC,EAAAA,IAAI,KAAM,CAAE,GAAGH,EAAa,IAAAH,EAAK,CAC9D,CAAC,EACDO,EAAgB,YAAc,kBCL9B,MAAMC,EAAaV,EAAU,WAAC,CAACC,EAAOC,IAAQ,CAC5C,MA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GlB,EAAc,cAAgB,OAClG,SAAA,CAAAnG,EAAA,kBAAA,IAAC6F,EAAA,CACC,SAAA9E,EACA,QAAAC,EACA,WAAAwF,EACA,SAAAvF,EACA,SAAAC,EACA,KAAAwF,EACC,GAAIhH,CAAA,CACP,EACCiH,GAAkB3F,GACjBhB,wBAAC6D,EAAAA,KAAK,CAAA,UAAU,2BAA2B,KAAK,cAAc,QAASuC,EAAkB,KAAAM,CAAY,CAAA,CAAA,EAEzG,EACCL,GAASC,IAAkB,OAASO,CAAA,CAAA,CACvC,EACCD,GAAkB5F,GACjBhB,EAAA,kBAAA,IAACqF,GAAA,CACC,UAAU,yBACV,SAAS,KACT,MAAOmB,EAAa,uBAAyB,cAE5C,SAAAT,CAAA,CACH,EAEDG,GACClG,EAAA,kBAAA,IAACoF,GAAA,CACC,UAAU,0BACV,SAAS,KACT,MAAOoB,EAAa,uBAAyB,cAE5C,SAAAN,CAAA,CAAA,CACH,CAAA,CAEJ,CAEJ,EAEA,OAAAJ,EAAgB,YAAc,mBAAmBD,EAAU,aAAeA,EAAU,IAAI,GACjFC,CACT","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9]}
1
+ {"version":3,"file":"withFormControl-wZA87Sd4.js","sources":["../../node_modules/@ark-ui/react/dist/components/field/field-error-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-helper-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-label.js","../../node_modules/@ark-ui/react/dist/utils/use-safe-layout-effect.js","../../node_modules/@ark-ui/react/dist/components/fieldset/use-fieldset-context.js","../../node_modules/@ark-ui/react/dist/components/field/use-field.js","../../node_modules/@ark-ui/react/dist/components/field/field-root.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/create-icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/field/field.js","../../src/hocs/withFormControl/withFormControl.records.ts","../../src/hocs/withFormControl/withFormControl.tsx"],"sourcesContent":["'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldErrorText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field.getErrorTextProps(), props);\n if (field?.invalid) {\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n }\n return null;\n});\nFieldErrorText.displayName = \"FieldErrorText\";\n\nexport { FieldErrorText };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldHelperText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getHelperTextProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nFieldHelperText.displayName = \"FieldHelperText\";\n\nexport { FieldHelperText };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldLabel = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref });\n});\nFieldLabel.displayName = \"FieldLabel\";\n\nexport { FieldLabel };\n","'use client';\nimport { useLayoutEffect, useEffect } from 'react';\n\nconst useSafeLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\nexport { useSafeLayoutEffect };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [FieldsetProvider, useFieldsetContext] = createContext({\n name: \"FieldsetContext\",\n hookName: \"useFieldsetContext\",\n providerName: \"<FieldsetProvider />\",\n strict: false\n});\n\nexport { FieldsetProvider, useFieldsetContext };\n","'use client';\nimport { dataAttr, ariaAttr } from '@zag-js/dom-query';\nimport { useState, useId, useRef, useMemo } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\nimport { useSafeLayoutEffect } from '../../utils/use-safe-layout-effect.js';\nimport { useFieldsetContext } from '../fieldset/use-fieldset-context.js';\nimport { parts } from './field.anatomy.js';\n\nconst useField = (props = {}) => {\n const fieldset = useFieldsetContext();\n const env = useEnvironmentContext();\n const { ids, disabled = Boolean(fieldset?.disabled), invalid = false, readOnly = false, required = false } = props;\n const [hasErrorText, setHasErrorText] = useState(false);\n const [hasHelperText, setHasHelperText] = useState(false);\n const uid = useId();\n const id = props.id ?? uid;\n const rootRef = useRef(null);\n const rootId = ids?.control ?? `field::${id}`;\n const errorTextId = ids?.errorText ?? `field::${id}::error-text`;\n const helperTextId = ids?.helperText ?? `field::${id}::helper-text`;\n const labelId = ids?.label ?? `field::${id}::label`;\n useSafeLayoutEffect(() => {\n const rootNode = rootRef.current;\n if (!rootNode) return;\n const checkTextElements = () => {\n const docOrShadowRoot = env.getRootNode();\n setHasErrorText(!!docOrShadowRoot.getElementById(errorTextId));\n setHasHelperText(!!docOrShadowRoot.getElementById(helperTextId));\n };\n checkTextElements();\n const win = env.getWindow();\n const observer = new win.MutationObserver(checkTextElements);\n observer.observe(rootNode, { childList: true, subtree: true });\n return () => observer.disconnect();\n }, [env, errorTextId, helperTextId]);\n const labelIds = useMemo(() => {\n const ids2 = [];\n if (hasErrorText && invalid) ids2.push(errorTextId);\n if (hasHelperText) ids2.push(helperTextId);\n return ids2.join(\" \") || void 0;\n }, [invalid, errorTextId, helperTextId, hasErrorText, hasHelperText]);\n const getRootProps = useMemo(\n () => () => ({\n ...parts.root.attrs,\n id: rootId,\n ref: rootRef,\n role: \"group\",\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly)\n }),\n [disabled, invalid, readOnly, rootId]\n );\n const getLabelProps = useMemo(\n () => () => ({\n ...parts.label.attrs,\n id: labelId,\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly),\n htmlFor: id\n }),\n [disabled, invalid, readOnly, id, labelId]\n );\n const getControlProps = useMemo(\n () => () => ({\n \"aria-describedby\": labelIds,\n \"aria-invalid\": ariaAttr(invalid),\n \"data-invalid\": dataAttr(invalid),\n \"data-required\": dataAttr(required),\n \"data-readonly\": dataAttr(readOnly),\n id,\n required,\n disabled,\n readOnly\n }),\n [labelIds, invalid, required, readOnly, id, disabled]\n );\n const getInputProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.input.attrs\n }),\n [getControlProps]\n );\n const getTextareaProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.textarea.attrs\n }),\n [getControlProps]\n );\n const getSelectProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.select.attrs\n }),\n [getControlProps]\n );\n const getHelperTextProps = useMemo(\n () => () => ({\n id: helperTextId,\n ...parts.helperText.attrs,\n \"data-disabled\": dataAttr(disabled)\n }),\n [disabled, helperTextId]\n );\n const getErrorTextProps = useMemo(\n () => () => ({\n id: errorTextId,\n ...parts.errorText.attrs,\n \"aria-live\": \"polite\"\n }),\n [errorTextId]\n );\n const getRequiredIndicatorProps = useMemo(\n () => () => ({\n \"aria-hidden\": true,\n ...parts.requiredIndicator.attrs\n }),\n []\n );\n return {\n ariaDescribedby: labelIds,\n ids: {\n root: rootId,\n control: id,\n label: labelId,\n errorText: errorTextId,\n helperText: helperTextId\n },\n refs: {\n rootRef\n },\n disabled,\n invalid,\n readOnly,\n required,\n getLabelProps,\n getRootProps,\n getInputProps,\n getTextareaProps,\n getSelectProps,\n getHelperTextProps,\n getErrorTextProps,\n getRequiredIndicatorProps\n };\n};\n\nexport { useField };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { composeRefs } from '../../utils/compose-refs.js';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useField } from './use-field.js';\nimport { FieldProvider } from './use-field-context.js';\n\nconst FieldRoot = forwardRef((props, ref) => {\n const [useFieldProps, localProps] = createSplitProps()(props, [\n \"id\",\n \"ids\",\n \"disabled\",\n \"invalid\",\n \"readOnly\",\n \"required\"\n ]);\n const field = useField(useFieldProps);\n const mergedProps = mergeProps(field.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(FieldProvider, { value: field, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(ref, field.refs.rootRef) }) });\n});\nFieldRoot.displayName = \"FieldRoot\";\n\nexport { FieldRoot };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createRecipeContext } from '../../styled-system/create-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst { useRecipeResult, PropsProvider } = createRecipeContext({ key: \"icon\" });\nconst Icon = React.forwardRef(\n function Icon2(props, ref) {\n const {\n styles,\n className,\n props: otherProps\n } = useRecipeResult({ asChild: !props.as, ...props });\n return /* @__PURE__ */ jsx(\n chakra.svg,\n {\n ref,\n focusable: false,\n \"aria-hidden\": \"true\",\n ...otherProps,\n css: [styles, props.css],\n className: cx(className, props.className)\n }\n );\n }\n);\nconst IconPropsProvider = PropsProvider;\n\nexport { Icon, IconPropsProvider };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Children, forwardRef } from 'react';\nimport { Icon } from './icon.js';\n\nfunction createIcon(options) {\n const {\n viewBox = \"0 0 24 24\",\n d: pathDefinition,\n displayName,\n defaultProps = {}\n } = options;\n const path = Children.toArray(options.path);\n const Comp = forwardRef((props, ref) => /* @__PURE__ */ jsx(\n Icon,\n {\n ref,\n asChild: false,\n viewBox,\n ...defaultProps,\n ...props,\n children: path.length ? path : /* @__PURE__ */ jsx(\"path\", { fill: \"currentColor\", d: pathDefinition })\n }\n ));\n Comp.displayName = displayName;\n return Comp;\n}\n\nexport { createIcon };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Field, useFieldContext } from '@ark-ui/react/field';\nimport { forwardRef } from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\nimport { createIcon } from '../icon/create-icon.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useFieldStyles,\n useClassNames,\n PropsProvider\n} = createSlotRecipeContext({ key: \"field\" });\nconst FieldRoot = withProvider(\n Field.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst FieldPropsProvider = PropsProvider;\nconst FieldLabel = withContext(\n Field.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst FieldHelperText = withContext(Field.HelperText, \"helperText\", { forwardAsChild: true });\nconst FieldErrorText = withContext(\n Field.ErrorText,\n \"errorText\",\n { forwardAsChild: true }\n);\nconst FieldErrorIcon = createIcon({\n d: \"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z\"\n});\nconst FieldRequiredIndicator = forwardRef(function RequiredIndicator(props, ref) {\n const { fallback, children = \"*\", ...restProps } = props;\n const field = useFieldContext();\n const classNames = useClassNames();\n const styles = useFieldStyles();\n if (!field?.required) {\n return fallback;\n }\n return /* @__PURE__ */ jsx(\n chakra.span,\n {\n ref,\n \"aria-hidden\": \"true\",\n ...restProps,\n className: cx(classNames.requiredIndicator, props.className),\n css: [styles.requiredIndicator, props.css],\n children\n }\n );\n});\n\nexport { FieldErrorIcon, FieldErrorText, FieldHelperText, FieldLabel, FieldPropsProvider, FieldRequiredIndicator, FieldRoot, useFieldStyles };\n","import { FormControlSize } from './withFormControl.types';\n\nexport const optionalTextSizeMap: Record<FormControlSize, number> = {\n sm: 10,\n md: 12,\n lg: 14,\n};\n","import React from 'react';\nimport { Field } from '@chakra-ui/react/field';\nimport { FormControlLabelPosition, FormControlSize } from './withFormControl.types';\nimport { SystemStyleObject } from '@chakra-ui/react/styled-system';\nimport { TypographyVariant } from 'shared/types/typography';\nimport { Text } from 'components/Text/text.component';\nimport { optionalTextSizeMap } from './withFormControl.records';\nimport { fontSizes } from 'theme/tokens/typography/typography.records';\nimport { Flex } from '@chakra-ui/react/flex';\nimport { Icon } from 'components/Icon/icon.component';\nimport { Box } from '@chakra-ui/react/box';\n\nexport interface WithFormControlProps {\n /** If true, the form control will be disabled.\n * @default false\n */\n disabled?: boolean;\n /** The error text to be displayed when the form control is invalid.\n * @default Field is invalid\n */\n errorText?: string;\n /** Props to customize the form control. */\n formControlStyle?: SystemStyleObject;\n /** If true, the form control will take the full width of its container.\n * @default true\n */\n fullWidth?: boolean;\n /** The helper text to be displayed below the form control. */\n helperText?: string;\n /** If true, the form control will be displayed inline with the label. */\n inlineField?: boolean;\n /** If true, the form control will be invalid.\n * @default false\n */\n invalid?: boolean;\n /** The variant of the invalid icon.\n * @default danger\n */\n invalidIconColor?: TypographyVariant;\n /** The label to be displayed above the form control. */\n label?: string | React.ReactNode;\n /** The position of the label relative to the form control.\n * @default start\n */\n labelPosition?: FormControlLabelPosition;\n /** Props to customize the label. */\n labelStyle?: SystemStyleObject;\n /** If true, the form control will be styled for contrast mode.\n * @default false\n */\n onContrast?: boolean;\n /** If true, the form element will be read only.\n * @default false\n */\n readOnly?: boolean;\n /** If true, the form control will be required.\n * @default false\n */\n required?: boolean;\n /** If true, the form control will show an optional text.\n * @default false\n */\n showOptionalElement?: boolean;\n /** The size of the form control.\n * @default md\n */\n size?: FormControlSize;\n /** If true, the form control will show an invalid icon.\n * @default false\n */\n useInvalidIcon?: boolean;\n /** If true, the form control will show an invalid text.\n * @default true\n */\n useInvalidText?: boolean;\n}\n\nexport const withFormControl = <P extends WithFormControlProps>(Component: React.ComponentType<P>): React.FC<P> => {\n const WithFormControl = ({\n disabled = false,\n errorText = 'Field is invalid',\n formControlStyle,\n fullWidth = true,\n helperText,\n inlineField = false,\n invalid = false,\n invalidIconColor = 'danger',\n label,\n labelPosition = 'start',\n labelStyle,\n onContrast = false,\n readOnly = false,\n required = false,\n showOptionalElement = false,\n size = 'md',\n useInvalidIcon = false,\n useInvalidText = true,\n ...props\n }: WithFormControlProps): React.JSX.Element => {\n const labelComponent = (\n <Field.Label\n className=\"FormControl__Label\"\n color={onContrast ? 'text.contrast' : 'text'}\n display=\"flex\"\n flexDirection=\"row\"\n gap={1}\n fontSize={fontSizes[size]}\n fontWeight=\"semibold\"\n {...labelStyle}\n onClick={(e) => {\n e.stopPropagation();\n }}\n >\n <Box as=\"span\">{label}</Box>\n <Field.RequiredIndicator\n className=\"FormControl__RequiredIndicator\"\n color={onContrast ? 'text.danger.contrast' : 'text.danger'}\n {...(!required && {\n fallback: showOptionalElement ? (\n <Text\n as=\"span\"\n variant={onContrast ? 'subtleOnContrast' : 'subtle'}\n fontSize={optionalTextSizeMap[size]}\n display=\"contents\"\n ml={1}\n >\n (Optional)\n </Text>\n ) : (\n <></>\n ),\n })}\n />\n </Field.Label>\n );\n\n return (\n <Field.Root\n className=\"FormControl group\"\n disabled={disabled}\n invalid={invalid}\n readOnly={readOnly}\n required={required}\n width={fullWidth ? '100%' : 'auto'}\n {...formControlStyle}\n >\n <Flex\n className=\"FormControl__Container\"\n flexDirection={inlineField ? 'row' : 'column'}\n w={inlineField ? 'max-content' : '100%'}\n gap={2}\n alignItems={inlineField ? 'center' : 'flex-start'}\n >\n {label && labelPosition === 'start' && labelComponent}\n <Flex className=\"FormControl__Content\" alignItems=\"center\" gap={2} w={inlineField ? 'max-content' : '100%'}>\n <Component\n disabled={disabled}\n invalid={invalid}\n onContrast={onContrast}\n readOnly={readOnly}\n required={required}\n size={size}\n {...(props as P)}\n />\n {useInvalidIcon && invalid && (\n <Icon className=\"FormControl__InvalidIcon\" name=\"warningSign\" variant={invalidIconColor} size={size} />\n )}\n </Flex>\n {label && labelPosition === 'end' && labelComponent}\n </Flex>\n {useInvalidText && invalid && (\n <Field.ErrorText\n className=\"FormControl__ErrorText\"\n fontSize=\"xs\"\n color={onContrast ? 'text.danger.contrast' : 'text.danger'}\n >\n {errorText}\n </Field.ErrorText>\n )}\n {helperText && (\n <Field.HelperText\n className=\"FormControl__HelperText\"\n fontSize=\"xs\"\n color={onContrast ? 'text.subtle.contrast' : 'text.subtle'}\n >\n {helperText}\n </Field.HelperText>\n )}\n </Field.Root>\n );\n };\n\n WithFormControl.displayName = `withFormControl(${Component.displayName || Component.name}`;\n return WithFormControl;\n};\n"],"names":["FieldErrorText","forwardRef","props","ref","field","useFieldContext","mergedProps","mergeProps","jsx","ark","FieldHelperText","FieldLabel","useSafeLayoutEffect","useLayoutEffect","useEffect","FieldsetProvider","useFieldsetContext","createContext","useField","fieldset","env","useEnvironmentContext","ids","disabled","invalid","readOnly","required","hasErrorText","setHasErrorText","useState","hasHelperText","setHasHelperText","uid","useId","id","rootRef","useRef","rootId","errorTextId","helperTextId","labelId","rootNode","checkTextElements","docOrShadowRoot","win","observer","labelIds","useMemo","ids2","getRootProps","parts","dataAttr","getLabelProps","getControlProps","ariaAttr","getInputProps","getTextareaProps","getSelectProps","getHelperTextProps","getErrorTextProps","getRequiredIndicatorProps","FieldRoot","useFieldProps","localProps","createSplitProps","FieldProvider","composeRefs","useRecipeResult","createRecipeContext","Icon","React","styles","className","otherProps","chakra","cx","createIcon","options","viewBox","pathDefinition","displayName","defaultProps","path","Children","Comp","withProvider","withContext","useFieldStyles","useClassNames","createSlotRecipeContext","Field.Root","Field.Label","Field.HelperText","Field.ErrorText","FieldRequiredIndicator","fallback","children","restProps","classNames","optionalTextSizeMap","withFormControl","Component","WithFormControl","errorText","formControlStyle","fullWidth","helperText","inlineField","invalidIconColor","label","labelPosition","labelStyle","onContrast","showOptionalElement","size","useInvalidIcon","useInvalidText","labelComponent","jsxs","fontSizes","e","Box","Field.RequiredIndicator","Text","Fragment","Flex"],"mappings":"s3BAOMA,EAAiBC,EAAU,WAAC,CAACC,EAAOC,IAAQ,CAChD,MAAMC,EAAQC,EAAAA,gBAAiB,EACzBC,EAAcC,EAAU,WAACH,EAAM,kBAAiB,EAAIF,CAAK,EAC/D,OAAIE,GAAO,QACcI,EAAAA,kBAAAA,IAAIC,EAAAA,IAAI,KAAM,CAAE,GAAGH,EAAa,IAAAH,EAAK,EAEvD,IACT,CAAC,EACDH,EAAe,YAAc,iBCR7B,MAAMU,EAAkBT,EAAU,WAAC,CAACC,EAAOC,IAAQ,CACjD,MAAMC,EAAQC,EAAAA,gBAAiB,EACzBC,EAAcC,EAAU,WAACH,GAAO,mBAAkB,EAAIF,CAAK,EACjE,OAAuBM,EAAAA,kBAAAA,IAAIC,EAAAA,IAAI,KAAM,CAAE,GAAGH,EAAa,IAAAH,EAAK,CAC9D,CAAC,EACDO,EAAgB,YAAc,kBCL9B,MAAMC,EAAaV,EAAU,WAAC,CAACC,EAAOC,IAAQ,CAC5C,MAAMC,EAAQC,EAAAA,gBAAiB,EACzBC,EAAcC,EAAU,WAACH,GAAO,cAAa,EAAIF,CAAK,EAC5D,OAAuBM,EAAAA,kBAAAA,IAAIC,EAAAA,IAAI,MAAO,CAAE,GAAGH,EAAa,IAAAH,EAAK,CAC/D,CAAC,EACDQ,EAAW,YAAc,aCTzB,MAAMC,GAAsB,OAAO,OAAW,IAAcC,EAAe,gBAAGC,EAAS,UCAjF,CAACC,GAAkBC,EAAkB,EAAIC,gBAAc,CAC3D,KAAM,kBACN,SAAU,qBACV,aAAc,uBACd,OAAQ,EACV,CAAC,ECAKC,GAAW,CAAChB,EAAQ,KAA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yBACV,SAAS,KACT,MAAOmB,EAAa,uBAAyB,cAE5C,SAAAT,CAAA,CACH,EAEDG,GACClG,EAAA,kBAAA,IAACoF,GAAA,CACC,UAAU,0BACV,SAAS,KACT,MAAOoB,EAAa,uBAAyB,cAE5C,SAAAN,CAAA,CAAA,CACH,CAAA,CAEJ,CAEJ,EAEA,OAAAJ,EAAgB,YAAc,mBAAmBD,EAAU,aAAeA,EAAU,IAAI,GACjFC,CACT","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9]}
@@ -1,2 +1,2 @@
1
- "use strict";const c=require("./jsx-runtime-BjDatQAs.js"),r=require("react"),j=require("./index-BQRnVsAg.js"),_=require("./tooltip.component-Cn9JSqUn.js"),g=e=>e&&e.__esModule?e:{default:e},k=g(r),d=e=>{if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);if(k.default.isValidElement(e)){const n=e;if(n.props.children)return d(n.props.children)}return Array.isArray(e)?e.map(d).join(" "):""},y=e=>{function n({truncated:l=!1,noOfLines:m=1,children:i,tooltipProps:a,["data-testid"]:o="kibble-truncated-text",...w}){const[p,b]=r.useState(!1),s=r.useRef(null),T=r.useRef(null),u=r.useRef(null),f=r.useCallback(()=>{if(!s.current)return;const t=s.current.children[0];if(!t)return;T.current=t;const x=t.scrollHeight>t.clientHeight;b(x)},[]);r.useEffect(()=>{if(!l)return;let t;const x=()=>{window.clearTimeout(t),t=window.setTimeout(f,100)},v=window.setTimeout(f,50);return s.current&&(u.current=new ResizeObserver(()=>{x()}),u.current.observe(s.current)),()=>{window.clearTimeout(t),window.clearTimeout(v),u.current&&u.current.disconnect()}},[l,f,i,m]);const R=r.useMemo(()=>a?.label||d(i),[i,a?.label]);return l?c.jsxRuntimeExports.jsx(_.Tooltip,{...a,label:R,disabled:!p,"data-testid":`${o}-tooltip`,children:c.jsxRuntimeExports.jsx(j.Box,{ref:s,width:"100%",minWidth:0,overflow:"hidden",flex:"1 1 auto",className:"TruncatedText__Wrapper","data-testid":`${o}-wrapper`,children:c.jsxRuntimeExports.jsx(e,{className:"TruncatedText__TextContent","data-testid":`${o}-content`,css:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:m,overflow:"hidden",textOverflow:"ellipsis"},...w,children:i})})}):c.jsxRuntimeExports.jsx(e,{...w,"data-testid":o,children:i})}return n.displayName=`withTruncation(${e.displayName||e.name})`,n};exports.withTruncation=y;
2
- //# sourceMappingURL=withTruncation-DrxrJuSQ.js.map
1
+ "use strict";const c=require("./jsx-runtime-BjDatQAs.js"),r=require("react"),j=require("./index-BQRnVsAg.js"),_=require("./tooltip.component-BkFDi5yK.js"),g=e=>e&&e.__esModule?e:{default:e},k=g(r),d=e=>{if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);if(k.default.isValidElement(e)){const n=e;if(n.props.children)return d(n.props.children)}return Array.isArray(e)?e.map(d).join(" "):""},y=e=>{function n({truncated:l=!1,noOfLines:m=1,children:i,tooltipProps:a,["data-testid"]:o="kibble-truncated-text",...w}){const[p,b]=r.useState(!1),s=r.useRef(null),T=r.useRef(null),u=r.useRef(null),f=r.useCallback(()=>{if(!s.current)return;const t=s.current.children[0];if(!t)return;T.current=t;const x=t.scrollHeight>t.clientHeight;b(x)},[]);r.useEffect(()=>{if(!l)return;let t;const x=()=>{window.clearTimeout(t),t=window.setTimeout(f,100)},v=window.setTimeout(f,50);return s.current&&(u.current=new ResizeObserver(()=>{x()}),u.current.observe(s.current)),()=>{window.clearTimeout(t),window.clearTimeout(v),u.current&&u.current.disconnect()}},[l,f,i,m]);const R=r.useMemo(()=>a?.label||d(i),[i,a?.label]);return l?c.jsxRuntimeExports.jsx(_.Tooltip,{...a,label:R,disabled:!p,"data-testid":`${o}-tooltip`,children:c.jsxRuntimeExports.jsx(j.Box,{ref:s,width:"100%",minWidth:0,overflow:"hidden",flex:"1 1 auto",className:"TruncatedText__Wrapper","data-testid":`${o}-wrapper`,children:c.jsxRuntimeExports.jsx(e,{className:"TruncatedText__TextContent","data-testid":`${o}-content`,css:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:m,overflow:"hidden",textOverflow:"ellipsis"},...w,children:i})})}):c.jsxRuntimeExports.jsx(e,{...w,"data-testid":o,children:i})}return n.displayName=`withTruncation(${e.displayName||e.name})`,n};exports.withTruncation=y;
2
+ //# sourceMappingURL=withTruncation-DE3FFPE7.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"withTruncation-DrxrJuSQ.js","sources":["../../src/hocs/withTruncation.tsx"],"sourcesContent":["import React, { ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { Box } from '@chakra-ui/react/box';\nimport { Tooltip, TooltipProps } from 'components/Tooltip';\n\nexport interface WithTruncationProps {\n /** If true, the text will be truncated. */\n truncated?: boolean;\n /** The number of lines to truncate the text to. */\n noOfLines?: number;\n /** Props to customize the tooltip. See `Tooltip` for more information. */\n tooltipProps?: Omit<TooltipProps, 'disabled'>;\n /** The children to be displayed inside the truncated text. */\n children?: ReactNode | string;\n /** Data test id for the truncated text.\n * @default kibble-truncated-text\n */\n 'data-testid'?: string;\n}\n\n/**\n * Helper function to extract text content from ReactNode\n */\nconst getTextFromChildren = (children: ReactNode | string): string => {\n if (typeof children === 'string') {\n return children;\n }\n if (typeof children === 'number' || typeof children === 'boolean') {\n return String(children);\n }\n if (React.isValidElement(children)) {\n const element = children as React.ReactElement<{ children?: ReactNode }>;\n if (element.props.children) {\n return getTextFromChildren(element.props.children);\n }\n }\n if (Array.isArray(children)) {\n return children.map(getTextFromChildren).join(' ');\n }\n return '';\n};\n\nexport const withTruncation = <P extends WithTruncationProps>(Component: React.ComponentType<P>): React.FC<P> => {\n function WithTruncation({\n truncated = false,\n noOfLines = 1,\n children,\n tooltipProps,\n ['data-testid']: dataTestId = 'kibble-truncated-text',\n ...rest\n }: WithTruncationProps): React.JSX.Element {\n const [isTextOverFlowing, setIsTextOverFlowing] = useState<boolean>(false);\n const containerRef = useRef<HTMLDivElement>(null);\n const textElementRef = useRef<HTMLElement | null>(null);\n const resizeObserverRef = useRef<ResizeObserver | null>(null);\n\n const checkOverflow = useCallback(() => {\n if (!containerRef.current) return;\n\n // Get the actual text element (first child)\n const textElement = containerRef.current.children[0] as HTMLElement;\n if (!textElement) return;\n\n textElementRef.current = textElement;\n\n // Check if text is overflowing\n const isOverflowing = textElement.scrollHeight > textElement.clientHeight;\n setIsTextOverFlowing(isOverflowing);\n }, []);\n\n useEffect(() => {\n if (!truncated) return;\n\n let timeoutId: number;\n\n const debouncedCheck = (): void => {\n window.clearTimeout(timeoutId);\n timeoutId = window.setTimeout(checkOverflow, 100);\n };\n\n // Initial check with a slight delay to ensure rendering is complete\n const initialCheckTimeout = window.setTimeout(checkOverflow, 50);\n\n // Observe the container for resize events\n if (containerRef.current) {\n resizeObserverRef.current = new ResizeObserver(() => {\n debouncedCheck();\n });\n resizeObserverRef.current.observe(containerRef.current);\n }\n\n return (): void => {\n window.clearTimeout(timeoutId);\n window.clearTimeout(initialCheckTimeout);\n if (resizeObserverRef.current) {\n resizeObserverRef.current.disconnect();\n }\n };\n }, [truncated, checkOverflow, children, noOfLines]);\n\n const tooltipLabel = useMemo(\n () => tooltipProps?.label || getTextFromChildren(children),\n [children, tooltipProps?.label],\n );\n\n if (!truncated) {\n return (\n <Component {...(rest as P)} data-testid={dataTestId}>\n {children}\n </Component>\n );\n }\n\n return (\n <Tooltip\n {...tooltipProps}\n label={tooltipLabel}\n disabled={!isTextOverFlowing}\n data-testid={`${dataTestId}-tooltip`}\n >\n <Box\n ref={containerRef}\n width=\"100%\"\n minWidth={0}\n overflow=\"hidden\"\n flex=\"1 1 auto\"\n className=\"TruncatedText__Wrapper\"\n data-testid={`${dataTestId}-wrapper`}\n >\n <Component\n className=\"TruncatedText__TextContent\"\n data-testid={`${dataTestId}-content`}\n css={{\n display: '-webkit-box',\n WebkitBoxOrient: 'vertical',\n WebkitLineClamp: noOfLines,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n }}\n {...(rest as P)}\n >\n {children}\n </Component>\n </Box>\n </Tooltip>\n );\n }\n\n WithTruncation.displayName = `withTruncation(${Component.displayName || Component.name})`;\n return WithTruncation;\n};\n"],"names":["getTextFromChildren","children","React","element","withTruncation","Component","WithTruncation","truncated","noOfLines","tooltipProps","dataTestId","rest","isTextOverFlowing","setIsTextOverFlowing","useState","containerRef","useRef","textElementRef","resizeObserverRef","checkOverflow","useCallback","textElement","isOverflowing","useEffect","timeoutId","debouncedCheck","initialCheckTimeout","tooltipLabel","useMemo","jsx","Tooltip","Box"],"mappings":"qMAsBMA,EAAuBC,GAAyC,CAChE,GAAA,OAAOA,GAAa,SACf,OAAAA,EAET,GAAI,OAAOA,GAAa,UAAY,OAAOA,GAAa,UACtD,OAAO,OAAOA,CAAQ,EAEpB,GAAAC,EAAA,QAAM,eAAeD,CAAQ,EAAG,CAClC,MAAME,EAAUF,EACZ,GAAAE,EAAQ,MAAM,SACT,OAAAH,EAAoBG,EAAQ,MAAM,QAAQ,CACnD,CAEE,OAAA,MAAM,QAAQF,CAAQ,EACjBA,EAAS,IAAID,CAAmB,EAAE,KAAK,GAAG,EAE5C,EACT,EAEaI,EAAiDC,GAAmD,CAC/G,SAASC,EAAe,CACtB,UAAAC,EAAY,GACZ,UAAAC,EAAY,EACZ,SAAAP,EACA,aAAAQ,EACA,CAAC,aAAa,EAAGC,EAAa,wBAC9B,GAAGC,CAAA,EACsC,CACzC,KAAM,CAACC,EAAmBC,CAAoB,EAAIC,EAAAA,SAAkB,EAAK,EACnEC,EAAeC,SAAuB,IAAI,EAC1CC,EAAiBD,SAA2B,IAAI,EAChDE,EAAoBF,SAA8B,IAAI,EAEtDG,EAAgBC,EAAAA,YAAY,IAAM,CAClC,GAAA,CAACL,EAAa,QAAS,OAG3B,MAAMM,EAAcN,EAAa,QAAQ,SAAS,CAAC,EACnD,GAAI,CAACM,EAAa,OAElBJ,EAAe,QAAUI,EAGnB,MAAAC,EAAgBD,EAAY,aAAeA,EAAY,aAC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AAI,IAC/EC,CACT"}
1
+ {"version":3,"file":"withTruncation-DE3FFPE7.js","sources":["../../src/hocs/withTruncation.tsx"],"sourcesContent":["import React, { ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { Box } from '@chakra-ui/react/box';\nimport { Tooltip, TooltipProps } from 'components/Tooltip';\n\nexport interface WithTruncationProps {\n /** If true, the text will be truncated. */\n truncated?: boolean;\n /** The number of lines to truncate the text to. */\n noOfLines?: number;\n /** Props to customize the tooltip. See `Tooltip` for more information. */\n tooltipProps?: Omit<TooltipProps, 'disabled'>;\n /** The children to be displayed inside the truncated text. */\n children?: ReactNode | string;\n /** Data test id for the truncated text.\n * @default kibble-truncated-text\n */\n 'data-testid'?: string;\n}\n\n/**\n * Helper function to extract text content from ReactNode\n */\nconst getTextFromChildren = (children: ReactNode | string): string => {\n if (typeof children === 'string') {\n return children;\n }\n if (typeof children === 'number' || typeof children === 'boolean') {\n return String(children);\n }\n if (React.isValidElement(children)) {\n const element = children as React.ReactElement<{ children?: ReactNode }>;\n if (element.props.children) {\n return getTextFromChildren(element.props.children);\n }\n }\n if (Array.isArray(children)) {\n return children.map(getTextFromChildren).join(' ');\n }\n return '';\n};\n\nexport const withTruncation = <P extends WithTruncationProps>(Component: React.ComponentType<P>): React.FC<P> => {\n function WithTruncation({\n truncated = false,\n noOfLines = 1,\n children,\n tooltipProps,\n ['data-testid']: dataTestId = 'kibble-truncated-text',\n ...rest\n }: WithTruncationProps): React.JSX.Element {\n const [isTextOverFlowing, setIsTextOverFlowing] = useState<boolean>(false);\n const containerRef = useRef<HTMLDivElement>(null);\n const textElementRef = useRef<HTMLElement | null>(null);\n const resizeObserverRef = useRef<ResizeObserver | null>(null);\n\n const checkOverflow = useCallback(() => {\n if (!containerRef.current) return;\n\n // Get the actual text element (first child)\n const textElement = containerRef.current.children[0] as HTMLElement;\n if (!textElement) return;\n\n textElementRef.current = textElement;\n\n // Check if text is overflowing\n const isOverflowing = textElement.scrollHeight > textElement.clientHeight;\n setIsTextOverFlowing(isOverflowing);\n }, []);\n\n useEffect(() => {\n if (!truncated) return;\n\n let timeoutId: number;\n\n const debouncedCheck = (): void => {\n window.clearTimeout(timeoutId);\n timeoutId = window.setTimeout(checkOverflow, 100);\n };\n\n // Initial check with a slight delay to ensure rendering is complete\n const initialCheckTimeout = window.setTimeout(checkOverflow, 50);\n\n // Observe the container for resize events\n if (containerRef.current) {\n resizeObserverRef.current = new ResizeObserver(() => {\n debouncedCheck();\n });\n resizeObserverRef.current.observe(containerRef.current);\n }\n\n return (): void => {\n window.clearTimeout(timeoutId);\n window.clearTimeout(initialCheckTimeout);\n if (resizeObserverRef.current) {\n resizeObserverRef.current.disconnect();\n }\n };\n }, [truncated, checkOverflow, children, noOfLines]);\n\n const tooltipLabel = useMemo(\n () => tooltipProps?.label || getTextFromChildren(children),\n [children, tooltipProps?.label],\n );\n\n if (!truncated) {\n return (\n <Component {...(rest as P)} data-testid={dataTestId}>\n {children}\n </Component>\n );\n }\n\n return (\n <Tooltip\n {...tooltipProps}\n label={tooltipLabel}\n disabled={!isTextOverFlowing}\n data-testid={`${dataTestId}-tooltip`}\n >\n <Box\n ref={containerRef}\n width=\"100%\"\n minWidth={0}\n overflow=\"hidden\"\n flex=\"1 1 auto\"\n className=\"TruncatedText__Wrapper\"\n data-testid={`${dataTestId}-wrapper`}\n >\n <Component\n className=\"TruncatedText__TextContent\"\n data-testid={`${dataTestId}-content`}\n css={{\n display: '-webkit-box',\n WebkitBoxOrient: 'vertical',\n WebkitLineClamp: noOfLines,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n }}\n {...(rest as P)}\n >\n {children}\n </Component>\n </Box>\n </Tooltip>\n );\n }\n\n WithTruncation.displayName = `withTruncation(${Component.displayName || Component.name})`;\n return WithTruncation;\n};\n"],"names":["getTextFromChildren","children","React","element","withTruncation","Component","WithTruncation","truncated","noOfLines","tooltipProps","dataTestId","rest","isTextOverFlowing","setIsTextOverFlowing","useState","containerRef","useRef","textElementRef","resizeObserverRef","checkOverflow","useCallback","textElement","isOverflowing","useEffect","timeoutId","debouncedCheck","initialCheckTimeout","tooltipLabel","useMemo","jsx","Tooltip","Box"],"mappings":"qMAsBMA,EAAuBC,GAAyC,CAChE,GAAA,OAAOA,GAAa,SACf,OAAAA,EAET,GAAI,OAAOA,GAAa,UAAY,OAAOA,GAAa,UACtD,OAAO,OAAOA,CAAQ,EAEpB,GAAAC,EAAA,QAAM,eAAeD,CAAQ,EAAG,CAClC,MAAME,EAAUF,EACZ,GAAAE,EAAQ,MAAM,SACT,OAAAH,EAAoBG,EAAQ,MAAM,QAAQ,CACnD,CAEE,OAAA,MAAM,QAAQF,CAAQ,EACjBA,EAAS,IAAID,CAAmB,EAAE,KAAK,GAAG,EAE5C,EACT,EAEaI,EAAiDC,GAAmD,CAC/G,SAASC,EAAe,CACtB,UAAAC,EAAY,GACZ,UAAAC,EAAY,EACZ,SAAAP,EACA,aAAAQ,EACA,CAAC,aAAa,EAAGC,EAAa,wBAC9B,GAAGC,CAAA,EACsC,CACzC,KAAM,CAACC,EAAmBC,CAAoB,EAAIC,EAAAA,SAAkB,EAAK,EACnEC,EAAeC,SAAuB,IAAI,EAC1CC,EAAiBD,SAA2B,IAAI,EAChDE,EAAoBF,SAA8B,IAAI,EAEtDG,EAAgBC,EAAAA,YAAY,IAAM,CAClC,GAAA,CAACL,EAAa,QAAS,OAG3B,MAAMM,EAAcN,EAAa,QAAQ,SAAS,CAAC,EACnD,GAAI,CAACM,EAAa,OAElBJ,EAAe,QAAUI,EAGnB,MAAAC,EAAgBD,EAAY,aAAeA,EAAY,aAC7DR,EAAqBS,CAAa,CACpC,EAAG,EAAE,EAELC,EAAAA,UAAU,IAAM,CACd,GAAI,CAAChB,EAAW,OAEZ,IAAAiB,EAEJ,MAAMC,EAAiB,IAAY,CACjC,OAAO,aAAaD,CAAS,EACjBA,EAAA,OAAO,WAAWL,EAAe,GAAG,CAClD,EAGMO,EAAsB,OAAO,WAAWP,EAAe,EAAE,EAG/D,OAAIJ,EAAa,UACGG,EAAA,QAAU,IAAI,eAAe,IAAM,CACpCO,EAAA,CAAA,CAChB,EACiBP,EAAA,QAAQ,QAAQH,EAAa,OAAO,GAGjD,IAAY,CACjB,OAAO,aAAaS,CAAS,EAC7B,OAAO,aAAaE,CAAmB,EACnCR,EAAkB,SACpBA,EAAkB,QAAQ,WAAW,CAEzC,GACC,CAACX,EAAWY,EAAelB,EAAUO,CAAS,CAAC,EAElD,MAAMmB,EAAeC,EAAA,QACnB,IAAMnB,GAAc,OAAST,EAAoBC,CAAQ,EACzD,CAACA,EAAUQ,GAAc,KAAK,CAChC,EAEA,OAAKF,EASHsB,EAAA,kBAAA,IAACC,EAAA,QAAA,CACE,GAAGrB,EACJ,MAAOkB,EACP,SAAU,CAACf,EACX,cAAa,GAAGF,CAAU,WAE1B,SAAAmB,EAAA,kBAAA,IAACE,EAAA,IAAA,CACC,IAAKhB,EACL,MAAM,OACN,SAAU,EACV,SAAS,SACT,KAAK,WACL,UAAU,yBACV,cAAa,GAAGL,CAAU,WAE1B,SAAAmB,EAAA,kBAAA,IAACxB,EAAA,CACC,UAAU,6BACV,cAAa,GAAGK,CAAU,WAC1B,IAAK,CACH,QAAS,cACT,gBAAiB,WACjB,gBAAiBF,EACjB,SAAU,SACV,aAAc,UAChB,EACC,GAAIG,EAEJ,SAAAV,CAAA,CAAA,CACH,CAAA,CACF,CACF,0BArCGI,EAAW,CAAA,GAAIM,EAAY,cAAaD,EACtC,SAAAT,EACH,CAmCF,CAIJ,OAAAK,EAAe,YAAc,kBAAkBD,EAAU,aAAeA,EAAU,IAAI,IAC/EC,CACT"}
@@ -1,7 +1,7 @@
1
1
  import { j as a } from "./jsx-runtime-C5mzlN2N.js";
2
2
  import k, { useState as y, useRef as m, useCallback as j, useEffect as O, useMemo as R } from "react";
3
3
  import { B as h } from "./index-9BerxEcw.js";
4
- import { T as _ } from "./tooltip.component-CiiT7r7V.js";
4
+ import { T as _ } from "./tooltip.component-C_NS-AoH.js";
5
5
  const w = (e) => {
6
6
  if (typeof e == "string")
7
7
  return e;
@@ -89,4 +89,4 @@ const w = (e) => {
89
89
  export {
90
90
  B as w
91
91
  };
92
- //# sourceMappingURL=withTruncation-DeEu1ylr.js.map
92
+ //# sourceMappingURL=withTruncation-DTCfQ2yk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"withTruncation-DeEu1ylr.js","sources":["../../src/hocs/withTruncation.tsx"],"sourcesContent":["import React, { ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { Box } from '@chakra-ui/react/box';\nimport { Tooltip, TooltipProps } from 'components/Tooltip';\n\nexport interface WithTruncationProps {\n /** If true, the text will be truncated. */\n truncated?: boolean;\n /** The number of lines to truncate the text to. */\n noOfLines?: number;\n /** Props to customize the tooltip. See `Tooltip` for more information. */\n tooltipProps?: Omit<TooltipProps, 'disabled'>;\n /** The children to be displayed inside the truncated text. */\n children?: ReactNode | string;\n /** Data test id for the truncated text.\n * @default kibble-truncated-text\n */\n 'data-testid'?: string;\n}\n\n/**\n * Helper function to extract text content from ReactNode\n */\nconst getTextFromChildren = (children: ReactNode | string): string => {\n if (typeof children === 'string') {\n return children;\n }\n if (typeof children === 'number' || typeof children === 'boolean') {\n return String(children);\n }\n if (React.isValidElement(children)) {\n const element = children as React.ReactElement<{ children?: ReactNode }>;\n if (element.props.children) {\n return getTextFromChildren(element.props.children);\n }\n }\n if (Array.isArray(children)) {\n return children.map(getTextFromChildren).join(' ');\n }\n return '';\n};\n\nexport const withTruncation = <P extends WithTruncationProps>(Component: React.ComponentType<P>): React.FC<P> => {\n function WithTruncation({\n truncated = false,\n noOfLines = 1,\n children,\n tooltipProps,\n ['data-testid']: dataTestId = 'kibble-truncated-text',\n ...rest\n }: WithTruncationProps): React.JSX.Element {\n const [isTextOverFlowing, setIsTextOverFlowing] = useState<boolean>(false);\n const containerRef = useRef<HTMLDivElement>(null);\n const textElementRef = useRef<HTMLElement | null>(null);\n const resizeObserverRef = useRef<ResizeObserver | null>(null);\n\n const checkOverflow = useCallback(() => {\n if (!containerRef.current) return;\n\n // Get the actual text element (first child)\n const textElement = containerRef.current.children[0] as HTMLElement;\n if (!textElement) return;\n\n textElementRef.current = textElement;\n\n // Check if text is overflowing\n const isOverflowing = textElement.scrollHeight > textElement.clientHeight;\n setIsTextOverFlowing(isOverflowing);\n }, []);\n\n useEffect(() => {\n if (!truncated) return;\n\n let timeoutId: number;\n\n const debouncedCheck = (): void => {\n window.clearTimeout(timeoutId);\n timeoutId = window.setTimeout(checkOverflow, 100);\n };\n\n // Initial check with a slight delay to ensure rendering is complete\n const initialCheckTimeout = window.setTimeout(checkOverflow, 50);\n\n // Observe the container for resize events\n if (containerRef.current) {\n resizeObserverRef.current = new ResizeObserver(() => {\n debouncedCheck();\n });\n resizeObserverRef.current.observe(containerRef.current);\n }\n\n return (): void => {\n window.clearTimeout(timeoutId);\n window.clearTimeout(initialCheckTimeout);\n if (resizeObserverRef.current) {\n resizeObserverRef.current.disconnect();\n }\n };\n }, [truncated, checkOverflow, children, noOfLines]);\n\n const tooltipLabel = useMemo(\n () => tooltipProps?.label || getTextFromChildren(children),\n [children, tooltipProps?.label],\n );\n\n if (!truncated) {\n return (\n <Component {...(rest as P)} data-testid={dataTestId}>\n {children}\n </Component>\n );\n }\n\n return (\n <Tooltip\n {...tooltipProps}\n label={tooltipLabel}\n disabled={!isTextOverFlowing}\n data-testid={`${dataTestId}-tooltip`}\n >\n <Box\n ref={containerRef}\n width=\"100%\"\n minWidth={0}\n overflow=\"hidden\"\n flex=\"1 1 auto\"\n className=\"TruncatedText__Wrapper\"\n data-testid={`${dataTestId}-wrapper`}\n >\n <Component\n className=\"TruncatedText__TextContent\"\n data-testid={`${dataTestId}-content`}\n css={{\n display: '-webkit-box',\n WebkitBoxOrient: 'vertical',\n WebkitLineClamp: noOfLines,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n }}\n {...(rest as P)}\n >\n {children}\n </Component>\n </Box>\n </Tooltip>\n );\n }\n\n WithTruncation.displayName = `withTruncation(${Component.displayName || Component.name})`;\n return WithTruncation;\n};\n"],"names":["getTextFromChildren","children","React","element","withTruncation","Component","WithTruncation","truncated","noOfLines","tooltipProps","dataTestId","rest","isTextOverFlowing","setIsTextOverFlowing","useState","containerRef","useRef","textElementRef","resizeObserverRef","checkOverflow","useCallback","textElement","isOverflowing","useEffect","timeoutId","debouncedCheck","initialCheckTimeout","tooltipLabel","useMemo","jsx","Tooltip","Box"],"mappings":";;;;AAsBA,MAAMA,IAAsB,CAACC,MAAyC;AAChE,MAAA,OAAOA,KAAa;AACf,WAAAA;AAET,MAAI,OAAOA,KAAa,YAAY,OAAOA,KAAa;AACtD,WAAO,OAAOA,CAAQ;AAEpB,MAAAC,EAAM,eAAeD,CAAQ,GAAG;AAClC,UAAME,IAAUF;AACZ,QAAAE,EAAQ,MAAM;AACT,aAAAH,EAAoBG,EAAQ,MAAM,QAAQ;AAAA,EACnD;AAEE,SAAA,MAAM,QAAQF,CAAQ,IACjBA,EAAS,IAAID,CAAmB,EAAE,KAAK,GAAG,IAE5C;AACT,GAEaI,IAAiB,CAAgCC,MAAmD;AAC/G,WAASC,EAAe;AAAA,IACtB,WAAAC,IAAY;AAAA,IACZ,WAAAC,IAAY;AAAA,IACZ,UAAAP;AAAA,IACA,cAAAQ;AAAA,IACA,CAAC,aAAa,GAAGC,IAAa;AAAA,IAC9B,GAAGC;AAAA,EAAA,GACsC;AACzC,UAAM,CAACC,GAAmBC,CAAoB,IAAIC,EAAkB,EAAK,GACnEC,IAAeC,EAAuB,IAAI,GAC1CC,IAAiBD,EAA2B,IAAI,GAChDE,IAAoBF,EAA8B,IAAI,GAEtDG,IAAgBC,EAAY,MAAM;AAClC,UAAA,CAACL,EAAa,QAAS;AAG3B,YAAMM,IAAcN,EAAa,QAAQ,SAAS,CAAC;AACnD,UAAI,CAACM,EAAa;AAElB,MAAAJ,EAAe,UAAUI;AAGnB,YAAAC,IAAgBD,EAAY,eAAeA,EAAY;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kBACjB,UAAU;AAAA,kBACV,cAAc;AAAA,gBAChB;AAAA,gBACC,GAAIG;AAAA,gBAEJ,UAAAV;AAAA,cAAA;AAAA,YAAA;AAAA,UACH;AAAA,QAAA;AAAA,MACF;AAAA,IACF,0BArCGI,GAAW,EAAA,GAAIM,GAAY,eAAaD,GACtC,UAAAT,GACH;AAAA,EAmCF;AAIJ,SAAAK,EAAe,cAAc,kBAAkBD,EAAU,eAAeA,EAAU,IAAI,KAC/EC;AACT;"}
1
+ {"version":3,"file":"withTruncation-DTCfQ2yk.js","sources":["../../src/hocs/withTruncation.tsx"],"sourcesContent":["import React, { ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { Box } from '@chakra-ui/react/box';\nimport { Tooltip, TooltipProps } from 'components/Tooltip';\n\nexport interface WithTruncationProps {\n /** If true, the text will be truncated. */\n truncated?: boolean;\n /** The number of lines to truncate the text to. */\n noOfLines?: number;\n /** Props to customize the tooltip. See `Tooltip` for more information. */\n tooltipProps?: Omit<TooltipProps, 'disabled'>;\n /** The children to be displayed inside the truncated text. */\n children?: ReactNode | string;\n /** Data test id for the truncated text.\n * @default kibble-truncated-text\n */\n 'data-testid'?: string;\n}\n\n/**\n * Helper function to extract text content from ReactNode\n */\nconst getTextFromChildren = (children: ReactNode | string): string => {\n if (typeof children === 'string') {\n return children;\n }\n if (typeof children === 'number' || typeof children === 'boolean') {\n return String(children);\n }\n if (React.isValidElement(children)) {\n const element = children as React.ReactElement<{ children?: ReactNode }>;\n if (element.props.children) {\n return getTextFromChildren(element.props.children);\n }\n }\n if (Array.isArray(children)) {\n return children.map(getTextFromChildren).join(' ');\n }\n return '';\n};\n\nexport const withTruncation = <P extends WithTruncationProps>(Component: React.ComponentType<P>): React.FC<P> => {\n function WithTruncation({\n truncated = false,\n noOfLines = 1,\n children,\n tooltipProps,\n ['data-testid']: dataTestId = 'kibble-truncated-text',\n ...rest\n }: WithTruncationProps): React.JSX.Element {\n const [isTextOverFlowing, setIsTextOverFlowing] = useState<boolean>(false);\n const containerRef = useRef<HTMLDivElement>(null);\n const textElementRef = useRef<HTMLElement | null>(null);\n const resizeObserverRef = useRef<ResizeObserver | null>(null);\n\n const checkOverflow = useCallback(() => {\n if (!containerRef.current) return;\n\n // Get the actual text element (first child)\n const textElement = containerRef.current.children[0] as HTMLElement;\n if (!textElement) return;\n\n textElementRef.current = textElement;\n\n // Check if text is overflowing\n const isOverflowing = textElement.scrollHeight > textElement.clientHeight;\n setIsTextOverFlowing(isOverflowing);\n }, []);\n\n useEffect(() => {\n if (!truncated) return;\n\n let timeoutId: number;\n\n const debouncedCheck = (): void => {\n window.clearTimeout(timeoutId);\n timeoutId = window.setTimeout(checkOverflow, 100);\n };\n\n // Initial check with a slight delay to ensure rendering is complete\n const initialCheckTimeout = window.setTimeout(checkOverflow, 50);\n\n // Observe the container for resize events\n if (containerRef.current) {\n resizeObserverRef.current = new ResizeObserver(() => {\n debouncedCheck();\n });\n resizeObserverRef.current.observe(containerRef.current);\n }\n\n return (): void => {\n window.clearTimeout(timeoutId);\n window.clearTimeout(initialCheckTimeout);\n if (resizeObserverRef.current) {\n resizeObserverRef.current.disconnect();\n }\n };\n }, [truncated, checkOverflow, children, noOfLines]);\n\n const tooltipLabel = useMemo(\n () => tooltipProps?.label || getTextFromChildren(children),\n [children, tooltipProps?.label],\n );\n\n if (!truncated) {\n return (\n <Component {...(rest as P)} data-testid={dataTestId}>\n {children}\n </Component>\n );\n }\n\n return (\n <Tooltip\n {...tooltipProps}\n label={tooltipLabel}\n disabled={!isTextOverFlowing}\n data-testid={`${dataTestId}-tooltip`}\n >\n <Box\n ref={containerRef}\n width=\"100%\"\n minWidth={0}\n overflow=\"hidden\"\n flex=\"1 1 auto\"\n className=\"TruncatedText__Wrapper\"\n data-testid={`${dataTestId}-wrapper`}\n >\n <Component\n className=\"TruncatedText__TextContent\"\n data-testid={`${dataTestId}-content`}\n css={{\n display: '-webkit-box',\n WebkitBoxOrient: 'vertical',\n WebkitLineClamp: noOfLines,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n }}\n {...(rest as P)}\n >\n {children}\n </Component>\n </Box>\n </Tooltip>\n );\n }\n\n WithTruncation.displayName = `withTruncation(${Component.displayName || Component.name})`;\n return WithTruncation;\n};\n"],"names":["getTextFromChildren","children","React","element","withTruncation","Component","WithTruncation","truncated","noOfLines","tooltipProps","dataTestId","rest","isTextOverFlowing","setIsTextOverFlowing","useState","containerRef","useRef","textElementRef","resizeObserverRef","checkOverflow","useCallback","textElement","isOverflowing","useEffect","timeoutId","debouncedCheck","initialCheckTimeout","tooltipLabel","useMemo","jsx","Tooltip","Box"],"mappings":";;;;AAsBA,MAAMA,IAAsB,CAACC,MAAyC;AAChE,MAAA,OAAOA,KAAa;AACf,WAAAA;AAET,MAAI,OAAOA,KAAa,YAAY,OAAOA,KAAa;AACtD,WAAO,OAAOA,CAAQ;AAEpB,MAAAC,EAAM,eAAeD,CAAQ,GAAG;AAClC,UAAME,IAAUF;AACZ,QAAAE,EAAQ,MAAM;AACT,aAAAH,EAAoBG,EAAQ,MAAM,QAAQ;AAAA,EACnD;AAEE,SAAA,MAAM,QAAQF,CAAQ,IACjBA,EAAS,IAAID,CAAmB,EAAE,KAAK,GAAG,IAE5C;AACT,GAEaI,IAAiB,CAAgCC,MAAmD;AAC/G,WAASC,EAAe;AAAA,IACtB,WAAAC,IAAY;AAAA,IACZ,WAAAC,IAAY;AAAA,IACZ,UAAAP;AAAA,IACA,cAAAQ;AAAA,IACA,CAAC,aAAa,GAAGC,IAAa;AAAA,IAC9B,GAAGC;AAAA,EAAA,GACsC;AACzC,UAAM,CAACC,GAAmBC,CAAoB,IAAIC,EAAkB,EAAK,GACnEC,IAAeC,EAAuB,IAAI,GAC1CC,IAAiBD,EAA2B,IAAI,GAChDE,IAAoBF,EAA8B,IAAI,GAEtDG,IAAgBC,EAAY,MAAM;AAClC,UAAA,CAACL,EAAa,QAAS;AAG3B,YAAMM,IAAcN,EAAa,QAAQ,SAAS,CAA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K,CAAU;AAAA,gBAC1B,KAAK;AAAA,kBACH,SAAS;AAAA,kBACT,iBAAiB;AAAA,kBACjB,iBAAiBF;AAAA,kBACjB,UAAU;AAAA,kBACV,cAAc;AAAA,gBAChB;AAAA,gBACC,GAAIG;AAAA,gBAEJ,UAAAV;AAAA,cAAA;AAAA,YAAA;AAAA,UACH;AAAA,QAAA;AAAA,MACF;AAAA,IACF,0BArCGI,GAAW,EAAA,GAAIM,GAAY,eAAaD,GACtC,UAAAT,GACH;AAAA,EAmCF;AAIJ,SAAAK,EAAe,cAAc,kBAAkBD,EAAU,eAAeA,EAAU,IAAI,KAC/EC;AACT;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../chunks/alert.types-CjIUiK5M.js");exports.Alert=t.Alert;exports.alertButtonPositions=t.alertButtonPositions;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../chunks/alert.types-BKSqs9qY.js");exports.Alert=t.Alert;exports.alertButtonPositions=t.alertButtonPositions;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../chunks/avatar.component-C2OoiZW6.js"),a=require("../../../chunks/avatar.types-Bmt5Uhfb.js");exports.Avatar=t.Avatar;exports.avatarSizes=a.avatarSizes;exports.avatarVariants=a.avatarVariants;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../chunks/avatar.component-B1HGlwVW.js"),a=require("../../../chunks/avatar.types-Bmt5Uhfb.js");exports.Avatar=t.Avatar;exports.avatarSizes=a.avatarSizes;exports.avatarVariants=a.avatarVariants;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../chunks/avatarGroup.component-BihQ8qWV.js");exports.AvatarGroup=r.AvatarGroup;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../chunks/avatarGroup.component-CTBfGiSm.js");exports.AvatarGroup=r.AvatarGroup;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../chunks/buttonGroup.component-DsJK4ZJ9.js");exports.ButtonGroup=t.ButtonGroup;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../chunks/buttonGroup.component-CowJsbr7.js");exports.ButtonGroup=t.ButtonGroup;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../chunks/calendar.component-D-2KzF9Q.js");exports.Calendar=e.Calendar;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../chunks/calendar.component-tOoK1NrU.js");exports.Calendar=e.Calendar;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../chunks/characterCounter.component-CKAR4aCe.js");exports.CharacterCounter=e.CharacterCounter;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../chunks/characterCounter.component-CKDigkoD.js");exports.CharacterCounter=e.CharacterCounter;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../chunks/checkbox.component-CtPp_vbo.js");exports.Checkbox=e.WrappedCheckbox;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../chunks/checkbox.component-CiA3Z1zR.js");exports.Checkbox=e.WrappedCheckbox;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../chunks/checkboxGroup.component-QCbAP8s8.js");exports.CheckboxGroup=e.WrappedCheckboxGroup;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../chunks/checkboxGroup.component-BGBd-roJ.js");exports.CheckboxGroup=e.WrappedCheckboxGroup;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../chunks/conversationCard.component-dt3EZO6p.js");exports.ConversationCard=e.ConversationCard;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../chunks/conversationCard.component-BrDGshOG.js");exports.ConversationCard=e.ConversationCard;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../chunks/datePicker.component-93K2sTq4.js"),t=require("../../../chunks/datePicker.provider-BsFRDkt9.js");exports.DatePicker=e.DatePicker;exports.DateFormats=t.DateFormats;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../chunks/datePicker.component-C6cD1_HR.js"),t=require("../../../chunks/datePicker.provider-DgarjPPd.js");exports.DatePicker=e.DatePicker;exports.DateFormats=t.DateFormats;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../chunks/dateTimePicker.component-CloZHAY9.js");exports.DateTimePicker=e.DateTimePicker;exports.DateTimePickerDefaultOptionValue=e.DateTimePickerDefaultOptionValue;exports.calendarViews=e.calendarViews;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../chunks/dateTimePicker.component-REz9iX4S.js");exports.DateTimePicker=e.DateTimePicker;exports.DateTimePickerDefaultOptionValue=e.DateTimePickerDefaultOptionValue;exports.calendarViews=e.calendarViews;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../chunks/heading.component-BJF9w89n.js");exports.Heading=e.WrappedHeading;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../chunks/heading.component-DMAQO_-m.js");exports.Heading=e.WrappedHeading;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../chunks/menu.component-DGRYx9uq.js");exports.Menu=e.Menu;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../chunks/menu.component-D4-4xRDj.js");exports.Menu=e.Menu;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../../chunks/modal.types-CTysHKuo.js");exports.Modal=o.Modal;exports.modalMotionPresets=o.modalMotionPresets;exports.modalPlacements=o.modalPlacements;exports.modalScrollBehaviors=o.modalScrollBehaviors;exports.modalSizes=o.modalSizes;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../../chunks/modal.types-74os4Bqi.js");exports.Modal=o.Modal;exports.modalMotionPresets=o.modalMotionPresets;exports.modalPlacements=o.modalPlacements;exports.modalScrollBehaviors=o.modalScrollBehaviors;exports.modalSizes=o.modalSizes;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../../chunks/notificationCounter.component-BZ-p6nJc.js"),t=require("../../../chunks/notificationCounter.types-B_-siNfi.js");exports.NotificationCounter=i.NotificationCounter;exports.notificationCounterSizes=t.notificationCounterSizes;exports.notificationCounterVariants=t.notificationCounterVariants;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../../chunks/notificationCounter.component-DJpUXeXm.js"),t=require("../../../chunks/notificationCounter.types-B_-siNfi.js");exports.NotificationCounter=i.NotificationCounter;exports.notificationCounterSizes=t.notificationCounterSizes;exports.notificationCounterVariants=t.notificationCounterVariants;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../chunks/numberInput.component-BEhyTG0A.js");exports.NumberInput=e.WrappedNumberInput;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../chunks/numberInput.component-DIABzNV6.js");exports.NumberInput=e.WrappedNumberInput;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("../../../chunks/pinInput.types-CeoFuSCZ.js");exports.PinInput=p.WrappedPinInput;exports.pinInputTypes=p.pinInputTypes;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("../../../chunks/pinInput.types-BCzsoF9r.js");exports.PinInput=p.WrappedPinInput;exports.pinInputTypes=p.pinInputTypes;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../../chunks/popover.component-Bekht4aK.js"),e=require("../../../chunks/popover.types-ChA9ccQ2.js");exports.Popover=o.Popover;exports.popoverSizes=e.popoverSizes;exports.popoverTriggerTypes=e.popoverTriggerTypes;exports.popoverVariants=e.popoverVariants;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../../chunks/popover.component-BBp_5m8e.js"),e=require("../../../chunks/popover.types-ChA9ccQ2.js");exports.Popover=o.Popover;exports.popoverSizes=e.popoverSizes;exports.popoverTriggerTypes=e.popoverTriggerTypes;exports.popoverVariants=e.popoverVariants;
2
2
  //# sourceMappingURL=index.cjs.map