@televet/kibble-ui 4.0.0-beta.41 → 4.0.0-beta.43

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 (132) hide show
  1. package/dist/chunks/button.component-BWlRjD5a.js.map +1 -1
  2. package/dist/chunks/button.component-ytAmAAJg.js.map +1 -1
  3. package/dist/chunks/{buttonGroup.component-DBpnBBOa.js → buttonGroup.component-BCCxeFx_.js} +2 -2
  4. package/dist/chunks/{buttonGroup.component-DBpnBBOa.js.map → buttonGroup.component-BCCxeFx_.js.map} +1 -1
  5. package/dist/chunks/{buttonGroup.component-Bw_Wcpsd.js → buttonGroup.component-Cpwnw5G3.js} +2 -2
  6. package/dist/chunks/{buttonGroup.component-Bw_Wcpsd.js.map → buttonGroup.component-Cpwnw5G3.js.map} +1 -1
  7. package/dist/chunks/{checkbox.component-BTG2oHN_.js → checkbox.component-C8IPf20R.js} +2 -2
  8. package/dist/chunks/{checkbox.component-BTG2oHN_.js.map → checkbox.component-C8IPf20R.js.map} +1 -1
  9. package/dist/chunks/{checkbox.component-WA8Y2Cfq.js → checkbox.component-CvuE1PVR.js} +2 -2
  10. package/dist/chunks/{checkbox.component-WA8Y2Cfq.js.map → checkbox.component-CvuE1PVR.js.map} +1 -1
  11. package/dist/chunks/{checkboxGroup.component-DMSg9Hzt.js → checkboxGroup.component-CQEwY2Fu.js} +2 -2
  12. package/dist/chunks/{checkboxGroup.component-DMSg9Hzt.js.map → checkboxGroup.component-CQEwY2Fu.js.map} +1 -1
  13. package/dist/chunks/{checkboxGroup.component-CoUMqdnh.js → checkboxGroup.component-CaHesQT7.js} +3 -3
  14. package/dist/chunks/{checkboxGroup.component-CoUMqdnh.js.map → checkboxGroup.component-CaHesQT7.js.map} +1 -1
  15. package/dist/chunks/{conversationCard.component-D2k7g7wc.js → conversationCard.component-C_gj2TZd.js} +2 -2
  16. package/dist/chunks/{conversationCard.component-D2k7g7wc.js.map → conversationCard.component-C_gj2TZd.js.map} +1 -1
  17. package/dist/chunks/{conversationCard.component-CMudlOxC.js → conversationCard.component-p1vrl1L3.js} +2 -2
  18. package/dist/chunks/{conversationCard.component-CMudlOxC.js.map → conversationCard.component-p1vrl1L3.js.map} +1 -1
  19. package/dist/chunks/{datePicker.component-CAd5ouvo.js → datePicker.component-CwQ7lbgj.js} +2 -2
  20. package/dist/chunks/{datePicker.component-CAd5ouvo.js.map → datePicker.component-CwQ7lbgj.js.map} +1 -1
  21. package/dist/chunks/{datePicker.component-Btc-TcGV.js → datePicker.component-DLbm9VYf.js} +3 -3
  22. package/dist/chunks/{datePicker.component-Btc-TcGV.js.map → datePicker.component-DLbm9VYf.js.map} +1 -1
  23. package/dist/chunks/icon.component-4aaCABoX.js.map +1 -1
  24. package/dist/chunks/icon.component-BmcWaysM.js.map +1 -1
  25. package/dist/chunks/menu.component-D_eoL8VD.js +2 -0
  26. package/dist/chunks/menu.component-D_eoL8VD.js.map +1 -0
  27. package/dist/chunks/{menu.component-B5OYYpa8.js → menu.component-toq-fDY8.js} +188 -180
  28. package/dist/chunks/menu.component-toq-fDY8.js.map +1 -0
  29. package/dist/chunks/{modal.types-0p23sZIR.js → modal.types-BhM9guMA.js} +2 -2
  30. package/dist/chunks/{modal.types-0p23sZIR.js.map → modal.types-BhM9guMA.js.map} +1 -1
  31. package/dist/chunks/{modal.types-BGqtuJeQ.js → modal.types-Dz2IFuc7.js} +2 -1
  32. package/dist/chunks/{modal.types-BGqtuJeQ.js.map → modal.types-Dz2IFuc7.js.map} +1 -1
  33. package/dist/chunks/{pinInput.types-PLeb9Wy4.js → pinInput.types-BPnWNbwp.js} +2 -2
  34. package/dist/chunks/{pinInput.types-PLeb9Wy4.js.map → pinInput.types-BPnWNbwp.js.map} +1 -1
  35. package/dist/chunks/{pinInput.types-DDODRsaX.js → pinInput.types-GAEfMLAv.js} +2 -2
  36. package/dist/chunks/{pinInput.types-DDODRsaX.js.map → pinInput.types-GAEfMLAv.js.map} +1 -1
  37. package/dist/chunks/{radioGroup.component-aQ5WaHHz.js → radioGroup.component-B3pl5h2h.js} +2 -2
  38. package/dist/chunks/{radioGroup.component-aQ5WaHHz.js.map → radioGroup.component-B3pl5h2h.js.map} +1 -1
  39. package/dist/chunks/{radioGroup.component-BqJ9MJq_.js → radioGroup.component-DyE_o-Fx.js} +3 -3
  40. package/dist/chunks/{radioGroup.component-BqJ9MJq_.js.map → radioGroup.component-DyE_o-Fx.js.map} +1 -1
  41. package/dist/chunks/{ratingDots.component-Bgh1iv_C.js → ratingDots.component-BesDpg8x.js} +2 -2
  42. package/dist/chunks/{ratingDots.component-Bgh1iv_C.js.map → ratingDots.component-BesDpg8x.js.map} +1 -1
  43. package/dist/chunks/{ratingDots.component-3aUZ-7-n.js → ratingDots.component-C8eBoN9v.js} +2 -2
  44. package/dist/chunks/{ratingDots.component-3aUZ-7-n.js.map → ratingDots.component-C8eBoN9v.js.map} +1 -1
  45. package/dist/chunks/{select.component-C-D415HK.js → select.component-BCFraNbc.js} +2 -2
  46. package/dist/chunks/{select.component-C-D415HK.js.map → select.component-BCFraNbc.js.map} +1 -1
  47. package/dist/chunks/{select.component-CceQLD7L.js → select.component-GTm2laeB.js} +2 -2
  48. package/dist/chunks/{select.component-CceQLD7L.js.map → select.component-GTm2laeB.js.map} +1 -1
  49. package/dist/chunks/{switch.component-8Ksb8br3.js → switch.component-CSGFEF3I.js} +2 -2
  50. package/dist/chunks/{switch.component-8Ksb8br3.js.map → switch.component-CSGFEF3I.js.map} +1 -1
  51. package/dist/chunks/{switch.component-BkifDkJ0.js → switch.component-DjHknb_4.js} +2 -2
  52. package/dist/chunks/{switch.component-BkifDkJ0.js.map → switch.component-DjHknb_4.js.map} +1 -1
  53. package/dist/chunks/{tagBlock.component-D_3b0Ebn.js → tagBlock.component-BWbEe9VL.js} +2 -2
  54. package/dist/chunks/{tagBlock.component-D_3b0Ebn.js.map → tagBlock.component-BWbEe9VL.js.map} +1 -1
  55. package/dist/chunks/{tagBlock.component-DjIgrPCX.js → tagBlock.component-DGGkSE8s.js} +2 -2
  56. package/dist/chunks/{tagBlock.component-DjIgrPCX.js.map → tagBlock.component-DGGkSE8s.js.map} +1 -1
  57. package/dist/chunks/{textInput.component-c9ySCd-c.js → textInput.component-D2StzwsH.js} +2 -2
  58. package/dist/chunks/{textInput.component-c9ySCd-c.js.map → textInput.component-D2StzwsH.js.map} +1 -1
  59. package/dist/chunks/{textInput.component-7QTnQmYu.js → textInput.component-db5JWDOn.js} +2 -2
  60. package/dist/chunks/{textInput.component-7QTnQmYu.js.map → textInput.component-db5JWDOn.js.map} +1 -1
  61. package/dist/chunks/{textarea.component-7yXlR6OD.js → textarea.component-DvA5vzjS.js} +2 -2
  62. package/dist/chunks/{textarea.component-7yXlR6OD.js.map → textarea.component-DvA5vzjS.js.map} +1 -1
  63. package/dist/chunks/{textarea.component-Bbf7OmgY.js → textarea.component-VN5A4zVD.js} +2 -2
  64. package/dist/chunks/{textarea.component-Bbf7OmgY.js.map → textarea.component-VN5A4zVD.js.map} +1 -1
  65. package/dist/chunks/{theme.provider-DHyAAmb8.js → theme.provider-C1ydkJtd.js} +143 -146
  66. package/dist/chunks/{theme.provider-DHyAAmb8.js.map → theme.provider-C1ydkJtd.js.map} +1 -1
  67. package/dist/chunks/{theme.provider-CGOc_ofu.js → theme.provider-CUQEVC68.js} +2 -2
  68. package/dist/chunks/{theme.provider-CGOc_ofu.js.map → theme.provider-CUQEVC68.js.map} +1 -1
  69. package/dist/chunks/{timePicker.component-CWQsy1FJ.js → timePicker.component-Cm2roPxJ.js} +2 -2
  70. package/dist/chunks/{timePicker.component-CWQsy1FJ.js.map → timePicker.component-Cm2roPxJ.js.map} +1 -1
  71. package/dist/chunks/{timePicker.component-DayAeaAE.js → timePicker.component-sttSyiVV.js} +2 -2
  72. package/dist/chunks/{timePicker.component-DayAeaAE.js.map → timePicker.component-sttSyiVV.js.map} +1 -1
  73. package/dist/chunks/{timeRange.component-kKGWfXnG.js → timeRange.component-BuLsK6ed.js} +2 -2
  74. package/dist/chunks/{timeRange.component-kKGWfXnG.js.map → timeRange.component-BuLsK6ed.js.map} +1 -1
  75. package/dist/chunks/{timeRange.component-BMIZhDDZ.js → timeRange.component-OH7hVSwj.js} +2 -2
  76. package/dist/chunks/{timeRange.component-BMIZhDDZ.js.map → timeRange.component-OH7hVSwj.js.map} +1 -1
  77. package/dist/chunks/{withFormControl-BldbKXiV.js → withFormControl-Chelruxy.js} +55 -55
  78. package/dist/chunks/{withFormControl-BldbKXiV.js.map → withFormControl-Chelruxy.js.map} +1 -1
  79. package/dist/chunks/{withFormControl-C35JkDEH.js → withFormControl-CvsBPk94.js} +2 -2
  80. package/dist/chunks/{withFormControl-C35JkDEH.js.map → withFormControl-CvsBPk94.js.map} +1 -1
  81. package/dist/cjs/chakra/index.cjs +1 -1
  82. package/dist/cjs/chakra/index.cjs.map +1 -1
  83. package/dist/cjs/components/ButtonGroup/index.cjs +1 -1
  84. package/dist/cjs/components/Checkbox/index.cjs +1 -1
  85. package/dist/cjs/components/CheckboxGroup/index.cjs +1 -1
  86. package/dist/cjs/components/ConversationCard/index.cjs +1 -1
  87. package/dist/cjs/components/DatePicker/index.cjs +1 -1
  88. package/dist/cjs/components/Menu/index.cjs +1 -1
  89. package/dist/cjs/components/Modal/index.cjs +1 -1
  90. package/dist/cjs/components/PinInput/index.cjs +1 -1
  91. package/dist/cjs/components/RadioGroup/index.cjs +1 -1
  92. package/dist/cjs/components/RatingDots/index.cjs +1 -1
  93. package/dist/cjs/components/Select/index.cjs +1 -1
  94. package/dist/cjs/components/Switch/index.cjs +1 -1
  95. package/dist/cjs/components/TagBlock/index.cjs +1 -1
  96. package/dist/cjs/components/TextInput/index.cjs +1 -1
  97. package/dist/cjs/components/Textarea/index.cjs +1 -1
  98. package/dist/cjs/components/TimePicker/index.cjs +1 -1
  99. package/dist/cjs/components/TimeRange/index.cjs +1 -1
  100. package/dist/cjs/components/index.cjs +1 -1
  101. package/dist/cjs/index.cjs +1 -1
  102. package/dist/cjs/theme/index.cjs +1 -1
  103. package/dist/esm/chakra/index.js +101 -95
  104. package/dist/esm/chakra/index.js.map +1 -1
  105. package/dist/esm/components/ButtonGroup/index.js +1 -1
  106. package/dist/esm/components/Checkbox/index.js +1 -1
  107. package/dist/esm/components/CheckboxGroup/index.js +1 -1
  108. package/dist/esm/components/ConversationCard/index.js +1 -1
  109. package/dist/esm/components/DatePicker/index.js +1 -1
  110. package/dist/esm/components/Menu/index.js +1 -1
  111. package/dist/esm/components/Modal/index.js +1 -1
  112. package/dist/esm/components/PinInput/index.js +1 -1
  113. package/dist/esm/components/RadioGroup/index.js +1 -1
  114. package/dist/esm/components/RatingDots/index.js +1 -1
  115. package/dist/esm/components/Select/index.js +1 -1
  116. package/dist/esm/components/Switch/index.js +1 -1
  117. package/dist/esm/components/TagBlock/index.js +1 -1
  118. package/dist/esm/components/TextInput/index.js +1 -1
  119. package/dist/esm/components/Textarea/index.js +1 -1
  120. package/dist/esm/components/TimePicker/index.js +1 -1
  121. package/dist/esm/components/TimeRange/index.js +1 -1
  122. package/dist/esm/components/index.js +17 -17
  123. package/dist/esm/index.js +18 -18
  124. package/dist/esm/theme/index.js +1 -1
  125. package/dist/types/chakra/index.d.ts +1 -1
  126. package/dist/types/components/Menu/components/MenuItem/menuItem.component.d.ts +3 -2
  127. package/dist/types/components/Menu/menu.component.d.ts +1 -1
  128. package/dist/types/hocs/withFormControl/withFormControl.d.ts +1 -1
  129. package/package.json +1 -1
  130. package/dist/chunks/menu.component-B5OYYpa8.js.map +0 -1
  131. package/dist/chunks/menu.component-BsPmuH77.js +0 -2
  132. package/dist/chunks/menu.component-BsPmuH77.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"textarea.component-Bbf7OmgY.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, { ForwardedRef, useMemo } from \"react\";\nimport {\n Textarea as CTextarea,\n TextareaProps as CTextareaProps,\n} from \"@chakra-ui/react/textarea\";\nimport { FormControlSize } from \"hocs/withFormControl/withFormControl.types\";\nimport {\n withFormControl,\n WithFormControlProps,\n} 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 charLimit?: number;\n textareaRef?: ForwardedRef<HTMLTextAreaElement>;\n size?: FormControlSize;\n}\n\nconst Textarea = withFormControl(\n ({\n charLimit = undefined,\n invalid,\n onContrast,\n resize = \"none\",\n textareaRef,\n value,\n ...rest\n }: TextareaProps): React.JSX.Element => {\n const _computedVariant = onContrast ? \"onContrast\" : \"default\";\n\n const currentCharCount = useMemo(\n () => value?.toString()?.length || 0,\n [value],\n );\n\n return (\n <Flex className=\"Textarea__Wrapper\" position=\"relative\" w=\"100%\">\n <CTextarea\n className=\"Textarea\"\n data-testid=\"kibble-textarea\"\n resize={resize}\n variant={_computedVariant}\n value={value}\n {...(invalid && { \"aria-invalid\": true })}\n {...rest}\n ref={textareaRef}\n />\n {!!charLimit && (\n <CharacterCounter\n withLimit={true}\n limit={charLimit}\n currentCount={currentCharCount}\n />\n )}\n </Flex>\n );\n },\n);\n\nconst WrappedTextArea = React.forwardRef(\n (props: TextareaProps, ref: ForwardedRef<HTMLTextAreaElement>) => (\n <Textarea textareaRef={ref} {...props} />\n ),\n);\n\nWrappedTextArea.displayName = \"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","withFormControl","charLimit","invalid","onContrast","value","rest","_computedVariant","currentCharCount","useMemo","Flex","CTextarea","CharacterCounter","WrappedTextArea","React"],"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,YAAc,WAC7BD,EAAG,MAAM,UAAY,UAEvBA,EAAG,MAAM,OAAS,GAAGQ,CAAS,IACpC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KG,CAAW,EAAG,CACjG,CAAC,EACDN,EAAc,YAAc,gBCnB5B,KAAM,CAAE,YAAAgB,CAA2B,EAAIC,sBAAoB,CACzD,IAAK,UACP,CAAC,EACKC,EAAWF,EACfG,CACF,ECSMD,EAAWE,EAAA,gBACf,CAAC,CACC,UAAAC,EAAY,OACZ,QAAAC,EACA,WAAAC,EACA,OAAA7B,EAAS,OACT,YAAAY,EACA,MAAAkB,EACA,GAAGC,CAAA,IACmC,CAChC,MAAAC,EAAmBH,EAAa,aAAe,UAE/CI,EAAmBC,EAAA,QACvB,IAAMJ,GAAO,YAAY,QAAU,EACnC,CAACA,CAAK,CACR,EAEA,gCACGK,OAAK,CAAA,UAAU,oBAAoB,SAAS,WAAW,EAAE,OACxD,SAAA,CAAAhB,EAAA,kBAAA,IAACiB,EAAA,CACC,UAAU,WACV,cAAY,kBACZ,OAAApC,EACA,QAASgC,EACT,MAAAF,EACC,GAAIF,GAAW,CAAE,eAAgB,EAAK,EACtC,GAAGG,EACJ,IAAKnB,CAAA,CACP,EACC,CAAC,CAACe,GACDR,EAAA,kBAAA,IAACkB,EAAA,iBAAA,CACC,UAAW,GACX,MAAOV,EACP,aAAcM,CAAA,CAAA,CAChB,EAEJ,CAAA,CAGN,EAEMK,EAAkBC,EAAM,QAAA,WAC5B,CAAC/B,EAAsBC,IACrBU,wBAACK,GAAS,YAAaf,EAAM,GAAGD,CAAO,CAAA,CAE3C,EAEA8B,EAAgB,YAAc","x_google_ignoreList":[0,1,2]}
1
+ {"version":3,"file":"textarea.component-VN5A4zVD.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, { ForwardedRef, useMemo } from \"react\";\nimport {\n Textarea as CTextarea,\n TextareaProps as CTextareaProps,\n} from \"@chakra-ui/react/textarea\";\nimport { FormControlSize } from \"hocs/withFormControl/withFormControl.types\";\nimport {\n withFormControl,\n WithFormControlProps,\n} 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 charLimit?: number;\n textareaRef?: ForwardedRef<HTMLTextAreaElement>;\n size?: FormControlSize;\n}\n\nconst Textarea = withFormControl(\n ({\n charLimit = undefined,\n invalid,\n onContrast,\n resize = \"none\",\n textareaRef,\n value,\n ...rest\n }: TextareaProps): React.JSX.Element => {\n const _computedVariant = onContrast ? \"onContrast\" : \"default\";\n\n const currentCharCount = useMemo(\n () => value?.toString()?.length || 0,\n [value],\n );\n\n return (\n <Flex className=\"Textarea__Wrapper\" position=\"relative\" w=\"100%\">\n <CTextarea\n className=\"Textarea\"\n data-testid=\"kibble-textarea\"\n resize={resize}\n variant={_computedVariant}\n value={value}\n {...(invalid && { \"aria-invalid\": true })}\n {...rest}\n ref={textareaRef}\n />\n {!!charLimit && (\n <CharacterCounter\n withLimit={true}\n limit={charLimit}\n currentCount={currentCharCount}\n />\n )}\n </Flex>\n );\n },\n);\n\nconst WrappedTextArea = React.forwardRef(\n (props: TextareaProps, ref: ForwardedRef<HTMLTextAreaElement>) => (\n <Textarea textareaRef={ref} {...props} />\n ),\n);\n\nWrappedTextArea.displayName = \"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","withFormControl","charLimit","invalid","onContrast","value","rest","_computedVariant","currentCharCount","useMemo","Flex","CTextarea","CharacterCounter","WrappedTextArea","React"],"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,YAAc,WAC7BD,EAAG,MAAM,UAAY,UAEvBA,EAAG,MAAM,OAAS,GAAGQ,CAAS,IACpC,CAAK,CACF,EACDR,EAAG,iBAAiB,QAASO,CAAM,EACnCP,EAAG,MAAM,iBAAiB,QAASO,CAAM,EACzC,MAAME,EAAmB,OAAO,eAAe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