@televet/kibble-ui 5.0.20-alpha.hunter.9 → 5.0.20

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 (259) hide show
  1. package/dist/chunks/{avatarGroup.component-BHchH_tF.js → avatarGroup.component-CJCQSIyr.js} +2 -2
  2. package/dist/chunks/{avatarGroup.component-BHchH_tF.js.map → avatarGroup.component-CJCQSIyr.js.map} +1 -1
  3. package/dist/chunks/{avatarGroup.component-Ba_rfWUg.js → avatarGroup.component-M84HNv2O.js} +2 -2
  4. package/dist/chunks/{avatarGroup.component-Ba_rfWUg.js.map → avatarGroup.component-M84HNv2O.js.map} +1 -1
  5. package/dist/chunks/{buttonGroup.component-BNOBvOyv.js → buttonGroup.component-HKh7TJ0v.js} +2 -2
  6. package/dist/chunks/{buttonGroup.component-BNOBvOyv.js.map → buttonGroup.component-HKh7TJ0v.js.map} +1 -1
  7. package/dist/chunks/{buttonGroup.component-BXiKIlPf.js → buttonGroup.component-pR0mvmm7.js} +2 -2
  8. package/dist/chunks/{buttonGroup.component-BXiKIlPf.js.map → buttonGroup.component-pR0mvmm7.js.map} +1 -1
  9. package/dist/chunks/{calendar.component-IbKgfA9K.js → calendar.component-BFSyxaB6.js} +2 -2
  10. package/dist/chunks/{calendar.component-IbKgfA9K.js.map → calendar.component-BFSyxaB6.js.map} +1 -1
  11. package/dist/chunks/{calendar.component-BG7_Kwgn.js → calendar.component-UUc8d3QQ.js} +2 -2
  12. package/dist/chunks/{calendar.component-BG7_Kwgn.js.map → calendar.component-UUc8d3QQ.js.map} +1 -1
  13. package/dist/chunks/{checkbox.component-DdOVYSSc.js → checkbox.component-C132vkan.js} +2 -2
  14. package/dist/chunks/{checkbox.component-DdOVYSSc.js.map → checkbox.component-C132vkan.js.map} +1 -1
  15. package/dist/chunks/{checkbox.component-DDsVfE4a.js → checkbox.component-DUJCiZr2.js} +2 -2
  16. package/dist/chunks/{checkbox.component-DDsVfE4a.js.map → checkbox.component-DUJCiZr2.js.map} +1 -1
  17. package/dist/chunks/{checkboxGroup.component-CvHKP7gd.js → checkboxGroup.component-2U0ZW1TD.js} +2 -2
  18. package/dist/chunks/{checkboxGroup.component-CvHKP7gd.js.map → checkboxGroup.component-2U0ZW1TD.js.map} +1 -1
  19. package/dist/chunks/{checkboxGroup.component-Cx2Gvii5.js → checkboxGroup.component-DW9qUlSm.js} +3 -3
  20. package/dist/chunks/{checkboxGroup.component-Cx2Gvii5.js.map → checkboxGroup.component-DW9qUlSm.js.map} +1 -1
  21. package/dist/chunks/{conversationCard.component-0D3jmvOf.js → conversationCard.component-CscMIq51.js} +2 -2
  22. package/dist/chunks/{conversationCard.component-0D3jmvOf.js.map → conversationCard.component-CscMIq51.js.map} +1 -1
  23. package/dist/chunks/{conversationCard.component-D7hpX-QG.js → conversationCard.component-HYxRoILR.js} +2 -2
  24. package/dist/chunks/{conversationCard.component-D7hpX-QG.js.map → conversationCard.component-HYxRoILR.js.map} +1 -1
  25. package/dist/chunks/{datePicker.component-BuHqzdy_.js → datePicker.component-BuGpHTzS.js} +2 -2
  26. package/dist/chunks/{datePicker.component-BuHqzdy_.js.map → datePicker.component-BuGpHTzS.js.map} +1 -1
  27. package/dist/chunks/{datePicker.component-BmmxcyyX.js → datePicker.component-Dq2vL7Mk.js} +3 -3
  28. package/dist/chunks/{datePicker.component-BmmxcyyX.js.map → datePicker.component-Dq2vL7Mk.js.map} +1 -1
  29. package/dist/chunks/{datePicker.provider-ElRAMKbN.js → datePicker.provider-CavuOZl4.js} +747 -750
  30. package/dist/chunks/{datePicker.provider-ElRAMKbN.js.map → datePicker.provider-CavuOZl4.js.map} +1 -1
  31. package/dist/chunks/datePicker.provider-i35-VNAb.js +15 -0
  32. package/dist/chunks/{datePicker.provider-B7-cWUkv.js.map → datePicker.provider-i35-VNAb.js.map} +1 -1
  33. package/dist/chunks/{dateTimePicker.component-CAYI8EOg.js → dateTimePicker.component-BlWhC5aT.js} +2 -2
  34. package/dist/chunks/{dateTimePicker.component-CAYI8EOg.js.map → dateTimePicker.component-BlWhC5aT.js.map} +1 -1
  35. package/dist/chunks/{dateTimePicker.component-Dnqx_xtK.js → dateTimePicker.component-DnYStcAJ.js} +4 -4
  36. package/dist/chunks/{dateTimePicker.component-Dnqx_xtK.js.map → dateTimePicker.component-DnYStcAJ.js.map} +1 -1
  37. package/dist/chunks/{menu.component-BEDMybmZ.js → menu.component-CV8eVKYt.js} +3 -3
  38. package/dist/chunks/{menu.component-BEDMybmZ.js.map → menu.component-CV8eVKYt.js.map} +1 -1
  39. package/dist/chunks/{menu.component-DypBuCwv.js → menu.component-D2V9Q1Y5.js} +2 -2
  40. package/dist/chunks/{menu.component-DypBuCwv.js.map → menu.component-D2V9Q1Y5.js.map} +1 -1
  41. package/dist/chunks/{numberInput.component-DG6IWAHs.js → numberInput.component-DGPEz0Fv.js} +2 -2
  42. package/dist/chunks/{numberInput.component-DG6IWAHs.js.map → numberInput.component-DGPEz0Fv.js.map} +1 -1
  43. package/dist/chunks/{numberInput.component-DFK4EYLV.js → numberInput.component-V6NQs14b.js} +2 -2
  44. package/dist/chunks/{numberInput.component-DFK4EYLV.js.map → numberInput.component-V6NQs14b.js.map} +1 -1
  45. package/dist/chunks/{pinInput.types-ftBwVMLj.js → pinInput.types-Can9f1Eu.js} +2 -2
  46. package/dist/chunks/{pinInput.types-ftBwVMLj.js.map → pinInput.types-Can9f1Eu.js.map} +1 -1
  47. package/dist/chunks/{pinInput.types-BmXYQb7O.js → pinInput.types-bIGh7aUS.js} +2 -2
  48. package/dist/chunks/{pinInput.types-BmXYQb7O.js.map → pinInput.types-bIGh7aUS.js.map} +1 -1
  49. package/dist/chunks/{radioGroup.types-CVFQ5dZ7.js → radioGroup.types-BVbxeB22.js} +3 -3
  50. package/dist/chunks/{radioGroup.types-CVFQ5dZ7.js.map → radioGroup.types-BVbxeB22.js.map} +1 -1
  51. package/dist/chunks/{radioGroup.types-DxRSugsr.js → radioGroup.types-U1ep9nrN.js} +2 -2
  52. package/dist/chunks/{radioGroup.types-DxRSugsr.js.map → radioGroup.types-U1ep9nrN.js.map} +1 -1
  53. package/dist/chunks/{rating.component-CQgpD-gS.js → rating.component-DeJY9G94.js} +2 -2
  54. package/dist/chunks/rating.component-DeJY9G94.js.map +1 -0
  55. package/dist/chunks/{rating.component-FYKS_NCl.js → rating.component-DsHkKmA7.js} +2 -2
  56. package/dist/chunks/rating.component-DsHkKmA7.js.map +1 -0
  57. package/dist/chunks/{ratingDots.component-C1KgTGWj.js → ratingDots.component-BhWM7kTg.js} +2 -2
  58. package/dist/chunks/{ratingDots.component-C1KgTGWj.js.map → ratingDots.component-BhWM7kTg.js.map} +1 -1
  59. package/dist/chunks/{ratingDots.component-DesbSj0q.js → ratingDots.component-CZ370iI3.js} +2 -2
  60. package/dist/chunks/{ratingDots.component-DesbSj0q.js.map → ratingDots.component-CZ370iI3.js.map} +1 -1
  61. package/dist/chunks/{select.component-BkDkYpf2.js → select.component-CIjEq1os.js} +3 -3
  62. package/dist/chunks/{select.component-BkDkYpf2.js.map → select.component-CIjEq1os.js.map} +1 -1
  63. package/dist/chunks/{select.component-DoFwe4lJ.js → select.component-OrsHXCMz.js} +2 -2
  64. package/dist/chunks/{select.component-DoFwe4lJ.js.map → select.component-OrsHXCMz.js.map} +1 -1
  65. package/dist/chunks/semanticTokens.records-CmeaObFQ.js +2 -0
  66. package/dist/chunks/semanticTokens.records-CmeaObFQ.js.map +1 -0
  67. package/dist/chunks/semanticTokens.records-CwC7zhMS.js +549 -0
  68. package/dist/chunks/semanticTokens.records-CwC7zhMS.js.map +1 -0
  69. package/dist/chunks/{switch.component-Bs-8D1pU.js → switch.component-BYEMhBCA.js} +2 -2
  70. package/dist/chunks/{switch.component-Bs-8D1pU.js.map → switch.component-BYEMhBCA.js.map} +1 -1
  71. package/dist/chunks/{switch.component-Cr8Abw0U.js → switch.component-DjN67nap.js} +2 -2
  72. package/dist/chunks/{switch.component-Cr8Abw0U.js.map → switch.component-DjN67nap.js.map} +1 -1
  73. package/dist/chunks/{tagBlock.component-BWXHnUPn.js → tagBlock.component-B899iqQP.js} +2 -2
  74. package/dist/chunks/{tagBlock.component-BWXHnUPn.js.map → tagBlock.component-B899iqQP.js.map} +1 -1
  75. package/dist/chunks/{tagBlock.component-DjbevH0J.js → tagBlock.component-R4FY7ytN.js} +2 -2
  76. package/dist/chunks/{tagBlock.component-DjbevH0J.js.map → tagBlock.component-R4FY7ytN.js.map} +1 -1
  77. package/dist/chunks/{textInput.component-C7kdQ8hF.js → textInput.component-BeiTxTkS.js} +2 -2
  78. package/dist/chunks/{textInput.component-C7kdQ8hF.js.map → textInput.component-BeiTxTkS.js.map} +1 -1
  79. package/dist/chunks/{textInput.component-DzUKTy1w.js → textInput.component-CwTc0h_F.js} +2 -2
  80. package/dist/chunks/{textInput.component-DzUKTy1w.js.map → textInput.component-CwTc0h_F.js.map} +1 -1
  81. package/dist/chunks/{textarea.component-DteG1L4y.js → textarea.component-BIg_XX_R.js} +2 -2
  82. package/dist/chunks/{textarea.component-DteG1L4y.js.map → textarea.component-BIg_XX_R.js.map} +1 -1
  83. package/dist/chunks/{textarea.component-W9VBnd4-.js → textarea.component-C6Wt1Pk8.js} +2 -2
  84. package/dist/chunks/{textarea.component-W9VBnd4-.js.map → textarea.component-C6Wt1Pk8.js.map} +1 -1
  85. package/dist/chunks/{theme.provider-Cl9_chOv.js → theme.provider-CvuSdLO6.js} +963 -1625
  86. package/dist/chunks/theme.provider-CvuSdLO6.js.map +1 -0
  87. package/dist/chunks/theme.provider-DwwXiHZn.js +28 -0
  88. package/dist/chunks/theme.provider-DwwXiHZn.js.map +1 -0
  89. package/dist/chunks/timePicker.component-BCMX6aqb.js +220 -0
  90. package/dist/chunks/timePicker.component-BCMX6aqb.js.map +1 -0
  91. package/dist/chunks/timePicker.component-D5hw80VV.js +2 -0
  92. package/dist/chunks/timePicker.component-D5hw80VV.js.map +1 -0
  93. package/dist/chunks/{timeRange.component-oc3ptJ_N.js → timeRange.component-BZHpZeAX.js} +2 -2
  94. package/dist/chunks/timeRange.component-BZHpZeAX.js.map +1 -0
  95. package/dist/chunks/{timeRange.component-LBzKy8H3.js → timeRange.component-D3Db8lvh.js} +2 -2
  96. package/dist/chunks/timeRange.component-D3Db8lvh.js.map +1 -0
  97. package/dist/chunks/{withFormControl-08PrhcOk.js → withFormControl-DW9A6BSL.js} +2 -2
  98. package/dist/chunks/{withFormControl-08PrhcOk.js.map → withFormControl-DW9A6BSL.js.map} +1 -1
  99. package/dist/chunks/withFormControl-QV_Jridv.js +2 -0
  100. package/dist/chunks/{withFormControl-BSlIlVY0.js.map → withFormControl-QV_Jridv.js.map} +1 -1
  101. package/dist/cjs/components/AvatarGroup/index.cjs +1 -1
  102. package/dist/cjs/components/ButtonGroup/index.cjs +1 -1
  103. package/dist/cjs/components/Calendar/index.cjs +1 -1
  104. package/dist/cjs/components/Checkbox/index.cjs +1 -1
  105. package/dist/cjs/components/CheckboxGroup/index.cjs +1 -1
  106. package/dist/cjs/components/ConversationCard/index.cjs +1 -1
  107. package/dist/cjs/components/DatePicker/index.cjs +1 -1
  108. package/dist/cjs/components/DateTimePicker/index.cjs +1 -1
  109. package/dist/cjs/components/Menu/index.cjs +1 -1
  110. package/dist/cjs/components/NumberInput/index.cjs +1 -1
  111. package/dist/cjs/components/PinInput/index.cjs +1 -1
  112. package/dist/cjs/components/RadioGroup/index.cjs +1 -1
  113. package/dist/cjs/components/Rating/index.cjs +1 -1
  114. package/dist/cjs/components/RatingDots/index.cjs +1 -1
  115. package/dist/cjs/components/Select/index.cjs +1 -1
  116. package/dist/cjs/components/Switch/index.cjs +1 -1
  117. package/dist/cjs/components/TagBlock/index.cjs +1 -1
  118. package/dist/cjs/components/TextInput/index.cjs +1 -1
  119. package/dist/cjs/components/Textarea/index.cjs +1 -1
  120. package/dist/cjs/components/TimePicker/index.cjs +1 -1
  121. package/dist/cjs/components/TimeRange/index.cjs +1 -1
  122. package/dist/cjs/components/index.cjs +1 -1
  123. package/dist/cjs/hooks/useBreakpoint/index.cjs.map +1 -1
  124. package/dist/cjs/hooks/useDeviceType/index.cjs.map +1 -1
  125. package/dist/cjs/index.cjs +1 -1
  126. package/dist/cjs/theme/index.cjs +1 -1
  127. package/dist/cjs/theme/semanticTokens/index.cjs +1 -1
  128. package/dist/cjs/theme/semanticTokens/index.cjs.map +1 -1
  129. package/dist/cjs/theme/tokens/blurs/index.cjs +1 -1
  130. package/dist/cjs/theme/tokens/blurs/index.cjs.map +1 -1
  131. package/dist/cjs/theme/tokens/borders/index.cjs +1 -1
  132. package/dist/cjs/theme/tokens/borders/index.cjs.map +1 -1
  133. package/dist/cjs/theme/tokens/colors/index.cjs.map +1 -1
  134. package/dist/cjs/theme/tokens/index.cjs +1 -1
  135. package/dist/cjs/theme/tokens/shadows/index.cjs +1 -1
  136. package/dist/cjs/theme/tokens/shadows/index.cjs.map +1 -1
  137. package/dist/cjs/theme/tokens/sizes/index.cjs +1 -1
  138. package/dist/cjs/theme/tokens/sizes/index.cjs.map +1 -1
  139. package/dist/cjs/theme/tokens/spacing/index.cjs +1 -1
  140. package/dist/cjs/theme/tokens/spacing/index.cjs.map +1 -1
  141. package/dist/cjs/theme/tokens/transitions/index.cjs +1 -1
  142. package/dist/cjs/theme/tokens/transitions/index.cjs.map +1 -1
  143. package/dist/cjs/theme/tokens/typography/index.cjs +1 -1
  144. package/dist/cjs/theme/tokens/typography/index.cjs.map +1 -1
  145. package/dist/cjs/theme/tokens/zIndices/index.cjs +1 -1
  146. package/dist/cjs/theme/tokens/zIndices/index.cjs.map +1 -1
  147. package/dist/esm/components/AvatarGroup/index.js +1 -1
  148. package/dist/esm/components/ButtonGroup/index.js +1 -1
  149. package/dist/esm/components/Calendar/index.js +1 -1
  150. package/dist/esm/components/Checkbox/index.js +1 -1
  151. package/dist/esm/components/CheckboxGroup/index.js +1 -1
  152. package/dist/esm/components/ConversationCard/index.js +1 -1
  153. package/dist/esm/components/DatePicker/index.js +2 -2
  154. package/dist/esm/components/DateTimePicker/index.js +1 -1
  155. package/dist/esm/components/Menu/index.js +1 -1
  156. package/dist/esm/components/NumberInput/index.js +1 -1
  157. package/dist/esm/components/PinInput/index.js +1 -1
  158. package/dist/esm/components/RadioGroup/index.js +1 -1
  159. package/dist/esm/components/Rating/index.js +1 -1
  160. package/dist/esm/components/RatingDots/index.js +1 -1
  161. package/dist/esm/components/Select/index.js +1 -1
  162. package/dist/esm/components/Switch/index.js +1 -1
  163. package/dist/esm/components/TagBlock/index.js +1 -1
  164. package/dist/esm/components/TextInput/index.js +1 -1
  165. package/dist/esm/components/Textarea/index.js +1 -1
  166. package/dist/esm/components/TimePicker/index.js +1 -1
  167. package/dist/esm/components/TimeRange/index.js +1 -1
  168. package/dist/esm/components/index.js +22 -22
  169. package/dist/esm/hooks/useBreakpoint/index.js.map +1 -1
  170. package/dist/esm/hooks/useDeviceType/index.js.map +1 -1
  171. package/dist/esm/index.js +23 -23
  172. package/dist/esm/theme/index.js +1 -1
  173. package/dist/esm/theme/semanticTokens/index.js +10 -4
  174. package/dist/esm/theme/semanticTokens/index.js.map +1 -1
  175. package/dist/esm/theme/tokens/blurs/index.js +13 -1
  176. package/dist/esm/theme/tokens/blurs/index.js.map +1 -1
  177. package/dist/esm/theme/tokens/borders/index.js +22 -1
  178. package/dist/esm/theme/tokens/borders/index.js.map +1 -1
  179. package/dist/esm/theme/tokens/colors/index.js.map +1 -1
  180. package/dist/esm/theme/tokens/index.js +26 -2
  181. package/dist/esm/theme/tokens/index.js.map +1 -1
  182. package/dist/esm/theme/tokens/shadows/index.js +55 -1
  183. package/dist/esm/theme/tokens/shadows/index.js.map +1 -1
  184. package/dist/esm/theme/tokens/sizes/index.js +28 -1
  185. package/dist/esm/theme/tokens/sizes/index.js.map +1 -1
  186. package/dist/esm/theme/tokens/spacing/index.js +38 -1
  187. package/dist/esm/theme/tokens/spacing/index.js.map +1 -1
  188. package/dist/esm/theme/tokens/transitions/index.js +17 -1
  189. package/dist/esm/theme/tokens/transitions/index.js.map +1 -1
  190. package/dist/esm/theme/tokens/typography/index.js +53 -1
  191. package/dist/esm/theme/tokens/typography/index.js.map +1 -1
  192. package/dist/esm/theme/tokens/zIndices/index.js +19 -1
  193. package/dist/esm/theme/tokens/zIndices/index.js.map +1 -1
  194. package/dist/types/components/DatePicker/context/datePicker.provider.d.ts +1 -2
  195. package/dist/types/components/Heading/heading.recipe.d.ts +1 -1
  196. package/dist/types/components/Link/link.recipe.d.ts +1 -1
  197. package/dist/types/components/Rating/rating.component.d.ts +1 -1
  198. package/dist/types/components/Text/text.recipe.d.ts +1 -1
  199. package/dist/types/components/TimePicker/timePicker.component.d.ts +1 -2
  200. package/dist/types/components/TimeRange/timeRange.component.d.ts +0 -1
  201. package/dist/types/theme/semanticTokens/aliasPurpose.records.d.ts +1 -1
  202. package/dist/types/theme/semanticTokens/index.d.ts +1 -2
  203. package/dist/types/theme/semanticTokens/semanticTokens.config.d.ts +37 -37
  204. package/dist/types/theme/semanticTokens/utils/flattenSemanticTokenRecord.d.ts +1 -1
  205. package/dist/types/theme/semanticTokens/utils/getSemanticColorToken.d.ts +1 -1
  206. package/dist/types/theme/tokens/blurs/index.d.ts +1 -1
  207. package/dist/types/theme/tokens/borders/index.d.ts +1 -1
  208. package/dist/types/theme/tokens/colors/colors.config.d.ts +1 -1
  209. package/dist/types/theme/tokens/colors/index.d.ts +1 -2
  210. package/dist/types/theme/tokens/shadows/index.d.ts +1 -1
  211. package/dist/types/theme/tokens/sizes/index.d.ts +1 -1
  212. package/dist/types/theme/tokens/spacing/index.d.ts +1 -1
  213. package/dist/types/theme/tokens/spacing/spacing.config.d.ts +2 -2
  214. package/dist/types/theme/tokens/transitions/index.d.ts +1 -1
  215. package/dist/types/theme/tokens/typography/index.d.ts +1 -1
  216. package/dist/types/theme/tokens/zIndices/index.d.ts +1 -1
  217. package/package.json +6 -3
  218. package/dist/chunks/datePicker.provider-B7-cWUkv.js +0 -15
  219. package/dist/chunks/invertToken-DkyAF_BY.js +0 -10
  220. package/dist/chunks/invertToken-DkyAF_BY.js.map +0 -1
  221. package/dist/chunks/invertToken-Em3s32gh.js +0 -2
  222. package/dist/chunks/invertToken-Em3s32gh.js.map +0 -1
  223. package/dist/chunks/rating.component-CQgpD-gS.js.map +0 -1
  224. package/dist/chunks/rating.component-FYKS_NCl.js.map +0 -1
  225. package/dist/chunks/theme.provider-BWhqnOFC.js +0 -28
  226. package/dist/chunks/theme.provider-BWhqnOFC.js.map +0 -1
  227. package/dist/chunks/theme.provider-Cl9_chOv.js.map +0 -1
  228. package/dist/chunks/timePicker.component-DIUqae3b.js +0 -2
  229. package/dist/chunks/timePicker.component-DIUqae3b.js.map +0 -1
  230. package/dist/chunks/timePicker.component-Dl3BE6eW.js +0 -230
  231. package/dist/chunks/timePicker.component-Dl3BE6eW.js.map +0 -1
  232. package/dist/chunks/timeRange.component-LBzKy8H3.js.map +0 -1
  233. package/dist/chunks/timeRange.component-oc3ptJ_N.js.map +0 -1
  234. package/dist/chunks/typography.records-BEd2lI_g.js +0 -54
  235. package/dist/chunks/typography.records-BEd2lI_g.js.map +0 -1
  236. package/dist/chunks/typography.records-Cg_lT1Z3.js +0 -2
  237. package/dist/chunks/typography.records-Cg_lT1Z3.js.map +0 -1
  238. package/dist/chunks/withFormControl-BSlIlVY0.js +0 -2
  239. package/dist/types/theme/semanticTokens/semanticTokens.records.d.ts +0 -419
  240. package/dist/types/theme/semanticTokens/semanticTokens.types.d.ts +0 -17
  241. package/dist/types/theme/semanticTokens/utils/invertToken.d.ts +0 -2
  242. package/dist/types/theme/tokens/blurs/blurs.records.d.ts +0 -2
  243. package/dist/types/theme/tokens/blurs/blurs.types.d.ts +0 -1
  244. package/dist/types/theme/tokens/borders/borders.records.d.ts +0 -3
  245. package/dist/types/theme/tokens/borders/borders.types.d.ts +0 -2
  246. package/dist/types/theme/tokens/colors/colors.records.d.ts +0 -2
  247. package/dist/types/theme/tokens/colors/colors.types.d.ts +0 -2
  248. package/dist/types/theme/tokens/shadows/shadows.records.d.ts +0 -6
  249. package/dist/types/theme/tokens/shadows/shadows.types.d.ts +0 -2
  250. package/dist/types/theme/tokens/sizes/sizes.records.d.ts +0 -3
  251. package/dist/types/theme/tokens/sizes/sizes.types.d.ts +0 -2
  252. package/dist/types/theme/tokens/spacing/spacing.records.d.ts +0 -2
  253. package/dist/types/theme/tokens/spacing/spacing.types.d.ts +0 -1
  254. package/dist/types/theme/tokens/transitions/transitions.records.d.ts +0 -3
  255. package/dist/types/theme/tokens/transitions/transitions.types.d.ts +0 -2
  256. package/dist/types/theme/tokens/typography/typography.records.d.ts +0 -6
  257. package/dist/types/theme/tokens/typography/typography.types.d.ts +0 -5
  258. package/dist/types/theme/tokens/zIndices/zIndices.records.d.ts +0 -2
  259. package/dist/types/theme/tokens/zIndices/zIndices.types.d.ts +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"textInput.component-DzUKTy1w.js","sources":["../../node_modules/@ark-ui/react/dist/components/field/field-input.js","../../node_modules/@chakra-ui/react/dist/esm/components/input/input.js","../../src/components/TextInput/textInput.records.ts","../../src/components/TextInput/textInput.component.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 FieldInput = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getInputProps(), props);\n return /* @__PURE__ */ jsx(ark.input, { ...mergedProps, ref });\n});\nFieldInput.displayName = \"FieldInput\";\n\nexport { FieldInput };\n","\"use strict\";\n\"use client\";\nimport { Field } from '@ark-ui/react/field';\nimport { createRecipeContext } from '../../styled-system/create-recipe-context.js';\n\nconst { withContext, PropsProvider } = createRecipeContext({\n key: \"input\"\n});\nconst Input = withContext(Field.Input);\nconst InputPropsProvider = PropsProvider;\n\nexport { Input, InputPropsProvider };\n","import { ButtonSize } from 'components/Button/button.types';\nimport { FormControlSize } from 'hocs/withFormControl/withFormControl.types';\n\nexport const closeButtonSizeMap: Record<FormControlSize, ButtonSize> = {\n sm: 'xs',\n md: 'sm',\n lg: 'md',\n};\n","import React, { useMemo } from 'react';\nimport { Flex } from '@chakra-ui/react/flex';\nimport { withFormControl, WithFormControlProps } from 'hocs/withFormControl/withFormControl';\nimport { Input as CInput, InputProps as CInputProps } from '@chakra-ui/react/input';\nimport { InputGroup } from '@chakra-ui/react/input-group';\nimport { FormControlSize } from 'hocs/withFormControl/withFormControl.types';\nimport { Button } from 'components/Button/button.component';\nimport { CharacterCounter } from 'components/CharacterCounter/characterCounter.component';\nimport { closeButtonSizeMap } from './textInput.records';\n\nexport interface TextInputBaseProps extends WithFormControlProps {\n /** The maximum number of characters that can be entered into the input. */\n charLimit?: number;\n /** Ref to the input element. */\n inputRef?: React.Ref<HTMLInputElement | null>;\n /** Left addon element. */\n leftAddon?: React.ReactNode;\n /** Left element inside the input. */\n leftElement?: React.ReactNode;\n /**\n * If true, the input will render a contrasting variant.\n * @default false\n */\n onContrast?: boolean;\n /** Placeholder text for the input field. */\n placeholder?: string;\n /** Right addon element. */\n rightAddon?: React.ReactNode;\n /** Right element inside the input. */\n rightElement?: React.ReactNode;\n /** The size of the input. */\n size?: FormControlSize;\n /**\n * Data test id for the text input.\n * @default kibble-text-input\n */\n 'data-testid'?: string;\n}\n\nexport interface DefaultTextInputProps extends TextInputBaseProps {\n /**\n * If true, the input will have a button to clear out the field.\n * @default false\n */\n clearable?: never;\n /** Callback function when the clear button is clicked. */\n onClear?: never;\n}\n\nexport interface ClearableTextInputProps extends TextInputBaseProps {\n /**\n * If true, the input will have a button to clear out the field.\n * @default false\n */\n clearable?: boolean;\n /** Callback function when the clear button is clicked. */\n onClear?: (val: string | number | readonly string[]) => void;\n}\n\nexport type KTextInputProps = DefaultTextInputProps | ClearableTextInputProps;\n\nexport type TextInputProps = KTextInputProps & CInputProps;\n\nconst TextInput = React.forwardRef<HTMLInputElement, TextInputProps>(\n (\n {\n charLimit = undefined,\n clearable = false,\n disabled = false,\n inputRef,\n invalid,\n leftAddon,\n leftElement,\n onClear,\n onContrast,\n rightAddon,\n rightElement,\n size = 'md',\n value,\n ['data-testid']: dataTestId = 'kibble-text-input',\n ...rest\n },\n ref,\n ): React.JSX.Element => {\n const handleClear = (): void => {\n if (onClear) {\n onClear(value || '');\n }\n };\n\n if (clearable && !!value && !disabled) {\n rightElement = (\n <Button\n className=\"TextInput__ClearButton\"\n data-testid={`${dataTestId}-clear-button`}\n size={closeButtonSizeMap[size as FormControlSize]}\n variant=\"ghostNeutral\"\n onClick={handleClear}\n iconName=\"close\"\n />\n );\n }\n\n const currentCharCount = useMemo(() => value?.toString()?.length || 0, [value]);\n\n return (\n <Flex className=\"TextInput__Wrapper\" w=\"100%\" flexDirection=\"column\" gap={1} alignItems=\"flex-end\">\n <InputGroup\n className=\"TextInput__InputGroup\"\n data-testid={`${dataTestId}-input-group`}\n startElement={leftElement}\n startElementProps={{\n color: 'inherit',\n _groupDisabled: { opacity: 0.6 },\n }}\n endElement={rightElement}\n endElementProps={{\n color: 'inherit',\n paddingInline: 1.5,\n _groupDisabled: { opacity: 0.6 },\n }}\n startAddon={leftAddon}\n endAddon={rightAddon}\n >\n <CInput\n data-testid={dataTestId}\n className=\"TextInput\"\n ref={inputRef || ref}\n value={value}\n size={size}\n disabled={disabled}\n {...(invalid && { 'aria-invalid': true })}\n variant={onContrast ? 'onContrast' : 'default'}\n {...rest}\n />\n </InputGroup>\n {!!charLimit && (\n <CharacterCounter\n data-testid={`${dataTestId}-character-counter`}\n withLimit={true}\n limit={charLimit}\n currentCount={currentCharCount}\n />\n )}\n </Flex>\n );\n },\n);\n\nTextInput.displayName = 'TextInput';\nconst WrappedTextInput = withFormControl<TextInputProps>(TextInput);\n\nexport { WrappedTextInput as TextInput };\n"],"names":["FieldInput","forwardRef","props","ref","field","useFieldContext","mergedProps","mergeProps","jsx","ark","withContext","createRecipeContext","Input","Field.Input","closeButtonSizeMap","TextInput","React","charLimit","clearable","disabled","inputRef","invalid","leftAddon","leftElement","onClear","onContrast","rightAddon","rightElement","size","value","dataTestId","rest","handleClear","Button","currentCharCount","useMemo","jsxs","Flex","InputGroup","CInput","CharacterCounter","WrappedTextInput","withFormControl"],"mappings":"wfAOMA,EAAaC,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,EACDH,EAAW,YAAc,aCPzB,KAAM,CAAE,YAAAU,CAA2B,EAAIC,sBAAoB,CACzD,IAAK,OACP,CAAC,EACKC,EAAQF,EAAYG,CAAW,ECLxBC,EAA0D,CACrE,GAAI,KACJ,GAAI,KACJ,GAAI,IACN,ECwDMC,EAAYC,EAAM,QAAA,WACtB,CACE,CACE,UAAAC,EAAY,OACZ,UAAAC,EAAY,GACZ,SAAAC,EAAW,GACX,SAAAC,EACA,QAAAC,EACA,UAAAC,EACA,YAAAC,EACA,QAAAC,EACA,WAAAC,EACA,WAAAC,EACA,aAAAC,EACA,KAAAC,EAAO,KACP,MAAAC,EACA,CAAC,eAAgBC,EAAa,oBAC9B,GAAGC,GAEL5B,IACsB,CACtB,MAAM6B,EAAc,IAAY,CAC1BR,GACFA,EAAQK,GAAS,EAAE,CAEvB,EAEIX,GAAeW,GAAS,CAACV,IAEzBQ,EAAAnB,EAAA,kBAAA,IAACyB,EAAA,OAAA,CACC,UAAU,yBACV,cAAa,GAAGH,CAAU,gBAC1B,KAAMhB,EAAmBc,CAAuB,EAChD,QAAQ,eACR,QAASI,EACT,SAAS,OAAA,CACX,GAIE,MAAAE,EAAmBC,UAAQ,IAAMN,GAAO,YAAY,QAAU,EAAG,CAACA,CAAK,CAAC,EAG5E,OAAAO,EAAA,kBAAA,KAACC,EAAK,KAAA,CAAA,UAAU,qBAAqB,EAAE,OAAO,cAAc,SAAS,IAAK,EAAG,WAAW,WACtF,SAAA,CAAA7B,EAAA,kBAAA,IAAC8B,EAAA,WAAA,CACC,UAAU,wBACV,cAAa,GAAGR,CAAU,eAC1B,aAAcP,EACd,kBAAmB,CACjB,MAAO,UACP,eAAgB,CAAE,QAAS,EAAI,CACjC,EACA,WAAYI,EACZ,gBAAiB,CACf,MAAO,UACP,cAAe,IACf,eAAgB,CAAE,QAAS,EAAI,CACjC,EACA,WAAYL,EACZ,SAAUI,EAEV,SAAAlB,EAAA,kBAAA,IAAC+B,EAAA,CACC,cAAaT,EACb,UAAU,YACV,IAAKV,GAAYjB,EACjB,MAAA0B,EACA,KAAAD,EACA,SAAAT,EACC,GAAIE,GAAW,CAAE,eAAgB,EAAK,EACvC,QAASI,EAAa,aAAe,UACpC,GAAGM,CAAA,CAAA,CACN,CACF,EACC,CAAC,CAACd,GACDT,EAAA,kBAAA,IAACgC,EAAA,iBAAA,CACC,cAAa,GAAGV,CAAU,qBAC1B,UAAW,GACX,MAAOb,EACP,aAAciB,CAAA,CAAA,CAChB,EAEJ,CAAA,CAGN,EAEAnB,EAAU,YAAc,YAClB,MAAA0B,EAAmBC,kBAAgC3B,CAAS","x_google_ignoreList":[0,1]}
1
+ {"version":3,"file":"textInput.component-CwTc0h_F.js","sources":["../../node_modules/@ark-ui/react/dist/components/field/field-input.js","../../node_modules/@chakra-ui/react/dist/esm/components/input/input.js","../../src/components/TextInput/textInput.records.ts","../../src/components/TextInput/textInput.component.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 FieldInput = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getInputProps(), props);\n return /* @__PURE__ */ jsx(ark.input, { ...mergedProps, ref });\n});\nFieldInput.displayName = \"FieldInput\";\n\nexport { FieldInput };\n","\"use strict\";\n\"use client\";\nimport { Field } from '@ark-ui/react/field';\nimport { createRecipeContext } from '../../styled-system/create-recipe-context.js';\n\nconst { withContext, PropsProvider } = createRecipeContext({\n key: \"input\"\n});\nconst Input = withContext(Field.Input);\nconst InputPropsProvider = PropsProvider;\n\nexport { Input, InputPropsProvider };\n","import { ButtonSize } from 'components/Button/button.types';\nimport { FormControlSize } from 'hocs/withFormControl/withFormControl.types';\n\nexport const closeButtonSizeMap: Record<FormControlSize, ButtonSize> = {\n sm: 'xs',\n md: 'sm',\n lg: 'md',\n};\n","import React, { useMemo } from 'react';\nimport { Flex } from '@chakra-ui/react/flex';\nimport { withFormControl, WithFormControlProps } from 'hocs/withFormControl/withFormControl';\nimport { Input as CInput, InputProps as CInputProps } from '@chakra-ui/react/input';\nimport { InputGroup } from '@chakra-ui/react/input-group';\nimport { FormControlSize } from 'hocs/withFormControl/withFormControl.types';\nimport { Button } from 'components/Button/button.component';\nimport { CharacterCounter } from 'components/CharacterCounter/characterCounter.component';\nimport { closeButtonSizeMap } from './textInput.records';\n\nexport interface TextInputBaseProps extends WithFormControlProps {\n /** The maximum number of characters that can be entered into the input. */\n charLimit?: number;\n /** Ref to the input element. */\n inputRef?: React.Ref<HTMLInputElement | null>;\n /** Left addon element. */\n leftAddon?: React.ReactNode;\n /** Left element inside the input. */\n leftElement?: React.ReactNode;\n /**\n * If true, the input will render a contrasting variant.\n * @default false\n */\n onContrast?: boolean;\n /** Placeholder text for the input field. */\n placeholder?: string;\n /** Right addon element. */\n rightAddon?: React.ReactNode;\n /** Right element inside the input. */\n rightElement?: React.ReactNode;\n /** The size of the input. */\n size?: FormControlSize;\n /**\n * Data test id for the text input.\n * @default kibble-text-input\n */\n 'data-testid'?: string;\n}\n\nexport interface DefaultTextInputProps extends TextInputBaseProps {\n /**\n * If true, the input will have a button to clear out the field.\n * @default false\n */\n clearable?: never;\n /** Callback function when the clear button is clicked. */\n onClear?: never;\n}\n\nexport interface ClearableTextInputProps extends TextInputBaseProps {\n /**\n * If true, the input will have a button to clear out the field.\n * @default false\n */\n clearable?: boolean;\n /** Callback function when the clear button is clicked. */\n onClear?: (val: string | number | readonly string[]) => void;\n}\n\nexport type KTextInputProps = DefaultTextInputProps | ClearableTextInputProps;\n\nexport type TextInputProps = KTextInputProps & CInputProps;\n\nconst TextInput = React.forwardRef<HTMLInputElement, TextInputProps>(\n (\n {\n charLimit = undefined,\n clearable = false,\n disabled = false,\n inputRef,\n invalid,\n leftAddon,\n leftElement,\n onClear,\n onContrast,\n rightAddon,\n rightElement,\n size = 'md',\n value,\n ['data-testid']: dataTestId = 'kibble-text-input',\n ...rest\n },\n ref,\n ): React.JSX.Element => {\n const handleClear = (): void => {\n if (onClear) {\n onClear(value || '');\n }\n };\n\n if (clearable && !!value && !disabled) {\n rightElement = (\n <Button\n className=\"TextInput__ClearButton\"\n data-testid={`${dataTestId}-clear-button`}\n size={closeButtonSizeMap[size as FormControlSize]}\n variant=\"ghostNeutral\"\n onClick={handleClear}\n iconName=\"close\"\n />\n );\n }\n\n const currentCharCount = useMemo(() => value?.toString()?.length || 0, [value]);\n\n return (\n <Flex className=\"TextInput__Wrapper\" w=\"100%\" flexDirection=\"column\" gap={1} alignItems=\"flex-end\">\n <InputGroup\n className=\"TextInput__InputGroup\"\n data-testid={`${dataTestId}-input-group`}\n startElement={leftElement}\n startElementProps={{\n color: 'inherit',\n _groupDisabled: { opacity: 0.6 },\n }}\n endElement={rightElement}\n endElementProps={{\n color: 'inherit',\n paddingInline: 1.5,\n _groupDisabled: { opacity: 0.6 },\n }}\n startAddon={leftAddon}\n endAddon={rightAddon}\n >\n <CInput\n data-testid={dataTestId}\n className=\"TextInput\"\n ref={inputRef || ref}\n value={value}\n size={size}\n disabled={disabled}\n {...(invalid && { 'aria-invalid': true })}\n variant={onContrast ? 'onContrast' : 'default'}\n {...rest}\n />\n </InputGroup>\n {!!charLimit && (\n <CharacterCounter\n data-testid={`${dataTestId}-character-counter`}\n withLimit={true}\n limit={charLimit}\n currentCount={currentCharCount}\n />\n )}\n </Flex>\n );\n },\n);\n\nTextInput.displayName = 'TextInput';\nconst WrappedTextInput = withFormControl<TextInputProps>(TextInput);\n\nexport { WrappedTextInput as TextInput };\n"],"names":["FieldInput","forwardRef","props","ref","field","useFieldContext","mergedProps","mergeProps","jsx","ark","withContext","createRecipeContext","Input","Field.Input","closeButtonSizeMap","TextInput","React","charLimit","clearable","disabled","inputRef","invalid","leftAddon","leftElement","onClear","onContrast","rightAddon","rightElement","size","value","dataTestId","rest","handleClear","Button","currentCharCount","useMemo","jsxs","Flex","InputGroup","CInput","CharacterCounter","WrappedTextInput","withFormControl"],"mappings":"wfAOMA,EAAaC,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,EACDH,EAAW,YAAc,aCPzB,KAAM,CAAE,YAAAU,CAA2B,EAAIC,sBAAoB,CACzD,IAAK,OACP,CAAC,EACKC,EAAQF,EAAYG,CAAW,ECLxBC,EAA0D,CACrE,GAAI,KACJ,GAAI,KACJ,GAAI,IACN,ECwDMC,EAAYC,EAAM,QAAA,WACtB,CACE,CACE,UAAAC,EAAY,OACZ,UAAAC,EAAY,GACZ,SAAAC,EAAW,GACX,SAAAC,EACA,QAAAC,EACA,UAAAC,EACA,YAAAC,EACA,QAAAC,EACA,WAAAC,EACA,WAAAC,EACA,aAAAC,EACA,KAAAC,EAAO,KACP,MAAAC,EACA,CAAC,eAAgBC,EAAa,oBAC9B,GAAGC,GAEL5B,IACsB,CACtB,MAAM6B,EAAc,IAAY,CAC1BR,GACFA,EAAQK,GAAS,EAAE,CAEvB,EAEIX,GAAeW,GAAS,CAACV,IAEzBQ,EAAAnB,EAAA,kBAAA,IAACyB,EAAA,OAAA,CACC,UAAU,yBACV,cAAa,GAAGH,CAAU,gBAC1B,KAAMhB,EAAmBc,CAAuB,EAChD,QAAQ,eACR,QAASI,EACT,SAAS,OAAA,CACX,GAIE,MAAAE,EAAmBC,UAAQ,IAAMN,GAAO,YAAY,QAAU,EAAG,CAACA,CAAK,CAAC,EAG5E,OAAAO,EAAA,kBAAA,KAACC,EAAK,KAAA,CAAA,UAAU,qBAAqB,EAAE,OAAO,cAAc,SAAS,IAAK,EAAG,WAAW,WACtF,SAAA,CAAA7B,EAAA,kBAAA,IAAC8B,EAAA,WAAA,CACC,UAAU,wBACV,cAAa,GAAGR,CAAU,eAC1B,aAAcP,EACd,kBAAmB,CACjB,MAAO,UACP,eAAgB,CAAE,QAAS,EAAI,CACjC,EACA,WAAYI,EACZ,gBAAiB,CACf,MAAO,UACP,cAAe,IACf,eAAgB,CAAE,QAAS,EAAI,CACjC,EACA,WAAYL,EACZ,SAAUI,EAEV,SAAAlB,EAAA,kBAAA,IAAC+B,EAAA,CACC,cAAaT,EACb,UAAU,YACV,IAAKV,GAAYjB,EACjB,MAAA0B,EACA,KAAAD,EACA,SAAAT,EACC,GAAIE,GAAW,CAAE,eAAgB,EAAK,EACvC,QAASI,EAAa,aAAe,UACpC,GAAGM,CAAA,CAAA,CACN,CACF,EACC,CAAC,CAACd,GACDT,EAAA,kBAAA,IAACgC,EAAA,iBAAA,CACC,cAAa,GAAGV,CAAU,qBAC1B,UAAW,GACX,MAAOb,EACP,aAAciB,CAAA,CAAA,CAChB,EAEJ,CAAA,CAGN,EAEAnB,EAAU,YAAc,YAClB,MAAA0B,EAAmBC,kBAAgC3B,CAAS","x_google_ignoreList":[0,1]}
@@ -1,2 +1,2 @@
1
- "use strict";const l=require("./jsx-runtime-BjDatQAs.js"),c=require("react"),h=require("./withFormControl-BSlIlVY0.js"),v=require("./characterCounter.component-BRHLt929.js"),w=require("./flex-BOU6tYUd.js"),b=require("./create-recipe-context-CDw-39SC.js"),p=require("./index-CQURjLlA.js"),x=require("./use-locale-context-ym21RUxU.js"),C=require("./use-field-context-Cm29IQ7H.js"),F=e=>e&&e.__esModule?e:{default:e},y=F(c);var R=e=>{if(!e)return;const t=p.getComputedStyle(e),o=p.getWindow(e),i=p.getDocument(e),r=()=>{requestAnimationFrame(()=>{e.style.height="auto";let a;t.boxSizing==="content-box"?a=e.scrollHeight-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):a=e.scrollHeight+parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),t.maxHeight!=="none"&&a>parseFloat(t.maxHeight)?(t.overflowY==="hidden"&&(e.style.overflowY="scroll"),a=parseFloat(t.maxHeight)):t.overflowY!=="hidden"&&(e.style.overflowY="hidden"),e.style.height=`${a}px`})};e.addEventListener("input",r),e.form?.addEventListener("reset",r);const n=Object.getPrototypeOf(e),s=Object.getOwnPropertyDescriptor(n,"value");Object.defineProperty(e,"value",{...s,set(){s?.set?.apply(this,arguments),r()}});const d=new o.ResizeObserver(()=>{requestAnimationFrame(()=>r())});d.observe(e);const u=new o.MutationObserver(()=>r());return u.observe(e,{attributes:!0,attributeFilter:["rows","placeholder"]}),i.fonts?.addEventListener("loadingdone",r),()=>{e.removeEventListener("input",r),e.form?.removeEventListener("reset",r),i.fonts?.removeEventListener("loadingdone",r),d.disconnect(),u.disconnect()}};const m=c.forwardRef((e,t)=>{const{autoresize:o,...i}=e,r=c.useRef(null),n=C.useFieldContext(),s=p.mergeProps(n?.getTextareaProps(),{style:{resize:o?"none":void 0}},i);return c.useEffect(()=>{if(o)return R(r.current)},[o]),l.jsxRuntimeExports.jsx(x.ark.textarea,{...s,ref:x.composeRefs(t,r)})});m.displayName="FieldTextarea";const{withContext:j}=b.createRecipeContext({key:"textarea"}),T=j(m),f=y.default.forwardRef(({charLimit:e=void 0,invalid:t,onContrast:o,resize:i="none",textareaRef:r,value:n,["data-testid"]:s="kibble-textarea",...d},u)=>{const a=o?"onContrast":"default",g=c.useMemo(()=>n?.toString()?.length||0,[n]);return l.jsxRuntimeExports.jsxs(w.Flex,{className:"Textarea__Wrapper",flexDirection:"column",w:"100%",gap:1,alignItems:"flex-end",children:[l.jsxRuntimeExports.jsx(T,{className:"Textarea","data-testid":s,ref:r||u,resize:i,variant:a,value:n,...t&&{"aria-invalid":!0},minH:"140px",...d}),!!e&&l.jsxRuntimeExports.jsx(v.CharacterCounter,{"data-testid":`${s}-character-counter`,withLimit:!0,limit:e,currentCount:g})]})});f.displayName="Textarea";const q=h.withFormControl(f);exports.WrappedTextarea=q;
2
- //# sourceMappingURL=textarea.component-DteG1L4y.js.map
1
+ "use strict";const l=require("./jsx-runtime-BjDatQAs.js"),c=require("react"),h=require("./withFormControl-QV_Jridv.js"),v=require("./characterCounter.component-BRHLt929.js"),w=require("./flex-BOU6tYUd.js"),b=require("./create-recipe-context-CDw-39SC.js"),p=require("./index-CQURjLlA.js"),x=require("./use-locale-context-ym21RUxU.js"),C=require("./use-field-context-Cm29IQ7H.js"),F=e=>e&&e.__esModule?e:{default:e},y=F(c);var R=e=>{if(!e)return;const t=p.getComputedStyle(e),o=p.getWindow(e),i=p.getDocument(e),r=()=>{requestAnimationFrame(()=>{e.style.height="auto";let a;t.boxSizing==="content-box"?a=e.scrollHeight-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):a=e.scrollHeight+parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),t.maxHeight!=="none"&&a>parseFloat(t.maxHeight)?(t.overflowY==="hidden"&&(e.style.overflowY="scroll"),a=parseFloat(t.maxHeight)):t.overflowY!=="hidden"&&(e.style.overflowY="hidden"),e.style.height=`${a}px`})};e.addEventListener("input",r),e.form?.addEventListener("reset",r);const n=Object.getPrototypeOf(e),s=Object.getOwnPropertyDescriptor(n,"value");Object.defineProperty(e,"value",{...s,set(){s?.set?.apply(this,arguments),r()}});const d=new o.ResizeObserver(()=>{requestAnimationFrame(()=>r())});d.observe(e);const u=new o.MutationObserver(()=>r());return u.observe(e,{attributes:!0,attributeFilter:["rows","placeholder"]}),i.fonts?.addEventListener("loadingdone",r),()=>{e.removeEventListener("input",r),e.form?.removeEventListener("reset",r),i.fonts?.removeEventListener("loadingdone",r),d.disconnect(),u.disconnect()}};const m=c.forwardRef((e,t)=>{const{autoresize:o,...i}=e,r=c.useRef(null),n=C.useFieldContext(),s=p.mergeProps(n?.getTextareaProps(),{style:{resize:o?"none":void 0}},i);return c.useEffect(()=>{if(o)return R(r.current)},[o]),l.jsxRuntimeExports.jsx(x.ark.textarea,{...s,ref:x.composeRefs(t,r)})});m.displayName="FieldTextarea";const{withContext:j}=b.createRecipeContext({key:"textarea"}),T=j(m),f=y.default.forwardRef(({charLimit:e=void 0,invalid:t,onContrast:o,resize:i="none",textareaRef:r,value:n,["data-testid"]:s="kibble-textarea",...d},u)=>{const a=o?"onContrast":"default",g=c.useMemo(()=>n?.toString()?.length||0,[n]);return l.jsxRuntimeExports.jsxs(w.Flex,{className:"Textarea__Wrapper",flexDirection:"column",w:"100%",gap:1,alignItems:"flex-end",children:[l.jsxRuntimeExports.jsx(T,{className:"Textarea","data-testid":s,ref:r||u,resize:i,variant:a,value:n,...t&&{"aria-invalid":!0},minH:"140px",...d}),!!e&&l.jsxRuntimeExports.jsx(v.CharacterCounter,{"data-testid":`${s}-character-counter`,withLimit:!0,limit:e,currentCount:g})]})});f.displayName="Textarea";const q=h.withFormControl(f);exports.WrappedTextarea=q;
2
+ //# sourceMappingURL=textarea.component-BIg_XX_R.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"textarea.component-DteG1L4y.js","sources":["../../node_modules/@zag-js/auto-resize/dist/index.mjs","../../node_modules/@ark-ui/react/dist/components/field/field-textarea.js","../../node_modules/@chakra-ui/react/dist/esm/components/textarea/textarea.js","../../src/components/Textarea/textarea.component.tsx"],"sourcesContent":["import { getDocument, getWindow, getComputedStyle } from '@zag-js/dom-query';\n\n// src/autoresize-input.ts\nfunction getVisualStyles(node) {\n if (!node) return;\n const style = getComputedStyle(node);\n return \"box-sizing:\" + style.boxSizing + \";border-left:\" + style.borderLeftWidth + \" solid red;border-right:\" + style.borderRightWidth + \" solid red;font-family:\" + style.fontFamily + \";font-feature-settings:\" + style.fontFeatureSettings + \";font-kerning:\" + style.fontKerning + \";font-size:\" + style.fontSize + \";font-stretch:\" + style.fontStretch + \";font-style:\" + style.fontStyle + \";font-variant:\" + style.fontVariant + \";font-variant-caps:\" + style.fontVariantCaps + \";font-variant-ligatures:\" + style.fontVariantLigatures + \";font-variant-numeric:\" + style.fontVariantNumeric + \";font-weight:\" + style.fontWeight + \";letter-spacing:\" + style.letterSpacing + \";margin-left:\" + style.marginLeft + \";margin-right:\" + style.marginRight + \";padding-left:\" + style.paddingLeft + \";padding-right:\" + style.paddingRight + \";text-indent:\" + style.textIndent + \";text-transform:\" + style.textTransform;\n}\n\n// src/autoresize-input.ts\nfunction createGhostElement(doc) {\n var el = doc.createElement(\"div\");\n el.id = \"ghost\";\n el.style.cssText = \"display:inline-block;height:0;overflow:hidden;position:absolute;top:0;visibility:hidden;white-space:nowrap;\";\n doc.body.appendChild(el);\n return el;\n}\nfunction autoResizeInput(input) {\n if (!input) return;\n const doc = getDocument(input);\n const win = getWindow(input);\n const ghost = createGhostElement(doc);\n const cssText = getVisualStyles(input);\n if (cssText) ghost.style.cssText += cssText;\n function resize() {\n win.requestAnimationFrame(() => {\n ghost.innerHTML = input.value;\n const rect = win.getComputedStyle(ghost);\n input?.style.setProperty(\"width\", rect.width);\n });\n }\n resize();\n input?.addEventListener(\"input\", resize);\n input?.addEventListener(\"change\", resize);\n return () => {\n doc.body.removeChild(ghost);\n input?.removeEventListener(\"input\", resize);\n input?.removeEventListener(\"change\", resize);\n };\n}\nvar autoresizeTextarea = (el) => {\n if (!el) return;\n const style = getComputedStyle(el);\n const win = getWindow(el);\n const doc = getDocument(el);\n const resize = () => {\n requestAnimationFrame(() => {\n el.style.height = \"auto\";\n let newHeight;\n if (style.boxSizing === \"content-box\") {\n newHeight = el.scrollHeight - (parseFloat(style.paddingTop) + parseFloat(style.paddingBottom));\n } else {\n newHeight = el.scrollHeight + parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);\n }\n if (style.maxHeight !== \"none\" && newHeight > parseFloat(style.maxHeight)) {\n if (style.overflowY === \"hidden\") {\n el.style.overflowY = \"scroll\";\n }\n newHeight = parseFloat(style.maxHeight);\n } else if (style.overflowY !== \"hidden\") {\n el.style.overflowY = \"hidden\";\n }\n el.style.height = `${newHeight}px`;\n });\n };\n el.addEventListener(\"input\", resize);\n el.form?.addEventListener(\"reset\", resize);\n const elementPrototype = Object.getPrototypeOf(el);\n const descriptor = Object.getOwnPropertyDescriptor(elementPrototype, \"value\");\n Object.defineProperty(el, \"value\", {\n ...descriptor,\n set() {\n descriptor?.set?.apply(this, arguments);\n resize();\n }\n });\n const resizeObserver = new win.ResizeObserver(() => {\n requestAnimationFrame(() => resize());\n });\n resizeObserver.observe(el);\n const attrObserver = new win.MutationObserver(() => resize());\n attrObserver.observe(el, { attributes: true, attributeFilter: [\"rows\", \"placeholder\"] });\n doc.fonts?.addEventListener(\"loadingdone\", resize);\n return () => {\n el.removeEventListener(\"input\", resize);\n el.form?.removeEventListener(\"reset\", resize);\n doc.fonts?.removeEventListener(\"loadingdone\", resize);\n resizeObserver.disconnect();\n attrObserver.disconnect();\n };\n};\n\nexport { autoResizeInput, autoresizeTextarea };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { autoresizeTextarea } from '@zag-js/auto-resize';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef, useRef, useEffect } from 'react';\nimport { composeRefs } from '../../utils/compose-refs.js';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldTextarea = forwardRef((props, ref) => {\n const { autoresize, ...textareaProps } = props;\n const textareaRef = useRef(null);\n const field = useFieldContext();\n const mergedProps = mergeProps(\n field?.getTextareaProps(),\n { style: { resize: autoresize ? \"none\" : void 0 } },\n textareaProps\n );\n useEffect(() => {\n if (!autoresize) return;\n return autoresizeTextarea(textareaRef.current);\n }, [autoresize]);\n return /* @__PURE__ */ jsx(ark.textarea, { ...mergedProps, ref: composeRefs(ref, textareaRef) });\n});\nFieldTextarea.displayName = \"FieldTextarea\";\n\nexport { FieldTextarea };\n","\"use strict\";\n\"use client\";\nimport { Field } from '@ark-ui/react/field';\nimport { createRecipeContext } from '../../styled-system/create-recipe-context.js';\n\nconst { withContext, PropsProvider } = createRecipeContext({\n key: \"textarea\"\n});\nconst Textarea = withContext(\n Field.Textarea\n);\nconst TextareaPropsProvider = PropsProvider;\n\nexport { Textarea, TextareaPropsProvider };\n","import React, { useMemo } from 'react';\nimport { Textarea as CTextarea, TextareaProps as CTextareaProps } from '@chakra-ui/react/textarea';\nimport { FormControlSize } from 'hocs/withFormControl/withFormControl.types';\nimport { withFormControl, WithFormControlProps } from 'hocs/withFormControl/withFormControl';\nimport { Flex } from '@chakra-ui/react/flex';\nimport { CharacterCounter } from 'components/CharacterCounter/characterCounter.component';\n\nexport interface TextareaProps extends WithFormControlProps, CTextareaProps {\n /** The maximum number of characters that can be entered into the textarea. */\n charLimit?: number;\n /** Ref to the textarea element. */\n textareaRef?: React.Ref<HTMLTextAreaElement | null>;\n /** Placeholder text for the textarea. */\n placeholder?: string;\n /**\n * The size of the textarea.\n * @default md\n */\n size?: FormControlSize;\n /**\n * Data test id for the textarea.\n * @default kibble-textarea\n */\n 'data-testid'?: string;\n}\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n (\n {\n charLimit = undefined,\n invalid,\n onContrast,\n resize = 'none',\n textareaRef,\n value,\n ['data-testid']: dataTestId = 'kibble-textarea',\n ...rest\n },\n ref,\n ): React.JSX.Element => {\n const _computedVariant = onContrast ? 'onContrast' : 'default';\n\n const currentCharCount = useMemo(() => value?.toString()?.length || 0, [value]);\n\n return (\n <Flex className=\"Textarea__Wrapper\" flexDirection=\"column\" w=\"100%\" gap={1} alignItems=\"flex-end\">\n <CTextarea\n className=\"Textarea\"\n data-testid={dataTestId}\n ref={textareaRef || ref}\n resize={resize}\n variant={_computedVariant}\n value={value}\n {...(invalid && { 'aria-invalid': true })}\n minH=\"140px\"\n {...rest}\n />\n {!!charLimit && (\n <CharacterCounter\n data-testid={`${dataTestId}-character-counter`}\n withLimit={true}\n limit={charLimit}\n currentCount={currentCharCount}\n />\n )}\n </Flex>\n );\n },\n);\n\nTextarea.displayName = 'Textarea';\nconst WrappedTextarea = withFormControl<TextareaProps>(Textarea);\n\nexport { WrappedTextarea as Textarea };\n"],"names":["autoresizeTextarea","el","style","getComputedStyle","win","getWindow","doc","getDocument","resize","newHeight","elementPrototype","descriptor","resizeObserver","attrObserver","FieldTextarea","forwardRef","props","ref","autoresize","textareaProps","textareaRef","useRef","field","useFieldContext","mergedProps","mergeProps","useEffect","jsx","ark","composeRefs","withContext","createRecipeContext","Textarea","Field.Textarea","React","charLimit","invalid","onContrast","value","dataTestId","rest","_computedVariant","currentCharCount","useMemo","jsxs","Flex","CTextarea","CharacterCounter","WrappedTextarea","withFormControl"],"mappings":"qaAwCA,IAAIA,EAAsBC,GAAO,CAC/B,GAAI,CAACA,EAAI,OACT,MAAMC,EAAQC,EAAgB,iBAACF,CAAE,EAC3BG,EAAMC,EAAS,UAACJ,CAAE,EAClBK,EAAMC,EAAW,YAACN,CAAE,EACpBO,EAAS,IAAM,CACnB,sBAAsB,IAAM,CAC1BP,EAAG,MAAM,OAAS,OAClB,IAAIQ,EACAP,EAAM,YAAc,cACtBO,EAAYR,EAAG,cAAgB,WAAWC,EAAM,UAAU,EAAI,WAAWA,EAAM,aAAa,GAE5FO,EAAYR,EAAG,aAAe,WAAWC,EAAM,cAAc,EAAI,WAAWA,EAAM,iBAAiB,EAEjGA,EAAM,YAAc,QAAUO,EAAY,WAAWP,EAAM,SAAS,GAClEA,EAAM,YAAc,WACtBD,EAAG,MAAM,UAAY,UAEvBQ,EAAY,WAAWP,EAAM,SAAS,GAC7BA,EAAM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CAAC,EACQS,wBAAIC,EAAAA,IAAI,SAAU,CAAE,GAAGJ,EAAa,IAAKK,cAAYZ,EAAKG,CAAW,EAAG,CACjG,CAAC,EACDN,EAAc,YAAc,gBCnB5B,KAAM,CAAE,YAAAgB,CAA2B,EAAIC,sBAAoB,CACzD,IAAK,UACP,CAAC,EACKC,EAAWF,EACfG,CACF,ECgBMD,EAAWE,EAAM,QAAA,WACrB,CACE,CACE,UAAAC,EAAY,OACZ,QAAAC,EACA,WAAAC,EACA,OAAA7B,EAAS,OACT,YAAAY,EACA,MAAAkB,EACA,CAAC,eAAgBC,EAAa,kBAC9B,GAAGC,GAELvB,IACsB,CAChB,MAAAwB,EAAmBJ,EAAa,aAAe,UAE/CK,EAAmBC,UAAQ,IAAML,GAAO,YAAY,QAAU,EAAG,CAACA,CAAK,CAAC,EAG5E,OAAAM,EAAA,kBAAA,KAACC,EAAK,KAAA,CAAA,UAAU,oBAAoB,cAAc,SAAS,EAAE,OAAO,IAAK,EAAG,WAAW,WACrF,SAAA,CAAAlB,EAAA,kBAAA,IAACmB,EAAA,CACC,UAAU,WACV,cAAaP,EACb,IAAKnB,GAAeH,EACpB,OAAAT,EACA,QAASiC,EACT,MAAAH,EACC,GAAIF,GAAW,CAAE,eAAgB,EAAK,EACvC,KAAK,QACJ,GAAGI,CAAA,CACN,EACC,CAAC,CAACL,GACDR,EAAA,kBAAA,IAACoB,EAAA,iBAAA,CACC,cAAa,GAAGR,CAAU,qBAC1B,UAAW,GACX,MAAOJ,EACP,aAAcO,CAAA,CAAA,CAChB,EAEJ,CAAA,CAGN,EAEAV,EAAS,YAAc,WACjB,MAAAgB,EAAkBC,kBAA+BjB,CAAQ","x_google_ignoreList":[0,1,2]}
1
+ {"version":3,"file":"textarea.component-BIg_XX_R.js","sources":["../../node_modules/@zag-js/auto-resize/dist/index.mjs","../../node_modules/@ark-ui/react/dist/components/field/field-textarea.js","../../node_modules/@chakra-ui/react/dist/esm/components/textarea/textarea.js","../../src/components/Textarea/textarea.component.tsx"],"sourcesContent":["import { getDocument, getWindow, getComputedStyle } from '@zag-js/dom-query';\n\n// src/autoresize-input.ts\nfunction getVisualStyles(node) {\n if (!node) return;\n const style = getComputedStyle(node);\n return \"box-sizing:\" + style.boxSizing + \";border-left:\" + style.borderLeftWidth + \" solid red;border-right:\" + style.borderRightWidth + \" solid red;font-family:\" + style.fontFamily + \";font-feature-settings:\" + style.fontFeatureSettings + \";font-kerning:\" + style.fontKerning + \";font-size:\" + style.fontSize + \";font-stretch:\" + style.fontStretch + \";font-style:\" + style.fontStyle + \";font-variant:\" + style.fontVariant + \";font-variant-caps:\" + style.fontVariantCaps + \";font-variant-ligatures:\" + style.fontVariantLigatures + \";font-variant-numeric:\" + style.fontVariantNumeric + \";font-weight:\" + style.fontWeight + \";letter-spacing:\" + style.letterSpacing + \";margin-left:\" + style.marginLeft + \";margin-right:\" + style.marginRight + \";padding-left:\" + style.paddingLeft + \";padding-right:\" + style.paddingRight + \";text-indent:\" + style.textIndent + \";text-transform:\" + style.textTransform;\n}\n\n// src/autoresize-input.ts\nfunction createGhostElement(doc) {\n var el = doc.createElement(\"div\");\n el.id = \"ghost\";\n el.style.cssText = \"display:inline-block;height:0;overflow:hidden;position:absolute;top:0;visibility:hidden;white-space:nowrap;\";\n doc.body.appendChild(el);\n return el;\n}\nfunction autoResizeInput(input) {\n if (!input) return;\n const doc = getDocument(input);\n const win = getWindow(input);\n const ghost = createGhostElement(doc);\n const cssText = getVisualStyles(input);\n if (cssText) ghost.style.cssText += cssText;\n function resize() {\n win.requestAnimationFrame(() => {\n ghost.innerHTML = input.value;\n const rect = win.getComputedStyle(ghost);\n input?.style.setProperty(\"width\", rect.width);\n });\n }\n resize();\n input?.addEventListener(\"input\", resize);\n input?.addEventListener(\"change\", resize);\n return () => {\n doc.body.removeChild(ghost);\n input?.removeEventListener(\"input\", resize);\n input?.removeEventListener(\"change\", resize);\n };\n}\nvar autoresizeTextarea = (el) => {\n if (!el) return;\n const style = getComputedStyle(el);\n const win = getWindow(el);\n const doc = getDocument(el);\n const resize = () => {\n requestAnimationFrame(() => {\n el.style.height = \"auto\";\n let newHeight;\n if (style.boxSizing === \"content-box\") {\n newHeight = el.scrollHeight - (parseFloat(style.paddingTop) + parseFloat(style.paddingBottom));\n } else {\n newHeight = el.scrollHeight + parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);\n }\n if (style.maxHeight !== \"none\" && newHeight > parseFloat(style.maxHeight)) {\n if (style.overflowY === \"hidden\") {\n el.style.overflowY = \"scroll\";\n }\n newHeight = parseFloat(style.maxHeight);\n } else if (style.overflowY !== \"hidden\") {\n el.style.overflowY = \"hidden\";\n }\n el.style.height = `${newHeight}px`;\n });\n };\n el.addEventListener(\"input\", resize);\n el.form?.addEventListener(\"reset\", resize);\n const elementPrototype = Object.getPrototypeOf(el);\n const descriptor = Object.getOwnPropertyDescriptor(elementPrototype, \"value\");\n Object.defineProperty(el, \"value\", {\n ...descriptor,\n set() {\n descriptor?.set?.apply(this, arguments);\n resize();\n }\n });\n const resizeObserver = new win.ResizeObserver(() => {\n requestAnimationFrame(() => resize());\n });\n resizeObserver.observe(el);\n const attrObserver = new win.MutationObserver(() => resize());\n attrObserver.observe(el, { attributes: true, attributeFilter: [\"rows\", \"placeholder\"] });\n doc.fonts?.addEventListener(\"loadingdone\", resize);\n return () => {\n el.removeEventListener(\"input\", resize);\n el.form?.removeEventListener(\"reset\", resize);\n doc.fonts?.removeEventListener(\"loadingdone\", resize);\n resizeObserver.disconnect();\n attrObserver.disconnect();\n };\n};\n\nexport { autoResizeInput, autoresizeTextarea };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { autoresizeTextarea } from '@zag-js/auto-resize';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef, useRef, useEffect } from 'react';\nimport { composeRefs } from '../../utils/compose-refs.js';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldTextarea = forwardRef((props, ref) => {\n const { autoresize, ...textareaProps } = props;\n const textareaRef = useRef(null);\n const field = useFieldContext();\n const mergedProps = mergeProps(\n field?.getTextareaProps(),\n { style: { resize: autoresize ? \"none\" : void 0 } },\n textareaProps\n );\n useEffect(() => {\n if (!autoresize) return;\n return autoresizeTextarea(textareaRef.current);\n }, [autoresize]);\n return /* @__PURE__ */ jsx(ark.textarea, { ...mergedProps, ref: composeRefs(ref, textareaRef) });\n});\nFieldTextarea.displayName = \"FieldTextarea\";\n\nexport { FieldTextarea };\n","\"use strict\";\n\"use client\";\nimport { Field } from '@ark-ui/react/field';\nimport { createRecipeContext } from '../../styled-system/create-recipe-context.js';\n\nconst { withContext, PropsProvider } = createRecipeContext({\n key: \"textarea\"\n});\nconst Textarea = withContext(\n Field.Textarea\n);\nconst TextareaPropsProvider = PropsProvider;\n\nexport { Textarea, TextareaPropsProvider };\n","import React, { useMemo } from 'react';\nimport { Textarea as CTextarea, TextareaProps as CTextareaProps } from '@chakra-ui/react/textarea';\nimport { FormControlSize } from 'hocs/withFormControl/withFormControl.types';\nimport { withFormControl, WithFormControlProps } from 'hocs/withFormControl/withFormControl';\nimport { Flex } from '@chakra-ui/react/flex';\nimport { CharacterCounter } from 'components/CharacterCounter/characterCounter.component';\n\nexport interface TextareaProps extends WithFormControlProps, CTextareaProps {\n /** The maximum number of characters that can be entered into the textarea. */\n charLimit?: number;\n /** Ref to the textarea element. */\n textareaRef?: React.Ref<HTMLTextAreaElement | null>;\n /** Placeholder text for the textarea. */\n placeholder?: string;\n /**\n * The size of the textarea.\n * @default md\n */\n size?: FormControlSize;\n /**\n * Data test id for the textarea.\n * @default kibble-textarea\n */\n 'data-testid'?: string;\n}\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n (\n {\n charLimit = undefined,\n invalid,\n onContrast,\n resize = 'none',\n textareaRef,\n value,\n ['data-testid']: dataTestId = 'kibble-textarea',\n ...rest\n },\n ref,\n ): React.JSX.Element => {\n const _computedVariant = onContrast ? 'onContrast' : 'default';\n\n const currentCharCount = useMemo(() => value?.toString()?.length || 0, [value]);\n\n return (\n <Flex className=\"Textarea__Wrapper\" flexDirection=\"column\" w=\"100%\" gap={1} alignItems=\"flex-end\">\n <CTextarea\n className=\"Textarea\"\n data-testid={dataTestId}\n ref={textareaRef || ref}\n resize={resize}\n variant={_computedVariant}\n value={value}\n {...(invalid && { 'aria-invalid': true })}\n minH=\"140px\"\n {...rest}\n />\n {!!charLimit && (\n <CharacterCounter\n data-testid={`${dataTestId}-character-counter`}\n withLimit={true}\n limit={charLimit}\n currentCount={currentCharCount}\n />\n )}\n </Flex>\n );\n },\n);\n\nTextarea.displayName = 'Textarea';\nconst WrappedTextarea = withFormControl<TextareaProps>(Textarea);\n\nexport { WrappedTextarea as Textarea };\n"],"names":["autoresizeTextarea","el","style","getComputedStyle","win","getWindow","doc","getDocument","resize","newHeight","elementPrototype","descriptor","resizeObserver","attrObserver","FieldTextarea","forwardRef","props","ref","autoresize","textareaProps","textareaRef","useRef","field","useFieldContext","mergedProps","mergeProps","useEffect","jsx","ark","composeRefs","withContext","createRecipeContext","Textarea","Field.Textarea","React","charLimit","invalid","onContrast","value","dataTestId","rest","_computedVariant","currentCharCount","useMemo","jsxs","Flex","CTextarea","CharacterCounter","WrappedTextarea","withFormControl"],"mappings":"qaAwCA,IAAIA,EAAsBC,GAAO,CAC/B,GAAI,CAACA,EAAI,OACT,MAAMC,EAAQC,EAAgB,iBAACF,CAAE,EAC3BG,EAAMC,EAAS,UAACJ,CAAE,EAClBK,EAAMC,EAAW,YAACN,CAAE,EACpBO,EAAS,IAAM,CACnB,sBAAsB,IAAM,CAC1BP,EAAG,MAAM,OAAS,OAClB,IAAIQ,EACAP,EAAM,YAAc,cACtBO,EAAYR,EAAG,cAAgB,WAAWC,EAAM,UAAU,EAAI,WAAWA,EAAM,aAAa,GAE5FO,EAAYR,EAAG,aAAe,WAAWC,EAAM,cAAc,EAAI,WAAWA,EAAM,iBAAiB,EAEjGA,EAAM,YAAc,QAAUO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zlN2N.js";
2
2
  import l, { forwardRef as x, useRef as g, useEffect as h, useMemo as v } from "react";
3
- import { w } from "./withFormControl-08PrhcOk.js";
3
+ import { w } from "./withFormControl-DW9A6BSL.js";
4
4
  import { C as b } from "./characterCounter.component-DI_FQNUR.js";
5
5
  import { F as y } from "./flex-CX-8gE9T.js";
6
6
  import { c as F } from "./create-recipe-context-DfQ-MTih.js";
@@ -93,4 +93,4 @@ const q = w(f);
93
93
  export {
94
94
  q as W
95
95
  };
96
- //# sourceMappingURL=textarea.component-W9VBnd4-.js.map
96
+ //# sourceMappingURL=textarea.component-C6Wt1Pk8.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"textarea.component-W9VBnd4-.js","sources":["../../node_modules/@zag-js/auto-resize/dist/index.mjs","../../node_modules/@ark-ui/react/dist/components/field/field-textarea.js","../../node_modules/@chakra-ui/react/dist/esm/components/textarea/textarea.js","../../src/components/Textarea/textarea.component.tsx"],"sourcesContent":["import { getDocument, getWindow, getComputedStyle } from '@zag-js/dom-query';\n\n// src/autoresize-input.ts\nfunction getVisualStyles(node) {\n if (!node) return;\n const style = getComputedStyle(node);\n return \"box-sizing:\" + style.boxSizing + \";border-left:\" + style.borderLeftWidth + \" solid red;border-right:\" + style.borderRightWidth + \" solid red;font-family:\" + style.fontFamily + \";font-feature-settings:\" + style.fontFeatureSettings + \";font-kerning:\" + style.fontKerning + \";font-size:\" + style.fontSize + \";font-stretch:\" + style.fontStretch + \";font-style:\" + style.fontStyle + \";font-variant:\" + style.fontVariant + \";font-variant-caps:\" + style.fontVariantCaps + \";font-variant-ligatures:\" + style.fontVariantLigatures + \";font-variant-numeric:\" + style.fontVariantNumeric + \";font-weight:\" + style.fontWeight + \";letter-spacing:\" + style.letterSpacing + \";margin-left:\" + style.marginLeft + \";margin-right:\" + style.marginRight + \";padding-left:\" + style.paddingLeft + \";padding-right:\" + style.paddingRight + \";text-indent:\" + style.textIndent + \";text-transform:\" + style.textTransform;\n}\n\n// src/autoresize-input.ts\nfunction createGhostElement(doc) {\n var el = doc.createElement(\"div\");\n el.id = \"ghost\";\n el.style.cssText = \"display:inline-block;height:0;overflow:hidden;position:absolute;top:0;visibility:hidden;white-space:nowrap;\";\n doc.body.appendChild(el);\n return el;\n}\nfunction autoResizeInput(input) {\n if (!input) return;\n const doc = getDocument(input);\n const win = getWindow(input);\n const ghost = createGhostElement(doc);\n const cssText = getVisualStyles(input);\n if (cssText) ghost.style.cssText += cssText;\n function resize() {\n win.requestAnimationFrame(() => {\n ghost.innerHTML = input.value;\n const rect = win.getComputedStyle(ghost);\n input?.style.setProperty(\"width\", rect.width);\n });\n }\n resize();\n input?.addEventListener(\"input\", resize);\n input?.addEventListener(\"change\", resize);\n return () => {\n doc.body.removeChild(ghost);\n input?.removeEventListener(\"input\", resize);\n input?.removeEventListener(\"change\", resize);\n };\n}\nvar autoresizeTextarea = (el) => {\n if (!el) return;\n const style = getComputedStyle(el);\n const win = getWindow(el);\n const doc = getDocument(el);\n const resize = () => {\n requestAnimationFrame(() => {\n el.style.height = \"auto\";\n let newHeight;\n if (style.boxSizing === \"content-box\") {\n newHeight = el.scrollHeight - (parseFloat(style.paddingTop) + parseFloat(style.paddingBottom));\n } else {\n newHeight = el.scrollHeight + parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);\n }\n if (style.maxHeight !== \"none\" && newHeight > parseFloat(style.maxHeight)) {\n if (style.overflowY === \"hidden\") {\n el.style.overflowY = \"scroll\";\n }\n newHeight = parseFloat(style.maxHeight);\n } else if (style.overflowY !== \"hidden\") {\n el.style.overflowY = \"hidden\";\n }\n el.style.height = `${newHeight}px`;\n });\n };\n el.addEventListener(\"input\", resize);\n el.form?.addEventListener(\"reset\", resize);\n const elementPrototype = Object.getPrototypeOf(el);\n const descriptor = Object.getOwnPropertyDescriptor(elementPrototype, \"value\");\n Object.defineProperty(el, \"value\", {\n ...descriptor,\n set() {\n descriptor?.set?.apply(this, arguments);\n resize();\n }\n });\n const resizeObserver = new win.ResizeObserver(() => {\n requestAnimationFrame(() => resize());\n });\n resizeObserver.observe(el);\n const attrObserver = new win.MutationObserver(() => resize());\n attrObserver.observe(el, { attributes: true, attributeFilter: [\"rows\", \"placeholder\"] });\n doc.fonts?.addEventListener(\"loadingdone\", resize);\n return () => {\n el.removeEventListener(\"input\", resize);\n el.form?.removeEventListener(\"reset\", resize);\n doc.fonts?.removeEventListener(\"loadingdone\", resize);\n resizeObserver.disconnect();\n attrObserver.disconnect();\n };\n};\n\nexport { autoResizeInput, autoresizeTextarea };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { autoresizeTextarea } from '@zag-js/auto-resize';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef, useRef, useEffect } from 'react';\nimport { composeRefs } from '../../utils/compose-refs.js';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldTextarea = forwardRef((props, ref) => {\n const { autoresize, ...textareaProps } = props;\n const textareaRef = useRef(null);\n const field = useFieldContext();\n const mergedProps = mergeProps(\n field?.getTextareaProps(),\n { style: { resize: autoresize ? \"none\" : void 0 } },\n textareaProps\n );\n useEffect(() => {\n if (!autoresize) return;\n return autoresizeTextarea(textareaRef.current);\n }, [autoresize]);\n return /* @__PURE__ */ jsx(ark.textarea, { ...mergedProps, ref: composeRefs(ref, textareaRef) });\n});\nFieldTextarea.displayName = \"FieldTextarea\";\n\nexport { FieldTextarea };\n","\"use strict\";\n\"use client\";\nimport { Field } from '@ark-ui/react/field';\nimport { createRecipeContext } from '../../styled-system/create-recipe-context.js';\n\nconst { withContext, PropsProvider } = createRecipeContext({\n key: \"textarea\"\n});\nconst Textarea = withContext(\n Field.Textarea\n);\nconst TextareaPropsProvider = PropsProvider;\n\nexport { Textarea, TextareaPropsProvider };\n","import React, { useMemo } from 'react';\nimport { Textarea as CTextarea, TextareaProps as CTextareaProps } from '@chakra-ui/react/textarea';\nimport { FormControlSize } from 'hocs/withFormControl/withFormControl.types';\nimport { withFormControl, WithFormControlProps } from 'hocs/withFormControl/withFormControl';\nimport { Flex } from '@chakra-ui/react/flex';\nimport { CharacterCounter } from 'components/CharacterCounter/characterCounter.component';\n\nexport interface TextareaProps extends WithFormControlProps, CTextareaProps {\n /** The maximum number of characters that can be entered into the textarea. */\n charLimit?: number;\n /** Ref to the textarea element. */\n textareaRef?: React.Ref<HTMLTextAreaElement | null>;\n /** Placeholder text for the textarea. */\n placeholder?: string;\n /**\n * The size of the textarea.\n * @default md\n */\n size?: FormControlSize;\n /**\n * Data test id for the textarea.\n * @default kibble-textarea\n */\n 'data-testid'?: string;\n}\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n (\n {\n charLimit = undefined,\n invalid,\n onContrast,\n resize = 'none',\n textareaRef,\n value,\n ['data-testid']: dataTestId = 'kibble-textarea',\n ...rest\n },\n ref,\n ): React.JSX.Element => {\n const _computedVariant = onContrast ? 'onContrast' : 'default';\n\n const currentCharCount = useMemo(() => value?.toString()?.length || 0, [value]);\n\n return (\n <Flex className=\"Textarea__Wrapper\" flexDirection=\"column\" w=\"100%\" gap={1} alignItems=\"flex-end\">\n <CTextarea\n className=\"Textarea\"\n data-testid={dataTestId}\n ref={textareaRef || ref}\n resize={resize}\n variant={_computedVariant}\n value={value}\n {...(invalid && { 'aria-invalid': true })}\n minH=\"140px\"\n {...rest}\n />\n {!!charLimit && (\n <CharacterCounter\n data-testid={`${dataTestId}-character-counter`}\n withLimit={true}\n limit={charLimit}\n currentCount={currentCharCount}\n />\n )}\n </Flex>\n );\n },\n);\n\nTextarea.displayName = 'Textarea';\nconst WrappedTextarea = withFormControl<TextareaProps>(Textarea);\n\nexport { WrappedTextarea as Textarea };\n"],"names":["autoresizeTextarea","el","style","getComputedStyle","win","getWindow","doc","getDocument","resize","newHeight","elementPrototype","descriptor","resizeObserver","attrObserver","FieldTextarea","forwardRef","props","ref","autoresize","textareaProps","textareaRef","useRef","field","useFieldContext","mergedProps","mergeProps","useEffect","jsx","ark","composeRefs","withContext","createRecipeContext","Textarea","Field.Textarea","React","charLimit","invalid","onContrast","value","dataTestId","rest","_computedVariant","currentCharCount","useMemo","jsxs","Flex","CTextarea","CharacterCounter","WrappedTextarea","withFormControl"],"mappings":";;;;;;;;;AAwCA,IAAIA,IAAqB,CAACC,MAAO;AAC/B,MAAI,CAACA,EAAI;AACT,QAAMC,IAAQC,EAAiBF,CAAE,GAC3BG,IAAMC,EAAUJ,CAAE,GAClBK,IAAMC,EAAYN,CAAE,GACpBO,IAAS,MAAM;AACnB,0BAAsB,MAAM;AAC1B,MAAAP,EAAG,MAAM,SAAS;AAClB,UAAIQ;AACJ,MAAIP,EAAM,cAAc,gBACtBO,IAAYR,EAAG,gBAAgB,WAAWC,EAAM,UAAU,IAAI,WAAWA,EAAM,aAAa,KAE5FO,IAAYR,EAAG,eAAe,WAAWC,EAAM,cAAc,IAAI,WAAWA,EAAM,iBAAiB,GAEjGA,EAAM,cAAc,UAAUO,IAAY,WAAWP,EAAM,SAAS,KAClEA,EAAM,cAAc,aACtBD,EAAG,MAAM,YAAY,WAEvBQ,IAAY,WAAWP,EAAM,SAAS,KAC7BA,EAAM,cAAc,aAC7BD,EAAG,MAAM,YAAY,WAEvBA,EAAG,MAAM,SAAS,GAAGQ,CAAS;AAAA,IACpC,CAAK;AAAA,EACF;AACD,EAAAR,EAAG,iBAAiB,SAASO,CAAM,GACnCP,EAAG,MAAM,iBAAiB,SAASO,CAAM;AACzC,QAAME,IAAmB,OAAO,eAAeT,CAAE,GAC3CU,IAAa,OAAO,yBAAyBD,GAAkB,OAAO;AAC5E,SAAO,eAAeT,GAAI,SAAS;AAAA,IACjC,GAAGU;AAAA,IACH,MAAM;AACJ,MAAAA,GAAY,KAAK,MAAM,MAAM,SAAS,GACtCH,EAAQ;AAAA,IACd;AAAA,EACA,CAAG;AACD,QAAMI,IAAiB,IAAIR,EAAI,eAAe,MAAM;AAClD,0BAAsB,MAAMI,GAAQ;AAAA,EACxC,CAAG;AACD,EAAAI,EAAe,QAAQ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ACsB;AAChB,UAAAwB,IAAmBJ,IAAa,eAAe,WAE/CK,IAAmBC,EAAQ,MAAML,GAAO,YAAY,UAAU,GAAG,CAACA,CAAK,CAAC;AAG5E,WAAAM,gBAAAA,EAAA,KAACC,GAAK,EAAA,WAAU,qBAAoB,eAAc,UAAS,GAAE,QAAO,KAAK,GAAG,YAAW,YACrF,UAAA;AAAA,MAAAlB,gBAAAA,EAAA;AAAA,QAACmB;AAAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,eAAaP;AAAA,UACb,KAAKnB,KAAeH;AAAA,UACpB,QAAAT;AAAA,UACA,SAASiC;AAAA,UACT,OAAAH;AAAA,UACC,GAAIF,KAAW,EAAE,gBAAgB,GAAK;AAAA,UACvC,MAAK;AAAA,UACJ,GAAGI;AAAA,QAAA;AAAA,MACN;AAAA,MACC,CAAC,CAACL,KACDR,gBAAAA,EAAA;AAAA,QAACoB;AAAA,QAAA;AAAA,UACC,eAAa,GAAGR,CAAU;AAAA,UAC1B,WAAW;AAAA,UACX,OAAOJ;AAAA,UACP,cAAcO;AAAA,QAAA;AAAA,MAAA;AAAA,IAChB,GAEJ;AAAA,EAAA;AAGN;AAEAV,EAAS,cAAc;AACjB,MAAAgB,IAAkBC,EAA+BjB,CAAQ;","x_google_ignoreList":[0,1,2]}
1
+ {"version":3,"file":"textarea.component-C6Wt1Pk8.js","sources":["../../node_modules/@zag-js/auto-resize/dist/index.mjs","../../node_modules/@ark-ui/react/dist/components/field/field-textarea.js","../../node_modules/@chakra-ui/react/dist/esm/components/textarea/textarea.js","../../src/components/Textarea/textarea.component.tsx"],"sourcesContent":["import { getDocument, getWindow, getComputedStyle } from '@zag-js/dom-query';\n\n// src/autoresize-input.ts\nfunction getVisualStyles(node) {\n if (!node) return;\n const style = getComputedStyle(node);\n return \"box-sizing:\" + style.boxSizing + \";border-left:\" + style.borderLeftWidth + \" solid red;border-right:\" + style.borderRightWidth + \" solid red;font-family:\" + style.fontFamily + \";font-feature-settings:\" + style.fontFeatureSettings + \";font-kerning:\" + style.fontKerning + \";font-size:\" + style.fontSize + \";font-stretch:\" + style.fontStretch + \";font-style:\" + style.fontStyle + \";font-variant:\" + style.fontVariant + \";font-variant-caps:\" + style.fontVariantCaps + \";font-variant-ligatures:\" + style.fontVariantLigatures + \";font-variant-numeric:\" + style.fontVariantNumeric + \";font-weight:\" + style.fontWeight + \";letter-spacing:\" + style.letterSpacing + \";margin-left:\" + style.marginLeft + \";margin-right:\" + style.marginRight + \";padding-left:\" + style.paddingLeft + \";padding-right:\" + style.paddingRight + \";text-indent:\" + style.textIndent + \";text-transform:\" + style.textTransform;\n}\n\n// src/autoresize-input.ts\nfunction createGhostElement(doc) {\n var el = doc.createElement(\"div\");\n el.id = \"ghost\";\n el.style.cssText = \"display:inline-block;height:0;overflow:hidden;position:absolute;top:0;visibility:hidden;white-space:nowrap;\";\n doc.body.appendChild(el);\n return el;\n}\nfunction autoResizeInput(input) {\n if (!input) return;\n const doc = getDocument(input);\n const win = getWindow(input);\n const ghost = createGhostElement(doc);\n const cssText = getVisualStyles(input);\n if (cssText) ghost.style.cssText += cssText;\n function resize() {\n win.requestAnimationFrame(() => {\n ghost.innerHTML = input.value;\n const rect = win.getComputedStyle(ghost);\n input?.style.setProperty(\"width\", rect.width);\n });\n }\n resize();\n input?.addEventListener(\"input\", resize);\n input?.addEventListener(\"change\", resize);\n return () => {\n doc.body.removeChild(ghost);\n input?.removeEventListener(\"input\", resize);\n input?.removeEventListener(\"change\", resize);\n };\n}\nvar autoresizeTextarea = (el) => {\n if (!el) return;\n const style = getComputedStyle(el);\n const win = getWindow(el);\n const doc = getDocument(el);\n const resize = () => {\n requestAnimationFrame(() => {\n el.style.height = \"auto\";\n let newHeight;\n if (style.boxSizing === \"content-box\") {\n newHeight = el.scrollHeight - (parseFloat(style.paddingTop) + parseFloat(style.paddingBottom));\n } else {\n newHeight = el.scrollHeight + parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);\n }\n if (style.maxHeight !== \"none\" && newHeight > parseFloat(style.maxHeight)) {\n if (style.overflowY === \"hidden\") {\n el.style.overflowY = \"scroll\";\n }\n newHeight = parseFloat(style.maxHeight);\n } else if (style.overflowY !== \"hidden\") {\n el.style.overflowY = \"hidden\";\n }\n el.style.height = `${newHeight}px`;\n });\n };\n el.addEventListener(\"input\", resize);\n el.form?.addEventListener(\"reset\", resize);\n const elementPrototype = Object.getPrototypeOf(el);\n const descriptor = Object.getOwnPropertyDescriptor(elementPrototype, \"value\");\n Object.defineProperty(el, \"value\", {\n ...descriptor,\n set() {\n descriptor?.set?.apply(this, arguments);\n resize();\n }\n });\n const resizeObserver = new win.ResizeObserver(() => {\n requestAnimationFrame(() => resize());\n });\n resizeObserver.observe(el);\n const attrObserver = new win.MutationObserver(() => resize());\n attrObserver.observe(el, { attributes: true, attributeFilter: [\"rows\", \"placeholder\"] });\n doc.fonts?.addEventListener(\"loadingdone\", resize);\n return () => {\n el.removeEventListener(\"input\", resize);\n el.form?.removeEventListener(\"reset\", resize);\n doc.fonts?.removeEventListener(\"loadingdone\", resize);\n resizeObserver.disconnect();\n attrObserver.disconnect();\n };\n};\n\nexport { autoResizeInput, autoresizeTextarea };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { autoresizeTextarea } from '@zag-js/auto-resize';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef, useRef, useEffect } from 'react';\nimport { composeRefs } from '../../utils/compose-refs.js';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from './use-field-context.js';\n\nconst FieldTextarea = forwardRef((props, ref) => {\n const { autoresize, ...textareaProps } = props;\n const textareaRef = useRef(null);\n const field = useFieldContext();\n const mergedProps = mergeProps(\n field?.getTextareaProps(),\n { style: { resize: autoresize ? \"none\" : void 0 } },\n textareaProps\n );\n useEffect(() => {\n if (!autoresize) return;\n return autoresizeTextarea(textareaRef.current);\n }, [autoresize]);\n return /* @__PURE__ */ jsx(ark.textarea, { ...mergedProps, ref: composeRefs(ref, textareaRef) });\n});\nFieldTextarea.displayName = \"FieldTextarea\";\n\nexport { FieldTextarea };\n","\"use strict\";\n\"use client\";\nimport { Field } from '@ark-ui/react/field';\nimport { createRecipeContext } from '../../styled-system/create-recipe-context.js';\n\nconst { withContext, PropsProvider } = createRecipeContext({\n key: \"textarea\"\n});\nconst Textarea = withContext(\n Field.Textarea\n);\nconst TextareaPropsProvider = PropsProvider;\n\nexport { Textarea, TextareaPropsProvider };\n","import React, { useMemo } from 'react';\nimport { Textarea as CTextarea, TextareaProps as CTextareaProps } from '@chakra-ui/react/textarea';\nimport { FormControlSize } from 'hocs/withFormControl/withFormControl.types';\nimport { withFormControl, WithFormControlProps } from 'hocs/withFormControl/withFormControl';\nimport { Flex } from '@chakra-ui/react/flex';\nimport { CharacterCounter } from 'components/CharacterCounter/characterCounter.component';\n\nexport interface TextareaProps extends WithFormControlProps, CTextareaProps {\n /** The maximum number of characters that can be entered into the textarea. */\n charLimit?: number;\n /** Ref to the textarea element. */\n textareaRef?: React.Ref<HTMLTextAreaElement | null>;\n /** Placeholder text for the textarea. */\n placeholder?: string;\n /**\n * The size of the textarea.\n * @default md\n */\n size?: FormControlSize;\n /**\n * Data test id for the textarea.\n * @default kibble-textarea\n */\n 'data-testid'?: string;\n}\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n (\n {\n charLimit = undefined,\n invalid,\n onContrast,\n resize = 'none',\n textareaRef,\n value,\n ['data-testid']: dataTestId = 'kibble-textarea',\n ...rest\n },\n ref,\n ): React.JSX.Element => {\n const _computedVariant = onContrast ? 'onContrast' : 'default';\n\n const currentCharCount = useMemo(() => value?.toString()?.length || 0, [value]);\n\n return (\n <Flex className=\"Textarea__Wrapper\" flexDirection=\"column\" w=\"100%\" gap={1} alignItems=\"flex-end\">\n <CTextarea\n className=\"Textarea\"\n data-testid={dataTestId}\n ref={textareaRef || ref}\n resize={resize}\n variant={_computedVariant}\n value={value}\n {...(invalid && { 'aria-invalid': true })}\n minH=\"140px\"\n {...rest}\n />\n {!!charLimit && (\n <CharacterCounter\n data-testid={`${dataTestId}-character-counter`}\n withLimit={true}\n limit={charLimit}\n currentCount={currentCharCount}\n />\n )}\n </Flex>\n );\n },\n);\n\nTextarea.displayName = 'Textarea';\nconst WrappedTextarea = withFormControl<TextareaProps>(Textarea);\n\nexport { WrappedTextarea as Textarea };\n"],"names":["autoresizeTextarea","el","style","getComputedStyle","win","getWindow","doc","getDocument","resize","newHeight","elementPrototype","descriptor","resizeObserver","attrObserver","FieldTextarea","forwardRef","props","ref","autoresize","textareaProps","textareaRef","useRef","field","useFieldContext","mergedProps","mergeProps","useEffect","jsx","ark","composeRefs","withContext","createRecipeContext","Textarea","Field.Textarea","React","charLimit","invalid","onContrast","value","dataTestId","rest","_computedVariant","currentCharCount","useMemo","jsxs","Flex","CTextarea","CharacterCounter","WrappedTextarea","withFormControl"],"mappings":";;;;;;;;;AAwCA,IAAIA,IAAqB,CAACC,MAAO;AAC/B,MAAI,CAACA,EAAI;AACT,QAAMC,IAAQC,EAAiBF,CAAE,GAC3BG,IAAMC,EAAUJ,CAAE,GAClBK,IAAMC,EAAYN,CAAE,GACpBO,IAAS,MAAM;AACnB,0BAAsB,MAAM;AAC1B,MAAAP,EAAG,MAAM,SAAS;AAClB,UAAIQ;AACJ,MAAIP,EAAM,cAAc,gBACtBO,IAAYR,EAAG,gBAAgB,WAAWC,EAAM,UAAU,IAAI,WAAWA,EAAM,aAAa,KAE5FO,IAAYR,EAAG,eAAe,WAAWC,EAAM,cAAc,IAAI,WAAWA,EAAM,iBAAiB,GAEjGA,EAAM,cAAc,UAAUO,IAAY,WAAWP,EAAM,SAAS,KAClEA,EAAM,cAAc,aACtBD,EAAG,MAAM,YAAY,WAEvBQ,IAAY,WAAWP,EAAM,SAAS,KAC7BA,EAAM,cAAc,aAC7BD,EAAG,MAAM,YAAY,WAEvBA,EAAG,MAAM,SAAS,GAAGQ,CAAS;AAAA,IACpC,CAAK;AAAA,EACF;AACD,EAAAR,EAAG,iB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