@intlayer/design-system 8.9.7 → 8.10.0-canary.0

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 (756) hide show
  1. package/dist/esm/components/Accordion/Accordion.mjs.map +1 -1
  2. package/dist/esm/components/Avatar/image.mjs.map +1 -1
  3. package/dist/esm/components/Avatar/index.mjs +5 -5
  4. package/dist/esm/components/Avatar/index.mjs.map +1 -1
  5. package/dist/esm/components/Badge/index.mjs.map +1 -1
  6. package/dist/esm/components/Breadcrumb/breadcrumb.content.mjs.map +1 -1
  7. package/dist/esm/components/Breadcrumb/index.mjs.map +1 -1
  8. package/dist/esm/components/Browser/Browser.content.mjs +120 -0
  9. package/dist/esm/components/Browser/Browser.content.mjs.map +1 -1
  10. package/dist/esm/components/Browser/Browser.mjs +131 -9
  11. package/dist/esm/components/Browser/Browser.mjs.map +1 -1
  12. package/dist/esm/components/Browser/extractUrlFromSitemap.mjs +44 -0
  13. package/dist/esm/components/Browser/extractUrlFromSitemap.mjs.map +1 -0
  14. package/dist/esm/components/Button/Button.mjs +7 -4
  15. package/dist/esm/components/Button/Button.mjs.map +1 -1
  16. package/dist/esm/components/Carousel/index.content.mjs.map +1 -1
  17. package/dist/esm/components/Carousel/index.mjs.map +1 -1
  18. package/dist/esm/components/ClickOutsideDiv/index.mjs.map +1 -1
  19. package/dist/esm/components/CollapsibleTable/CollapsibleTable.mjs +1 -1
  20. package/dist/esm/components/CollapsibleTable/CollapsibleTable.mjs.map +1 -1
  21. package/dist/esm/components/Command/index.mjs.map +1 -1
  22. package/dist/esm/components/Container/index.mjs +1 -1
  23. package/dist/esm/components/Container/index.mjs.map +1 -1
  24. package/dist/esm/components/ContentEditor/ContentEditor.mjs.map +1 -1
  25. package/dist/esm/components/ContentEditor/ContentEditorInput.mjs.map +1 -1
  26. package/dist/esm/components/ContentEditor/ContentEditorTextArea.mjs +1 -1
  27. package/dist/esm/components/ContentEditor/ContentEditorTextArea.mjs.map +1 -1
  28. package/dist/esm/components/ContentSelector/ContentSelector.mjs.map +1 -1
  29. package/dist/esm/components/CopyButton/CopyButton.content.mjs.map +1 -1
  30. package/dist/esm/components/CopyButton/index.mjs.map +1 -1
  31. package/dist/esm/components/CopyToClipboard/index.mjs.map +1 -1
  32. package/dist/esm/components/DictionaryEditor/DictionaryEditor.mjs.map +1 -1
  33. package/dist/esm/components/DictionaryEditor/ItemLayout.mjs.map +1 -1
  34. package/dist/esm/components/DictionaryEditor/NodeWrapper/ArrayWrapper.mjs.map +1 -1
  35. package/dist/esm/components/DictionaryEditor/NodeWrapper/BooleanWrapper.mjs.map +1 -1
  36. package/dist/esm/components/DictionaryEditor/NodeWrapper/ConditionWrapper.mjs.map +1 -1
  37. package/dist/esm/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.mjs.map +1 -1
  38. package/dist/esm/components/DictionaryEditor/NodeWrapper/FileWrapper.mjs.map +1 -1
  39. package/dist/esm/components/DictionaryEditor/NodeWrapper/HtmlWrapper.mjs.map +1 -1
  40. package/dist/esm/components/DictionaryEditor/NodeWrapper/InsertionWrapper.mjs.map +1 -1
  41. package/dist/esm/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.mjs.map +1 -1
  42. package/dist/esm/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.mjs.map +1 -1
  43. package/dist/esm/components/DictionaryEditor/NodeWrapper/NumberWrapper.mjs.map +1 -1
  44. package/dist/esm/components/DictionaryEditor/NodeWrapper/PluralWrapper.mjs.map +1 -1
  45. package/dist/esm/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs.map +1 -1
  46. package/dist/esm/components/DictionaryEditor/NodeWrapper/TranslationWrapper.mjs.map +1 -1
  47. package/dist/esm/components/DictionaryEditor/NodeWrapper/index.mjs.map +1 -1
  48. package/dist/esm/components/DictionaryFieldEditor/ContentEditor.mjs.map +1 -1
  49. package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/SafeHtmlRenderer.mjs.map +1 -1
  50. package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +51 -3
  51. package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs.map +1 -1
  52. package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/object.mjs.map +1 -1
  53. package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +1 -1
  54. package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
  55. package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.mjs.map +1 -1
  56. package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.mjs.map +1 -1
  57. package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.mjs.map +1 -1
  58. package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +3 -3
  59. package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
  60. package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs.map +1 -1
  61. package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.mjs.map +1 -1
  62. package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.mjs.map +1 -1
  63. package/dist/esm/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +1 -1
  64. package/dist/esm/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
  65. package/dist/esm/components/DictionaryFieldEditor/EnumKeyInput.mjs.map +1 -1
  66. package/dist/esm/components/DictionaryFieldEditor/JSONEditor.mjs.map +1 -1
  67. package/dist/esm/components/DictionaryFieldEditor/KeyPathBreadcrumb.mjs +1 -1
  68. package/dist/esm/components/DictionaryFieldEditor/KeyPathBreadcrumb.mjs.map +1 -1
  69. package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +4 -4
  70. package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
  71. package/dist/esm/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.mjs.map +1 -1
  72. package/dist/esm/components/DictionaryFieldEditor/NodeTypeSelector.mjs.map +1 -1
  73. package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +2 -2
  74. package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
  75. package/dist/esm/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs.map +1 -1
  76. package/dist/esm/components/DictionaryFieldEditor/StructureEditor.mjs.map +1 -1
  77. package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs +1 -1
  78. package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs.map +1 -1
  79. package/dist/esm/components/DictionaryFieldEditor/StructureView/structureView.content.mjs.map +1 -1
  80. package/dist/esm/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs.map +1 -1
  81. package/dist/esm/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs.map +1 -1
  82. package/dist/esm/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.mjs.map +1 -1
  83. package/dist/esm/components/DictionaryFieldEditor/dictionaryFieldEditor.content.mjs.map +1 -1
  84. package/dist/esm/components/DictionaryFieldEditor/getIsEditableSection.mjs.map +1 -1
  85. package/dist/esm/components/DictionaryFieldEditor/nodeTypeSelector.content.mjs.map +1 -1
  86. package/dist/esm/components/DropDown/index.mjs.map +1 -1
  87. package/dist/esm/components/EditableField/EditableFieldInput.mjs.map +1 -1
  88. package/dist/esm/components/EditableField/EditableFieldLayout.mjs.map +1 -1
  89. package/dist/esm/components/EditableField/EditableFieldTextArea.mjs.map +1 -1
  90. package/dist/esm/components/ExpandCollapse/ExpandCollapse.mjs.map +1 -1
  91. package/dist/esm/components/ExpandCollapse/expandCollapse.content.mjs.map +1 -1
  92. package/dist/esm/components/Flags/Flag.mjs.map +1 -1
  93. package/dist/esm/components/Flags/ae.mjs.map +1 -1
  94. package/dist/esm/components/Flags/af.mjs.map +1 -1
  95. package/dist/esm/components/Flags/al.mjs.map +1 -1
  96. package/dist/esm/components/Flags/am.mjs.map +1 -1
  97. package/dist/esm/components/Flags/ar.mjs.map +1 -1
  98. package/dist/esm/components/Flags/at.mjs.map +1 -1
  99. package/dist/esm/components/Flags/au.mjs.map +1 -1
  100. package/dist/esm/components/Flags/az.mjs.map +1 -1
  101. package/dist/esm/components/Flags/ba.mjs.map +1 -1
  102. package/dist/esm/components/Flags/bd.mjs.map +1 -1
  103. package/dist/esm/components/Flags/be.mjs.map +1 -1
  104. package/dist/esm/components/Flags/bg.mjs.map +1 -1
  105. package/dist/esm/components/Flags/bh.mjs.map +1 -1
  106. package/dist/esm/components/Flags/bn.mjs.map +1 -1
  107. package/dist/esm/components/Flags/bo.mjs.map +1 -1
  108. package/dist/esm/components/Flags/br.mjs.map +1 -1
  109. package/dist/esm/components/Flags/bw.mjs.map +1 -1
  110. package/dist/esm/components/Flags/by.mjs.map +1 -1
  111. package/dist/esm/components/Flags/bz.mjs.map +1 -1
  112. package/dist/esm/components/Flags/ca.mjs.map +1 -1
  113. package/dist/esm/components/Flags/ch.mjs.map +1 -1
  114. package/dist/esm/components/Flags/cl.mjs.map +1 -1
  115. package/dist/esm/components/Flags/cn.mjs.map +1 -1
  116. package/dist/esm/components/Flags/co.mjs.map +1 -1
  117. package/dist/esm/components/Flags/cr.mjs.map +1 -1
  118. package/dist/esm/components/Flags/cu.mjs.map +1 -1
  119. package/dist/esm/components/Flags/cv.mjs.map +1 -1
  120. package/dist/esm/components/Flags/cz.mjs.map +1 -1
  121. package/dist/esm/components/Flags/de.mjs.map +1 -1
  122. package/dist/esm/components/Flags/dj.mjs.map +1 -1
  123. package/dist/esm/components/Flags/dk.mjs.map +1 -1
  124. package/dist/esm/components/Flags/do.mjs.map +1 -1
  125. package/dist/esm/components/Flags/dz.mjs.map +1 -1
  126. package/dist/esm/components/Flags/ec.mjs.map +1 -1
  127. package/dist/esm/components/Flags/ee.mjs.map +1 -1
  128. package/dist/esm/components/Flags/eg.mjs.map +1 -1
  129. package/dist/esm/components/Flags/es-ct.mjs.map +1 -1
  130. package/dist/esm/components/Flags/es-ga.mjs.map +1 -1
  131. package/dist/esm/components/Flags/es-pv.mjs.map +1 -1
  132. package/dist/esm/components/Flags/es.mjs.map +1 -1
  133. package/dist/esm/components/Flags/et.mjs.map +1 -1
  134. package/dist/esm/components/Flags/fi.mjs.map +1 -1
  135. package/dist/esm/components/Flags/flags.mjs.map +1 -1
  136. package/dist/esm/components/Flags/fo.mjs.map +1 -1
  137. package/dist/esm/components/Flags/fr.mjs.map +1 -1
  138. package/dist/esm/components/Flags/gb-wls.mjs.map +1 -1
  139. package/dist/esm/components/Flags/gb.mjs.map +1 -1
  140. package/dist/esm/components/Flags/ge.mjs.map +1 -1
  141. package/dist/esm/components/Flags/gh.mjs.map +1 -1
  142. package/dist/esm/components/Flags/gr.mjs.map +1 -1
  143. package/dist/esm/components/Flags/gt.mjs.map +1 -1
  144. package/dist/esm/components/Flags/gw.mjs.map +1 -1
  145. package/dist/esm/components/Flags/hk.mjs.map +1 -1
  146. package/dist/esm/components/Flags/hn.mjs.map +1 -1
  147. package/dist/esm/components/Flags/hr.mjs.map +1 -1
  148. package/dist/esm/components/Flags/hu.mjs.map +1 -1
  149. package/dist/esm/components/Flags/id.mjs.map +1 -1
  150. package/dist/esm/components/Flags/ie.mjs.map +1 -1
  151. package/dist/esm/components/Flags/il.mjs.map +1 -1
  152. package/dist/esm/components/Flags/in.mjs.map +1 -1
  153. package/dist/esm/components/Flags/iq.mjs.map +1 -1
  154. package/dist/esm/components/Flags/ir.mjs.map +1 -1
  155. package/dist/esm/components/Flags/is.mjs.map +1 -1
  156. package/dist/esm/components/Flags/it.mjs.map +1 -1
  157. package/dist/esm/components/Flags/jm.mjs.map +1 -1
  158. package/dist/esm/components/Flags/jo.mjs.map +1 -1
  159. package/dist/esm/components/Flags/jp.mjs.map +1 -1
  160. package/dist/esm/components/Flags/ke.mjs.map +1 -1
  161. package/dist/esm/components/Flags/kg.mjs.map +1 -1
  162. package/dist/esm/components/Flags/kh.mjs.map +1 -1
  163. package/dist/esm/components/Flags/km.mjs.map +1 -1
  164. package/dist/esm/components/Flags/kr.mjs.map +1 -1
  165. package/dist/esm/components/Flags/kw.mjs.map +1 -1
  166. package/dist/esm/components/Flags/kz.mjs.map +1 -1
  167. package/dist/esm/components/Flags/la.mjs.map +1 -1
  168. package/dist/esm/components/Flags/lb.mjs.map +1 -1
  169. package/dist/esm/components/Flags/li.mjs.map +1 -1
  170. package/dist/esm/components/Flags/lk.mjs.map +1 -1
  171. package/dist/esm/components/Flags/lt.mjs.map +1 -1
  172. package/dist/esm/components/Flags/lu.mjs.map +1 -1
  173. package/dist/esm/components/Flags/lv.mjs.map +1 -1
  174. package/dist/esm/components/Flags/ly.mjs.map +1 -1
  175. package/dist/esm/components/Flags/ma.mjs.map +1 -1
  176. package/dist/esm/components/Flags/mc.mjs.map +1 -1
  177. package/dist/esm/components/Flags/md.mjs.map +1 -1
  178. package/dist/esm/components/Flags/mk.mjs.map +1 -1
  179. package/dist/esm/components/Flags/mm.mjs.map +1 -1
  180. package/dist/esm/components/Flags/mn.mjs.map +1 -1
  181. package/dist/esm/components/Flags/mo.mjs.map +1 -1
  182. package/dist/esm/components/Flags/mr.mjs.map +1 -1
  183. package/dist/esm/components/Flags/mt.mjs.map +1 -1
  184. package/dist/esm/components/Flags/mv.mjs.map +1 -1
  185. package/dist/esm/components/Flags/mx.mjs.map +1 -1
  186. package/dist/esm/components/Flags/my.mjs.map +1 -1
  187. package/dist/esm/components/Flags/mz.mjs.map +1 -1
  188. package/dist/esm/components/Flags/ng.mjs.map +1 -1
  189. package/dist/esm/components/Flags/ni.mjs.map +1 -1
  190. package/dist/esm/components/Flags/nl.mjs.map +1 -1
  191. package/dist/esm/components/Flags/no.mjs.map +1 -1
  192. package/dist/esm/components/Flags/np.mjs.map +1 -1
  193. package/dist/esm/components/Flags/nz.mjs.map +1 -1
  194. package/dist/esm/components/Flags/om.mjs.map +1 -1
  195. package/dist/esm/components/Flags/pa.mjs.map +1 -1
  196. package/dist/esm/components/Flags/pe.mjs.map +1 -1
  197. package/dist/esm/components/Flags/ph.mjs.map +1 -1
  198. package/dist/esm/components/Flags/pk.mjs.map +1 -1
  199. package/dist/esm/components/Flags/pl.mjs.map +1 -1
  200. package/dist/esm/components/Flags/pr.mjs.map +1 -1
  201. package/dist/esm/components/Flags/ps.mjs.map +1 -1
  202. package/dist/esm/components/Flags/pt.mjs.map +1 -1
  203. package/dist/esm/components/Flags/py.mjs.map +1 -1
  204. package/dist/esm/components/Flags/qa.mjs.map +1 -1
  205. package/dist/esm/components/Flags/ro.mjs.map +1 -1
  206. package/dist/esm/components/Flags/rs.mjs.map +1 -1
  207. package/dist/esm/components/Flags/ru.mjs.map +1 -1
  208. package/dist/esm/components/Flags/sa.mjs.map +1 -1
  209. package/dist/esm/components/Flags/sd.mjs.map +1 -1
  210. package/dist/esm/components/Flags/se.mjs.map +1 -1
  211. package/dist/esm/components/Flags/sg.mjs.map +1 -1
  212. package/dist/esm/components/Flags/si.mjs.map +1 -1
  213. package/dist/esm/components/Flags/sk.mjs.map +1 -1
  214. package/dist/esm/components/Flags/so.mjs.map +1 -1
  215. package/dist/esm/components/Flags/st.mjs.map +1 -1
  216. package/dist/esm/components/Flags/sv.mjs.map +1 -1
  217. package/dist/esm/components/Flags/sy.mjs.map +1 -1
  218. package/dist/esm/components/Flags/td.mjs.map +1 -1
  219. package/dist/esm/components/Flags/th.mjs.map +1 -1
  220. package/dist/esm/components/Flags/tl.mjs.map +1 -1
  221. package/dist/esm/components/Flags/tn.mjs.map +1 -1
  222. package/dist/esm/components/Flags/tr.mjs.map +1 -1
  223. package/dist/esm/components/Flags/tt.mjs.map +1 -1
  224. package/dist/esm/components/Flags/tw.mjs.map +1 -1
  225. package/dist/esm/components/Flags/tz.mjs.map +1 -1
  226. package/dist/esm/components/Flags/ua.mjs.map +1 -1
  227. package/dist/esm/components/Flags/ug.mjs.map +1 -1
  228. package/dist/esm/components/Flags/us.mjs.map +1 -1
  229. package/dist/esm/components/Flags/uy.mjs.map +1 -1
  230. package/dist/esm/components/Flags/uz.mjs.map +1 -1
  231. package/dist/esm/components/Flags/ve.mjs.map +1 -1
  232. package/dist/esm/components/Flags/vn.mjs.map +1 -1
  233. package/dist/esm/components/Flags/xx.mjs.map +1 -1
  234. package/dist/esm/components/Flags/ye.mjs.map +1 -1
  235. package/dist/esm/components/Flags/za.mjs.map +1 -1
  236. package/dist/esm/components/Flags/zw.mjs.map +1 -1
  237. package/dist/esm/components/Footer/index.mjs.map +1 -1
  238. package/dist/esm/components/Form/FormBase.mjs.map +1 -1
  239. package/dist/esm/components/Form/FormControl.mjs.map +1 -1
  240. package/dist/esm/components/Form/FormDescription.mjs.map +1 -1
  241. package/dist/esm/components/Form/FormField.mjs.map +1 -1
  242. package/dist/esm/components/Form/FormItem.mjs.map +1 -1
  243. package/dist/esm/components/Form/FormLabel.mjs.map +1 -1
  244. package/dist/esm/components/Form/FormMessage.mjs.map +1 -1
  245. package/dist/esm/components/Form/elements/AutoSizeTextAreaElement.mjs.map +1 -1
  246. package/dist/esm/components/Form/elements/CheckboxElement.mjs.map +1 -1
  247. package/dist/esm/components/Form/elements/EditableFieldInputElement.mjs.map +1 -1
  248. package/dist/esm/components/Form/elements/EditableFieldTextAreaElement.mjs.map +1 -1
  249. package/dist/esm/components/Form/elements/FormElement.mjs.map +1 -1
  250. package/dist/esm/components/Form/elements/FormElementWrapper.mjs.map +1 -1
  251. package/dist/esm/components/Form/elements/InputElement.mjs.map +1 -1
  252. package/dist/esm/components/Form/elements/InputPasswordElement.mjs.map +1 -1
  253. package/dist/esm/components/Form/elements/MultiselectElement.mjs.map +1 -1
  254. package/dist/esm/components/Form/elements/OTPElement.mjs +1 -1
  255. package/dist/esm/components/Form/elements/OTPElement.mjs.map +1 -1
  256. package/dist/esm/components/Form/elements/SearchInputElement.mjs.map +1 -1
  257. package/dist/esm/components/Form/elements/SelectElement.mjs.map +1 -1
  258. package/dist/esm/components/Form/elements/SwitchSelectorElement.mjs.map +1 -1
  259. package/dist/esm/components/Form/elements/TextAreaElement.mjs.map +1 -1
  260. package/dist/esm/components/Form/layout/FormItemLayout.mjs.map +1 -1
  261. package/dist/esm/components/Form/layout/FormLabelLayout.mjs.map +1 -1
  262. package/dist/esm/components/Form/layout/RequiredStar.mjs.map +1 -1
  263. package/dist/esm/components/HTMLRender/HTMLRender.mjs.map +1 -1
  264. package/dist/esm/components/Headers/index.mjs.map +1 -1
  265. package/dist/esm/components/HeightResizer/index.mjs.map +1 -1
  266. package/dist/esm/components/HideShow/index.mjs.map +1 -1
  267. package/dist/esm/components/IDE/Code.mjs.map +1 -1
  268. package/dist/esm/components/IDE/CodeBlockClient.mjs.map +1 -1
  269. package/dist/esm/components/IDE/CodeBlockHighlight.mjs.map +1 -1
  270. package/dist/esm/components/IDE/CodeBlockServer.mjs.map +1 -1
  271. package/dist/esm/components/IDE/CodeBlockShiki.mjs.map +1 -1
  272. package/dist/esm/components/IDE/CodeConditionalRenderer.mjs.map +1 -1
  273. package/dist/esm/components/IDE/CodeContext.mjs.map +1 -1
  274. package/dist/esm/components/IDE/CodeFormatSelector.mjs.map +1 -1
  275. package/dist/esm/components/IDE/ContentDeclarationFormatSelector.mjs.map +1 -1
  276. package/dist/esm/components/IDE/CopyCode.mjs.map +1 -1
  277. package/dist/esm/components/IDE/FileList.mjs.map +1 -1
  278. package/dist/esm/components/IDE/FileTree.mjs.map +1 -1
  279. package/dist/esm/components/IDE/IDE.mjs.map +1 -1
  280. package/dist/esm/components/IDE/MarkDownRender.mjs.map +1 -1
  281. package/dist/esm/components/IDE/MonacoCode.mjs.map +1 -1
  282. package/dist/esm/components/IDE/PackageManagerSelector.mjs.map +1 -1
  283. package/dist/esm/components/IDE/code.content.mjs.map +1 -1
  284. package/dist/esm/components/IDE/codeTransformer.mjs.map +1 -1
  285. package/dist/esm/components/IDE/copyCode.content.mjs.map +1 -1
  286. package/dist/esm/components/IDE/createFileTree.mjs.map +1 -1
  287. package/dist/esm/components/IDE/selectors.content.mjs.map +1 -1
  288. package/dist/esm/components/InformationTag/index.mjs.map +1 -1
  289. package/dist/esm/components/Input/Checkbox.mjs.map +1 -1
  290. package/dist/esm/components/Input/Input.mjs.map +1 -1
  291. package/dist/esm/components/Input/InputPassword.mjs.map +1 -1
  292. package/dist/esm/components/Input/OTPInput.mjs.map +1 -1
  293. package/dist/esm/components/Input/SearchInput.mjs.map +1 -1
  294. package/dist/esm/components/KeyboardScreenAdapter/index.mjs.map +1 -1
  295. package/dist/esm/components/KeyboardShortcut/KeyboardShortcut.mjs.map +1 -1
  296. package/dist/esm/components/Label/index.mjs.map +1 -1
  297. package/dist/esm/components/LanguageBackground/index.mjs.map +1 -1
  298. package/dist/esm/components/Link/Link.mjs +3 -2
  299. package/dist/esm/components/Link/Link.mjs.map +1 -1
  300. package/dist/esm/components/Loader/index.content.mjs.map +1 -1
  301. package/dist/esm/components/Loader/index.mjs.map +1 -1
  302. package/dist/esm/components/Loader/spinner.mjs.map +1 -1
  303. package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +2 -2
  304. package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -1
  305. package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs +8 -1
  306. package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs.map +1 -1
  307. package/dist/esm/components/LocaleSwitcherContentDropDown/localeSwitcher.content.mjs.map +1 -1
  308. package/dist/esm/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs +1 -1
  309. package/dist/esm/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs.map +1 -1
  310. package/dist/esm/components/LocaleSwitcherDropDown/localeSwitcher.content.mjs.map +1 -1
  311. package/dist/esm/components/Logo/Logo.mjs.map +1 -1
  312. package/dist/esm/components/Logo/LogoTextOnly.mjs.map +1 -1
  313. package/dist/esm/components/Logo/LogoWithText.mjs.map +1 -1
  314. package/dist/esm/components/Logo/LogoWithTextBelow.mjs.map +1 -1
  315. package/dist/esm/components/MarkDownRender/MarkDownIframe.mjs.map +1 -1
  316. package/dist/esm/components/MarkDownRender/MarkDownRender.mjs.map +1 -1
  317. package/dist/esm/components/MaxHeightSmoother/index.mjs.map +1 -1
  318. package/dist/esm/components/MaxWidthSmoother/index.mjs.map +1 -1
  319. package/dist/esm/components/Modal/Modal.mjs +2 -2
  320. package/dist/esm/components/Modal/Modal.mjs.map +1 -1
  321. package/dist/esm/components/Navbar/Burger.mjs.map +1 -1
  322. package/dist/esm/components/Navbar/DesktopNavbar.mjs.map +1 -1
  323. package/dist/esm/components/Navbar/MobileNavbar.mjs +1 -1
  324. package/dist/esm/components/Navbar/MobileNavbar.mjs.map +1 -1
  325. package/dist/esm/components/Navbar/index.mjs.map +1 -1
  326. package/dist/esm/components/Navbar/useNavigation.mjs.map +1 -1
  327. package/dist/esm/components/Pagination/NumberItemsSelector.mjs.map +1 -1
  328. package/dist/esm/components/Pagination/Pagination.mjs +1 -1
  329. package/dist/esm/components/Pagination/Pagination.mjs.map +1 -1
  330. package/dist/esm/components/Pagination/ShowingResultsNumberItems.mjs.map +1 -1
  331. package/dist/esm/components/Pagination/pagination.content.mjs.map +1 -1
  332. package/dist/esm/components/Pattern/DotPattern.mjs.map +1 -1
  333. package/dist/esm/components/Pattern/GridPattern.mjs.map +1 -1
  334. package/dist/esm/components/Pattern/SpotLight.mjs.map +1 -1
  335. package/dist/esm/components/Popover/dynamic.mjs.map +1 -1
  336. package/dist/esm/components/Popover/static.mjs.map +1 -1
  337. package/dist/esm/components/PressableSpan/PressableSpan.mjs.map +1 -1
  338. package/dist/esm/components/RightDrawer/RightDrawer.mjs +3 -3
  339. package/dist/esm/components/RightDrawer/RightDrawer.mjs.map +1 -1
  340. package/dist/esm/components/RightDrawer/isElementAtTopAndNotCovered.mjs.map +1 -1
  341. package/dist/esm/components/RightDrawer/rightDrawer.content.mjs.map +1 -1
  342. package/dist/esm/components/RightDrawer/useRightDrawer.mjs.map +1 -1
  343. package/dist/esm/components/Select/Multiselect.mjs.map +1 -1
  344. package/dist/esm/components/Select/Select.mjs.map +1 -1
  345. package/dist/esm/components/SocialNetworks/DiscordLogo.mjs.map +1 -1
  346. package/dist/esm/components/SocialNetworks/FacebookLogo.mjs.map +1 -1
  347. package/dist/esm/components/SocialNetworks/InstagramLogo.mjs.map +1 -1
  348. package/dist/esm/components/SocialNetworks/ProductHuntLogo.mjs.map +1 -1
  349. package/dist/esm/components/SocialNetworks/TiktokLogo.mjs.map +1 -1
  350. package/dist/esm/components/SocialNetworks/XLogo.mjs.map +1 -1
  351. package/dist/esm/components/SocialNetworks/YoutubeLogo.mjs.map +1 -1
  352. package/dist/esm/components/SocialNetworks/index.mjs.map +1 -1
  353. package/dist/esm/components/SwitchSelector/SwitchSelector.mjs +2 -0
  354. package/dist/esm/components/SwitchSelector/SwitchSelector.mjs.map +1 -1
  355. package/dist/esm/components/SwitchSelector/VerticalSwitchSelector.mjs.map +1 -1
  356. package/dist/esm/components/SwitchSelector/useSwitchSelector.mjs.map +1 -1
  357. package/dist/esm/components/Tab/Tab.mjs +1 -1
  358. package/dist/esm/components/Tab/Tab.mjs.map +1 -1
  359. package/dist/esm/components/Tab/TabContext.mjs.map +1 -1
  360. package/dist/esm/components/TabSelector/TabSelector.mjs.map +1 -1
  361. package/dist/esm/components/Table/ExpandButton.mjs.map +1 -1
  362. package/dist/esm/components/Table/SmartTable.mjs.map +1 -1
  363. package/dist/esm/components/Table/Table.mjs.map +1 -1
  364. package/dist/esm/components/Table/TableElements.mjs.map +1 -1
  365. package/dist/esm/components/Table/table.content.mjs.map +1 -1
  366. package/dist/esm/components/Table/useTableWidths.mjs.map +1 -1
  367. package/dist/esm/components/Tag/index.mjs.map +1 -1
  368. package/dist/esm/components/TechLogo/TechLogo.mjs.map +1 -1
  369. package/dist/esm/components/TechLogo/logos/Adonis.mjs.map +1 -1
  370. package/dist/esm/components/TechLogo/logos/Angular.mjs.map +1 -1
  371. package/dist/esm/components/TechLogo/logos/Anthropic.mjs.map +1 -1
  372. package/dist/esm/components/TechLogo/logos/Astro.mjs.map +1 -1
  373. package/dist/esm/components/TechLogo/logos/Atlassian.mjs.map +1 -1
  374. package/dist/esm/components/TechLogo/logos/Bitbucket.mjs.map +1 -1
  375. package/dist/esm/components/TechLogo/logos/ChatGPT.mjs.map +1 -1
  376. package/dist/esm/components/TechLogo/logos/Claude.mjs.map +1 -1
  377. package/dist/esm/components/TechLogo/logos/DeepSeek.mjs.map +1 -1
  378. package/dist/esm/components/TechLogo/logos/Express.mjs.map +1 -1
  379. package/dist/esm/components/TechLogo/logos/Fastify.mjs.map +1 -1
  380. package/dist/esm/components/TechLogo/logos/Gemini.mjs.map +1 -1
  381. package/dist/esm/components/TechLogo/logos/GitHub.mjs.map +1 -1
  382. package/dist/esm/components/TechLogo/logos/GitLab.mjs.map +1 -1
  383. package/dist/esm/components/TechLogo/logos/Google.mjs.map +1 -1
  384. package/dist/esm/components/TechLogo/logos/GoogleAI.mjs.map +1 -1
  385. package/dist/esm/components/TechLogo/logos/Grok.mjs.map +1 -1
  386. package/dist/esm/components/TechLogo/logos/Hono.mjs.map +1 -1
  387. package/dist/esm/components/TechLogo/logos/LinkedIn.mjs.map +1 -1
  388. package/dist/esm/components/TechLogo/logos/Lit.mjs.map +1 -1
  389. package/dist/esm/components/TechLogo/logos/Lynx.mjs.map +1 -1
  390. package/dist/esm/components/TechLogo/logos/Microsoft.mjs.map +1 -1
  391. package/dist/esm/components/TechLogo/logos/Mistral.mjs.map +1 -1
  392. package/dist/esm/components/TechLogo/logos/NestJS.mjs.map +1 -1
  393. package/dist/esm/components/TechLogo/logos/Nextjs.mjs.map +1 -1
  394. package/dist/esm/components/TechLogo/logos/Node.mjs.map +1 -1
  395. package/dist/esm/components/TechLogo/logos/Nuxt.mjs.map +1 -1
  396. package/dist/esm/components/TechLogo/logos/Ollama.mjs.map +1 -1
  397. package/dist/esm/components/TechLogo/logos/OpenAI.mjs.map +1 -1
  398. package/dist/esm/components/TechLogo/logos/Perplexity.mjs.map +1 -1
  399. package/dist/esm/components/TechLogo/logos/Preact.mjs.map +1 -1
  400. package/dist/esm/components/TechLogo/logos/Reactjs.mjs.map +1 -1
  401. package/dist/esm/components/TechLogo/logos/Solid.mjs.map +1 -1
  402. package/dist/esm/components/TechLogo/logos/Svelte.mjs.map +1 -1
  403. package/dist/esm/components/TechLogo/logos/Tanstack.mjs.map +1 -1
  404. package/dist/esm/components/TechLogo/logos/Vanilla.mjs.map +1 -1
  405. package/dist/esm/components/TechLogo/logos/Vitejs.mjs.map +1 -1
  406. package/dist/esm/components/TechLogo/logos/Vuejs.mjs.map +1 -1
  407. package/dist/esm/components/TechLogo/types.mjs.map +1 -1
  408. package/dist/esm/components/Terminal/Terminal.mjs.map +1 -1
  409. package/dist/esm/components/Terminal/terminal.content.mjs.map +1 -1
  410. package/dist/esm/components/TextArea/AutoSizeTextArea.mjs.map +1 -1
  411. package/dist/esm/components/TextArea/AutocompleteTextArea.mjs.map +1 -1
  412. package/dist/esm/components/TextArea/ContentEditableTextArea.mjs.map +1 -1
  413. package/dist/esm/components/TextArea/TextArea.mjs.map +1 -1
  414. package/dist/esm/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs.map +1 -1
  415. package/dist/esm/components/ThemeSwitcherDropDown/MobileThemeSwitcher.mjs.map +1 -1
  416. package/dist/esm/components/ThemeSwitcherDropDown/types.mjs.map +1 -1
  417. package/dist/esm/components/Toaster/Toast.mjs.map +1 -1
  418. package/dist/esm/components/Toaster/Toaster.mjs.map +1 -1
  419. package/dist/esm/components/Toaster/useToast.mjs.map +1 -1
  420. package/dist/esm/components/WithResizer/index.mjs +27 -10
  421. package/dist/esm/components/WithResizer/index.mjs.map +1 -1
  422. package/dist/esm/components/index.mjs +2 -2
  423. package/dist/esm/hooks/index.mjs +11 -11
  424. package/dist/esm/hooks/reactQuery.mjs +9 -1
  425. package/dist/esm/hooks/reactQuery.mjs.map +1 -1
  426. package/dist/esm/hooks/useAuth/useAuth.mjs.map +1 -1
  427. package/dist/esm/hooks/useAuth/useOAuth2.mjs.map +1 -1
  428. package/dist/esm/hooks/useAuth/useSession.mjs.map +1 -1
  429. package/dist/esm/hooks/useDevice.mjs.map +1 -1
  430. package/dist/esm/hooks/useGetElementById.mjs.map +1 -1
  431. package/dist/esm/hooks/useGetElementOrWindow.mjs.map +1 -1
  432. package/dist/esm/hooks/useHorizontalSwipe.mjs.map +1 -1
  433. package/dist/esm/hooks/useIntlayerAPI.mjs.map +1 -1
  434. package/dist/esm/hooks/useIsDarkMode.mjs.map +1 -1
  435. package/dist/esm/hooks/useIsMounted.mjs.map +1 -1
  436. package/dist/esm/hooks/useItemSelector.mjs.map +1 -1
  437. package/dist/esm/hooks/useKeyboardDetector.mjs.map +1 -1
  438. package/dist/esm/hooks/usePersistedStore.mjs.map +1 -1
  439. package/dist/esm/hooks/useScreenWidth.mjs.map +1 -1
  440. package/dist/esm/hooks/useScrollBlockage/index.mjs.map +1 -1
  441. package/dist/esm/hooks/useScrollBlockage/useScrollBlockageStore.mjs.map +1 -1
  442. package/dist/esm/hooks/useScrollDetection.mjs.map +1 -1
  443. package/dist/esm/hooks/useScrollY.mjs.map +1 -1
  444. package/dist/esm/hooks/useSearch.mjs.map +1 -1
  445. package/dist/esm/hooks/useUser/index.mjs.map +1 -1
  446. package/dist/esm/libs/auth.mjs.map +1 -1
  447. package/dist/esm/providers/ReactQueryProvider.mjs.map +1 -1
  448. package/dist/esm/tailwind.config.mjs.map +1 -1
  449. package/dist/esm/utils/cn.mjs.map +1 -1
  450. package/dist/types/components/Accordion/Accordion.d.ts.map +1 -1
  451. package/dist/types/components/Avatar/image.d.ts.map +1 -1
  452. package/dist/types/components/Avatar/index.d.ts +2 -0
  453. package/dist/types/components/Avatar/index.d.ts.map +1 -1
  454. package/dist/types/components/Badge/index.d.ts +2 -3
  455. package/dist/types/components/Badge/index.d.ts.map +1 -1
  456. package/dist/types/components/Breadcrumb/breadcrumb.content.d.ts +1 -3
  457. package/dist/types/components/Breadcrumb/breadcrumb.content.d.ts.map +1 -1
  458. package/dist/types/components/Breadcrumb/index.d.ts +1 -2
  459. package/dist/types/components/Breadcrumb/index.d.ts.map +1 -1
  460. package/dist/types/components/Browser/Browser.content.d.ts +127 -9
  461. package/dist/types/components/Browser/Browser.content.d.ts.map +1 -1
  462. package/dist/types/components/Browser/Browser.d.ts +1 -2
  463. package/dist/types/components/Browser/Browser.d.ts.map +1 -1
  464. package/dist/types/components/Browser/extractUrlFromSitemap.d.ts +5 -0
  465. package/dist/types/components/Browser/extractUrlFromSitemap.d.ts.map +1 -0
  466. package/dist/types/components/Button/Button.d.ts +7 -7
  467. package/dist/types/components/Button/Button.d.ts.map +1 -1
  468. package/dist/types/components/Carousel/index.content.d.ts +3 -5
  469. package/dist/types/components/Carousel/index.content.d.ts.map +1 -1
  470. package/dist/types/components/Carousel/index.d.ts.map +1 -1
  471. package/dist/types/components/ClickOutsideDiv/index.d.ts.map +1 -1
  472. package/dist/types/components/CollapsibleTable/CollapsibleTable.d.ts +3 -4
  473. package/dist/types/components/CollapsibleTable/CollapsibleTable.d.ts.map +1 -1
  474. package/dist/types/components/Command/index.d.ts +15 -17
  475. package/dist/types/components/Command/index.d.ts.map +1 -1
  476. package/dist/types/components/Container/index.d.ts +8 -9
  477. package/dist/types/components/Container/index.d.ts.map +1 -1
  478. package/dist/types/components/ContentEditor/ContentEditor.d.ts.map +1 -1
  479. package/dist/types/components/ContentEditor/ContentEditorInput.d.ts.map +1 -1
  480. package/dist/types/components/ContentEditor/ContentEditorTextArea.d.ts.map +1 -1
  481. package/dist/types/components/ContentSelector/ContentSelector.d.ts +1 -1
  482. package/dist/types/components/ContentSelector/ContentSelector.d.ts.map +1 -1
  483. package/dist/types/components/CopyButton/CopyButton.content.d.ts +1 -3
  484. package/dist/types/components/CopyButton/CopyButton.content.d.ts.map +1 -1
  485. package/dist/types/components/CopyButton/index.d.ts.map +1 -1
  486. package/dist/types/components/CopyToClipboard/index.d.ts.map +1 -1
  487. package/dist/types/components/DictionaryEditor/DictionaryEditor.d.ts.map +1 -1
  488. package/dist/types/components/DictionaryEditor/ItemLayout.d.ts.map +1 -1
  489. package/dist/types/components/DictionaryEditor/NodeWrapper/ArrayWrapper.d.ts.map +1 -1
  490. package/dist/types/components/DictionaryEditor/NodeWrapper/BooleanWrapper.d.ts.map +1 -1
  491. package/dist/types/components/DictionaryEditor/NodeWrapper/ConditionWrapper.d.ts +1 -1
  492. package/dist/types/components/DictionaryEditor/NodeWrapper/ConditionWrapper.d.ts.map +1 -1
  493. package/dist/types/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.d.ts +1 -1
  494. package/dist/types/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.d.ts.map +1 -1
  495. package/dist/types/components/DictionaryEditor/NodeWrapper/FileWrapper.d.ts.map +1 -1
  496. package/dist/types/components/DictionaryEditor/NodeWrapper/HtmlWrapper.d.ts +1 -1
  497. package/dist/types/components/DictionaryEditor/NodeWrapper/HtmlWrapper.d.ts.map +1 -1
  498. package/dist/types/components/DictionaryEditor/NodeWrapper/InsertionWrapper.d.ts +1 -1
  499. package/dist/types/components/DictionaryEditor/NodeWrapper/InsertionWrapper.d.ts.map +1 -1
  500. package/dist/types/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.d.ts +1 -1
  501. package/dist/types/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.d.ts.map +1 -1
  502. package/dist/types/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.d.ts.map +1 -1
  503. package/dist/types/components/DictionaryEditor/NodeWrapper/NumberWrapper.d.ts.map +1 -1
  504. package/dist/types/components/DictionaryEditor/NodeWrapper/PluralWrapper.d.ts +1 -1
  505. package/dist/types/components/DictionaryEditor/NodeWrapper/PluralWrapper.d.ts.map +1 -1
  506. package/dist/types/components/DictionaryEditor/NodeWrapper/StringWrapper.d.ts.map +1 -1
  507. package/dist/types/components/DictionaryEditor/NodeWrapper/TranslationWrapper.d.ts +1 -1
  508. package/dist/types/components/DictionaryEditor/NodeWrapper/TranslationWrapper.d.ts.map +1 -1
  509. package/dist/types/components/DictionaryEditor/NodeWrapper/index.d.ts.map +1 -1
  510. package/dist/types/components/DictionaryFieldEditor/ContentEditor.d.ts.map +1 -1
  511. package/dist/types/components/DictionaryFieldEditor/ContentEditorView/SafeHtmlRenderer.d.ts +1 -3
  512. package/dist/types/components/DictionaryFieldEditor/ContentEditorView/SafeHtmlRenderer.d.ts.map +1 -1
  513. package/dist/types/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts +2 -3
  514. package/dist/types/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts.map +1 -1
  515. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.d.ts.map +1 -1
  516. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts +6 -8
  517. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts.map +1 -1
  518. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.d.ts +4 -6
  519. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.d.ts.map +1 -1
  520. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts.map +1 -1
  521. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts +27 -29
  522. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts.map +1 -1
  523. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts +16 -18
  524. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts.map +1 -1
  525. package/dist/types/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
  526. package/dist/types/components/DictionaryFieldEditor/EnumKeyInput.d.ts.map +1 -1
  527. package/dist/types/components/DictionaryFieldEditor/JSONEditor.d.ts.map +1 -1
  528. package/dist/types/components/DictionaryFieldEditor/KeyPathBreadcrumb.d.ts.map +1 -1
  529. package/dist/types/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.d.ts.map +1 -1
  530. package/dist/types/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts +10 -12
  531. package/dist/types/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts.map +1 -1
  532. package/dist/types/components/DictionaryFieldEditor/NodeTypeSelector.d.ts.map +1 -1
  533. package/dist/types/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
  534. package/dist/types/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts +16 -18
  535. package/dist/types/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts.map +1 -1
  536. package/dist/types/components/DictionaryFieldEditor/StructureEditor.d.ts.map +1 -1
  537. package/dist/types/components/DictionaryFieldEditor/StructureView/StructureView.d.ts.map +1 -1
  538. package/dist/types/components/DictionaryFieldEditor/StructureView/structureView.content.d.ts +4 -6
  539. package/dist/types/components/DictionaryFieldEditor/StructureView/structureView.content.d.ts.map +1 -1
  540. package/dist/types/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.d.ts.map +1 -1
  541. package/dist/types/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.d.ts.map +1 -1
  542. package/dist/types/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts +3 -5
  543. package/dist/types/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts.map +1 -1
  544. package/dist/types/components/DictionaryFieldEditor/dictionaryFieldEditor.content.d.ts +2 -4
  545. package/dist/types/components/DictionaryFieldEditor/dictionaryFieldEditor.content.d.ts.map +1 -1
  546. package/dist/types/components/DictionaryFieldEditor/getIsEditableSection.d.ts.map +1 -1
  547. package/dist/types/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts +16 -18
  548. package/dist/types/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts.map +1 -1
  549. package/dist/types/components/DropDown/index.d.ts.map +1 -1
  550. package/dist/types/components/EditableField/EditableFieldInput.d.ts.map +1 -1
  551. package/dist/types/components/EditableField/EditableFieldLayout.d.ts.map +1 -1
  552. package/dist/types/components/EditableField/EditableFieldTextArea.d.ts.map +1 -1
  553. package/dist/types/components/ExpandCollapse/ExpandCollapse.d.ts.map +1 -1
  554. package/dist/types/components/ExpandCollapse/expandCollapse.content.d.ts +1 -3
  555. package/dist/types/components/ExpandCollapse/expandCollapse.content.d.ts.map +1 -1
  556. package/dist/types/components/Flags/Flag.d.ts.map +1 -1
  557. package/dist/types/components/Flags/flags.d.ts.map +1 -1
  558. package/dist/types/components/Footer/index.d.ts.map +1 -1
  559. package/dist/types/components/Form/Form.d.ts.map +1 -1
  560. package/dist/types/components/Form/FormBase.d.ts +2 -4
  561. package/dist/types/components/Form/FormBase.d.ts.map +1 -1
  562. package/dist/types/components/Form/FormField.d.ts +2 -4
  563. package/dist/types/components/Form/FormField.d.ts.map +1 -1
  564. package/dist/types/components/Form/FormItem.d.ts +1 -2
  565. package/dist/types/components/Form/FormItem.d.ts.map +1 -1
  566. package/dist/types/components/Form/elements/AutoSizeTextAreaElement.d.ts.map +1 -1
  567. package/dist/types/components/Form/elements/CheckboxElement.d.ts.map +1 -1
  568. package/dist/types/components/Form/elements/EditableFieldInputElement.d.ts +1 -2
  569. package/dist/types/components/Form/elements/EditableFieldInputElement.d.ts.map +1 -1
  570. package/dist/types/components/Form/elements/EditableFieldTextAreaElement.d.ts +1 -2
  571. package/dist/types/components/Form/elements/EditableFieldTextAreaElement.d.ts.map +1 -1
  572. package/dist/types/components/Form/elements/FormElement.d.ts +1 -2
  573. package/dist/types/components/Form/elements/FormElement.d.ts.map +1 -1
  574. package/dist/types/components/Form/elements/FormElementWrapper.d.ts.map +1 -1
  575. package/dist/types/components/Form/elements/InputElement.d.ts.map +1 -1
  576. package/dist/types/components/Form/elements/InputPasswordElement.d.ts.map +1 -1
  577. package/dist/types/components/Form/elements/MultiselectElement.d.ts +1 -2
  578. package/dist/types/components/Form/elements/MultiselectElement.d.ts.map +1 -1
  579. package/dist/types/components/Form/elements/OTPElement.d.ts +1 -2
  580. package/dist/types/components/Form/elements/OTPElement.d.ts.map +1 -1
  581. package/dist/types/components/Form/elements/SearchInputElement.d.ts.map +1 -1
  582. package/dist/types/components/Form/elements/SelectElement.d.ts +1 -2
  583. package/dist/types/components/Form/elements/SelectElement.d.ts.map +1 -1
  584. package/dist/types/components/Form/elements/SwitchSelectorElement.d.ts +1 -2
  585. package/dist/types/components/Form/elements/SwitchSelectorElement.d.ts.map +1 -1
  586. package/dist/types/components/Form/elements/TextAreaElement.d.ts.map +1 -1
  587. package/dist/types/components/Form/layout/FormItemLayout.d.ts.map +1 -1
  588. package/dist/types/components/Form/layout/FormLabelLayout.d.ts.map +1 -1
  589. package/dist/types/components/Form/layout/RequiredStar.d.ts.map +1 -1
  590. package/dist/types/components/HTMLRender/HTMLRender.d.ts.map +1 -1
  591. package/dist/types/components/Headers/index.d.ts.map +1 -1
  592. package/dist/types/components/HeightResizer/index.d.ts.map +1 -1
  593. package/dist/types/components/HideShow/index.d.ts.map +1 -1
  594. package/dist/types/components/IDE/Code.d.ts.map +1 -1
  595. package/dist/types/components/IDE/CodeBlockClient.d.ts.map +1 -1
  596. package/dist/types/components/IDE/CodeBlockHighlight.d.ts +1 -2
  597. package/dist/types/components/IDE/CodeBlockHighlight.d.ts.map +1 -1
  598. package/dist/types/components/IDE/CodeBlockServer.d.ts.map +1 -1
  599. package/dist/types/components/IDE/CodeBlockShiki.d.ts.map +1 -1
  600. package/dist/types/components/IDE/CodeContext.d.ts +1 -2
  601. package/dist/types/components/IDE/CodeContext.d.ts.map +1 -1
  602. package/dist/types/components/IDE/CodeFormatSelector.d.ts.map +1 -1
  603. package/dist/types/components/IDE/ContentDeclarationFormatSelector.d.ts.map +1 -1
  604. package/dist/types/components/IDE/CopyCode.d.ts.map +1 -1
  605. package/dist/types/components/IDE/FileList.d.ts.map +1 -1
  606. package/dist/types/components/IDE/FileTree.d.ts.map +1 -1
  607. package/dist/types/components/IDE/IDE.d.ts.map +1 -1
  608. package/dist/types/components/IDE/MarkDownRender.d.ts.map +1 -1
  609. package/dist/types/components/IDE/MonacoCode.d.ts.map +1 -1
  610. package/dist/types/components/IDE/PackageManagerSelector.d.ts.map +1 -1
  611. package/dist/types/components/IDE/code.content.d.ts +2 -4
  612. package/dist/types/components/IDE/code.content.d.ts.map +1 -1
  613. package/dist/types/components/IDE/codeTransformer.d.ts.map +1 -1
  614. package/dist/types/components/IDE/copyCode.content.d.ts +2 -4
  615. package/dist/types/components/IDE/copyCode.content.d.ts.map +1 -1
  616. package/dist/types/components/IDE/createFileTree.d.ts.map +1 -1
  617. package/dist/types/components/IDE/index.d.ts +1 -1
  618. package/dist/types/components/IDE/selectors.content.d.ts +6 -8
  619. package/dist/types/components/IDE/selectors.content.d.ts.map +1 -1
  620. package/dist/types/components/InformationTag/index.d.ts.map +1 -1
  621. package/dist/types/components/Input/Checkbox.d.ts +2 -3
  622. package/dist/types/components/Input/Checkbox.d.ts.map +1 -1
  623. package/dist/types/components/Input/Input.d.ts +1 -2
  624. package/dist/types/components/Input/Input.d.ts.map +1 -1
  625. package/dist/types/components/Input/InputPassword.d.ts.map +1 -1
  626. package/dist/types/components/Input/OTPInput.d.ts +3 -6
  627. package/dist/types/components/Input/OTPInput.d.ts.map +1 -1
  628. package/dist/types/components/Input/SearchInput.d.ts +1 -2
  629. package/dist/types/components/Input/SearchInput.d.ts.map +1 -1
  630. package/dist/types/components/KeyboardScreenAdapter/index.d.ts.map +1 -1
  631. package/dist/types/components/KeyboardShortcut/KeyboardShortcut.d.ts.map +1 -1
  632. package/dist/types/components/Label/index.d.ts.map +1 -1
  633. package/dist/types/components/LanguageBackground/index.d.ts.map +1 -1
  634. package/dist/types/components/Link/Link.d.ts +4 -5
  635. package/dist/types/components/Link/Link.d.ts.map +1 -1
  636. package/dist/types/components/Loader/index.content.d.ts +1 -3
  637. package/dist/types/components/Loader/index.content.d.ts.map +1 -1
  638. package/dist/types/components/Loader/index.d.ts.map +1 -1
  639. package/dist/types/components/Loader/spinner.d.ts +1 -2
  640. package/dist/types/components/Loader/spinner.d.ts.map +1 -1
  641. package/dist/types/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.d.ts.map +1 -1
  642. package/dist/types/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.d.ts.map +1 -1
  643. package/dist/types/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts +8 -10
  644. package/dist/types/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts.map +1 -1
  645. package/dist/types/components/LocaleSwitcherDropDown/LocaleSwitcher.d.ts.map +1 -1
  646. package/dist/types/components/LocaleSwitcherDropDown/localeSwitcher.content.d.ts +6 -8
  647. package/dist/types/components/LocaleSwitcherDropDown/localeSwitcher.content.d.ts.map +1 -1
  648. package/dist/types/components/Logo/Logo.d.ts.map +1 -1
  649. package/dist/types/components/Logo/LogoWithTextBelow.d.ts.map +1 -1
  650. package/dist/types/components/MarkDownRender/MarkDownIframe.d.ts.map +1 -1
  651. package/dist/types/components/MarkDownRender/MarkDownRender.d.ts +44 -45
  652. package/dist/types/components/MarkDownRender/MarkDownRender.d.ts.map +1 -1
  653. package/dist/types/components/MaxHeightSmoother/index.d.ts.map +1 -1
  654. package/dist/types/components/MaxWidthSmoother/index.d.ts +1 -2
  655. package/dist/types/components/MaxWidthSmoother/index.d.ts.map +1 -1
  656. package/dist/types/components/Modal/Modal.d.ts.map +1 -1
  657. package/dist/types/components/Navbar/Burger.d.ts +1 -2
  658. package/dist/types/components/Navbar/Burger.d.ts.map +1 -1
  659. package/dist/types/components/Navbar/DesktopNavbar.d.ts +1 -2
  660. package/dist/types/components/Navbar/DesktopNavbar.d.ts.map +1 -1
  661. package/dist/types/components/Navbar/MobileNavbar.d.ts +1 -2
  662. package/dist/types/components/Navbar/MobileNavbar.d.ts.map +1 -1
  663. package/dist/types/components/Navbar/index.d.ts +1 -2
  664. package/dist/types/components/Navbar/index.d.ts.map +1 -1
  665. package/dist/types/components/Navbar/useNavigation.d.ts.map +1 -1
  666. package/dist/types/components/Pagination/NumberItemsSelector.d.ts.map +1 -1
  667. package/dist/types/components/Pagination/Pagination.d.ts +2 -3
  668. package/dist/types/components/Pagination/Pagination.d.ts.map +1 -1
  669. package/dist/types/components/Pagination/ShowingResultsNumberItems.d.ts.map +1 -1
  670. package/dist/types/components/Pagination/pagination.content.d.ts +5 -7
  671. package/dist/types/components/Pagination/pagination.content.d.ts.map +1 -1
  672. package/dist/types/components/Pattern/DotPattern.d.ts.map +1 -1
  673. package/dist/types/components/Pattern/GridPattern.d.ts.map +1 -1
  674. package/dist/types/components/Pattern/SpotLight.d.ts.map +1 -1
  675. package/dist/types/components/Popover/dynamic.d.ts.map +1 -1
  676. package/dist/types/components/Popover/static.d.ts +3 -2
  677. package/dist/types/components/Popover/static.d.ts.map +1 -1
  678. package/dist/types/components/PressableSpan/PressableSpan.d.ts.map +1 -1
  679. package/dist/types/components/RightDrawer/RightDrawer.d.ts.map +1 -1
  680. package/dist/types/components/RightDrawer/isElementAtTopAndNotCovered.d.ts.map +1 -1
  681. package/dist/types/components/RightDrawer/rightDrawer.content.d.ts +2 -4
  682. package/dist/types/components/RightDrawer/rightDrawer.content.d.ts.map +1 -1
  683. package/dist/types/components/RightDrawer/useRightDrawer.d.ts.map +1 -1
  684. package/dist/types/components/Select/Multiselect.d.ts.map +1 -1
  685. package/dist/types/components/Select/Select.d.ts +2 -3
  686. package/dist/types/components/Select/Select.d.ts.map +1 -1
  687. package/dist/types/components/SocialNetworks/index.d.ts +1 -2
  688. package/dist/types/components/SocialNetworks/index.d.ts.map +1 -1
  689. package/dist/types/components/SwitchSelector/SwitchSelector.d.ts +8 -9
  690. package/dist/types/components/SwitchSelector/SwitchSelector.d.ts.map +1 -1
  691. package/dist/types/components/SwitchSelector/VerticalSwitchSelector.d.ts +4 -6
  692. package/dist/types/components/SwitchSelector/VerticalSwitchSelector.d.ts.map +1 -1
  693. package/dist/types/components/SwitchSelector/useSwitchSelector.d.ts +3 -4
  694. package/dist/types/components/SwitchSelector/useSwitchSelector.d.ts.map +1 -1
  695. package/dist/types/components/Tab/Tab.d.ts +3 -5
  696. package/dist/types/components/Tab/Tab.d.ts.map +1 -1
  697. package/dist/types/components/Tab/TabContext.d.ts +1 -2
  698. package/dist/types/components/Tab/TabContext.d.ts.map +1 -1
  699. package/dist/types/components/TabSelector/TabSelector.d.ts +3 -5
  700. package/dist/types/components/TabSelector/TabSelector.d.ts.map +1 -1
  701. package/dist/types/components/Table/ExpandButton.d.ts.map +1 -1
  702. package/dist/types/components/Table/SmartTable.d.ts.map +1 -1
  703. package/dist/types/components/Table/Table.d.ts +1 -2
  704. package/dist/types/components/Table/Table.d.ts.map +1 -1
  705. package/dist/types/components/Table/TableElements.d.ts +4 -5
  706. package/dist/types/components/Table/TableElements.d.ts.map +1 -1
  707. package/dist/types/components/Table/table.content.d.ts +2 -4
  708. package/dist/types/components/Table/table.content.d.ts.map +1 -1
  709. package/dist/types/components/Tag/index.d.ts +3 -4
  710. package/dist/types/components/Tag/index.d.ts.map +1 -1
  711. package/dist/types/components/TechLogo/TechLogo.d.ts.map +1 -1
  712. package/dist/types/components/TechLogo/logos/Lit.d.ts +1 -2
  713. package/dist/types/components/TechLogo/logos/Lit.d.ts.map +1 -1
  714. package/dist/types/components/TechLogo/logos/Vanilla.d.ts +1 -2
  715. package/dist/types/components/TechLogo/logos/Vanilla.d.ts.map +1 -1
  716. package/dist/types/components/Terminal/Terminal.d.ts.map +1 -1
  717. package/dist/types/components/Terminal/terminal.content.d.ts +2 -4
  718. package/dist/types/components/Terminal/terminal.content.d.ts.map +1 -1
  719. package/dist/types/components/TextArea/AutoSizeTextArea.d.ts.map +1 -1
  720. package/dist/types/components/TextArea/AutocompleteTextArea.d.ts.map +1 -1
  721. package/dist/types/components/TextArea/ContentEditableTextArea.d.ts +1 -2
  722. package/dist/types/components/TextArea/ContentEditableTextArea.d.ts.map +1 -1
  723. package/dist/types/components/TextArea/TextArea.d.ts.map +1 -1
  724. package/dist/types/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.d.ts.map +1 -1
  725. package/dist/types/components/ThemeSwitcherDropDown/MobileThemeSwitcher.d.ts.map +1 -1
  726. package/dist/types/components/Toaster/Toast.d.ts +1 -2
  727. package/dist/types/components/Toaster/Toast.d.ts.map +1 -1
  728. package/dist/types/components/Toaster/Toaster.d.ts +1 -3
  729. package/dist/types/components/Toaster/Toaster.d.ts.map +1 -1
  730. package/dist/types/components/Toaster/useToast.d.ts.map +1 -1
  731. package/dist/types/components/WithResizer/index.d.ts +5 -1
  732. package/dist/types/components/WithResizer/index.d.ts.map +1 -1
  733. package/dist/types/components/index.d.ts +1 -1
  734. package/dist/types/hooks/index.d.ts +2 -2
  735. package/dist/types/hooks/reactQuery.d.ts +2 -1
  736. package/dist/types/hooks/reactQuery.d.ts.map +1 -1
  737. package/dist/types/hooks/useAuth/useOAuth2.d.ts.map +1 -1
  738. package/dist/types/hooks/useDevice.d.ts.map +1 -1
  739. package/dist/types/hooks/useGetElementById.d.ts.map +1 -1
  740. package/dist/types/hooks/useGetElementOrWindow.d.ts.map +1 -1
  741. package/dist/types/hooks/useHorizontalSwipe.d.ts.map +1 -1
  742. package/dist/types/hooks/useIntlayerAPI.d.ts.map +1 -1
  743. package/dist/types/hooks/useItemSelector.d.ts.map +1 -1
  744. package/dist/types/hooks/useScrollBlockage/index.d.ts.map +1 -1
  745. package/dist/types/hooks/useScrollBlockage/useScrollBlockageStore.d.ts.map +1 -1
  746. package/dist/types/hooks/useScrollDetection.d.ts.map +1 -1
  747. package/dist/types/hooks/useScrollY.d.ts.map +1 -1
  748. package/dist/types/hooks/useSearch.d.ts.map +1 -1
  749. package/dist/types/hooks/useUser/index.d.ts +1 -3
  750. package/dist/types/hooks/useUser/index.d.ts.map +1 -1
  751. package/dist/types/libs/auth.d.ts.map +1 -1
  752. package/dist/types/providers/ReactQueryProvider.d.ts.map +1 -1
  753. package/dist/types/routes.d.ts.map +1 -1
  754. package/dist/types/utils/cn.d.ts.map +1 -1
  755. package/package.json +17 -17
  756. package/tailwind.css +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"MonacoCode.mjs","names":[],"sources":["../../../../src/components/IDE/MonacoCode.tsx"],"sourcesContent":["'use client';\n\nimport type { OnChange, OnMount } from '@monaco-editor/react';\nimport { cn } from '@utils/cn';\nimport { type FC, lazy, Suspense, useRef, useState } from 'react';\nimport { CopyButton } from '../CopyButton';\nimport { Loader } from '../Loader';\n\nconst Editor = lazy(() =>\n import('@monaco-editor/react').then((mod) => ({ default: mod.Editor }))\n);\n\ntype CodeCompProps = {\n children: string;\n language: string;\n isDarkMode?: boolean;\n showLineNumbers?: boolean;\n showCopyButton?: boolean;\n isReadOnly?: boolean;\n onChange?: OnChange;\n};\n\nexport const MonacoCode: FC<CodeCompProps> = ({\n children,\n language,\n isDarkMode,\n showLineNumbers,\n showCopyButton = true,\n isReadOnly = false,\n onChange,\n}) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const ideRef = useRef(null);\n const [editorSize, setEditorSize] = useState<{\n height: number;\n width: number;\n }>({ height: 0, width: 0 });\n\n const theme = isDarkMode ? 'vs-dark-transparent' : 'hc-light-theme';\n\n const handleMountIde: OnMount = (editor, monaco) => {\n // first time you set the height based on content Height\n\n ideRef.current = editor as any;\n const contentHeight = (editor.getContentHeight() ?? 0) + 25;\n\n monaco.editor.defineTheme('vs-dark-transparent', {\n base: 'vs-dark',\n inherit: true,\n rules: [],\n colors: {\n 'editor.background': '#00000000',\n },\n });\n monaco.editor.defineTheme('hc-light-theme', {\n base: 'vs',\n inherit: true,\n rules: [],\n colors: {\n 'editor.background': '#00000000',\n },\n });\n\n monaco.editor.setTheme(theme);\n\n // Disable TypeScript diagnostics\n monaco.languages.typescript.typescriptDefaults.setDiagnosticsOptions({\n noSemanticValidation: true, // Disables type checking\n noSyntaxValidation: true, // Disables syntax errors\n });\n\n // Disable JavaScript diagnostics\n monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({\n noSemanticValidation: true,\n noSyntaxValidation: true,\n });\n\n // Disable unnecessary language features (e.g., suggestions, quick fixes)\n monaco.languages.typescript.typescriptDefaults.setCompilerOptions({\n noLib: true,\n allowNonTsExtensions: true,\n });\n\n monaco.languages.typescript.javascriptDefaults.setCompilerOptions({\n noLib: true,\n allowNonTsExtensions: true,\n });\n\n setEditorSize({\n height: contentHeight,\n width: containerRef.current?.clientWidth ?? 0,\n });\n };\n\n const isShowLineNumbers =\n showLineNumbers ??\n (typeof children === 'string' ? children.split('\\n').length > 1 : false);\n\n return (\n <div\n className={cn(\n 'relative h-full w-full text-sm',\n showLineNumbers && 'ml-0'\n )}\n >\n {showCopyButton && (\n <div className=\"sticky top-5 z-10\">\n <div\n className={cn('absolute right-2 bottom-0 flex h-7 items-center')}\n >\n <CopyButton content={children} />\n </div>\n </div>\n )}\n <div\n className=\"z-0 grid size-full grid-cols-[0px] overflow-auto\"\n ref={containerRef}\n >\n <Suspense fallback={<Loader />}>\n <Editor\n {...editorSize}\n defaultLanguage=\"typescript\"\n language={language}\n loading={<Loader />}\n defaultValue={String(children).replace(/\\n$/, '')}\n onMount={handleMountIde}\n onChange={onChange}\n options={{\n contextmenu: false,\n readOnly: isReadOnly,\n cursorStyle: 'line',\n minimap: { enabled: false },\n scrollbar: {\n vertical: 'hidden',\n verticalScrollbarSize: 0,\n alwaysConsumeMouseWheel: false,\n },\n folding: false, // Disable code folding\n renderValidationDecorations: 'off', // Disable error/warning decorations\n quickSuggestions: false, // Disable IntelliSense\n parameterHints: { enabled: false }, // Disable parameter hints\n suggestOnTriggerCharacters: false, // Disable suggestions on typing\n\n mouseWheelScrollSensitivity: 0,\n fastScrollSensitivity: 0,\n scrollBeyondLastLine: false,\n lineNumbers: isShowLineNumbers ? 'on' : 'off',\n }}\n theme={theme}\n className=\"my-2 rounded-md\"\n />\n </Suspense>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;AAQA,MAAM,SAAS,WACb,OAAO,wBAAwB,MAAM,SAAS,EAAE,SAAS,IAAI,QAAQ,EAAE,CACxE;AAYD,MAAa,cAAiC,EAC5C,UACA,UACA,YACA,iBACA,iBAAiB,MACjB,aAAa,OACb,eACI;CACJ,MAAM,eAAe,OAAuB,KAAK;CACjD,MAAM,SAAS,OAAO,KAAK;CAC3B,MAAM,CAAC,YAAY,iBAAiB,SAGjC;EAAE,QAAQ;EAAG,OAAO;EAAG,CAAC;CAE3B,MAAM,QAAQ,aAAa,wBAAwB;CAEnD,MAAM,kBAA2B,QAAQ,WAAW;EAGlD,OAAO,UAAU;EACjB,MAAM,iBAAiB,OAAO,kBAAkB,IAAI,KAAK;EAEzD,OAAO,OAAO,YAAY,uBAAuB;GAC/C,MAAM;GACN,SAAS;GACT,OAAO,EAAE;GACT,QAAQ,EACN,qBAAqB,aACtB;GACF,CAAC;EACF,OAAO,OAAO,YAAY,kBAAkB;GAC1C,MAAM;GACN,SAAS;GACT,OAAO,EAAE;GACT,QAAQ,EACN,qBAAqB,aACtB;GACF,CAAC;EAEF,OAAO,OAAO,SAAS,MAAM;EAG7B,OAAO,UAAU,WAAW,mBAAmB,sBAAsB;GACnE,sBAAsB;GACtB,oBAAoB;GACrB,CAAC;EAGF,OAAO,UAAU,WAAW,mBAAmB,sBAAsB;GACnE,sBAAsB;GACtB,oBAAoB;GACrB,CAAC;EAGF,OAAO,UAAU,WAAW,mBAAmB,mBAAmB;GAChE,OAAO;GACP,sBAAsB;GACvB,CAAC;EAEF,OAAO,UAAU,WAAW,mBAAmB,mBAAmB;GAChE,OAAO;GACP,sBAAsB;GACvB,CAAC;EAEF,cAAc;GACZ,QAAQ;GACR,OAAO,aAAa,SAAS,eAAe;GAC7C,CAAC;;CAGJ,MAAM,oBACJ,oBACC,OAAO,aAAa,WAAW,SAAS,MAAM,KAAK,CAAC,SAAS,IAAI;CAEpE,OACE,qBAAC,OAAD;EACE,WAAW,GACT,kCACA,mBAAmB,OACpB;YAJH,CAMG,kBACC,oBAAC,OAAD;GAAK,WAAU;aACb,oBAAC,OAAD;IACE,WAAW,GAAG,kDAAkD;cAEhE,oBAAC,YAAD,EAAY,SAAS,UAAY;IAC7B;GACF,GAER,oBAAC,OAAD;GACE,WAAU;GACV,KAAK;aAEL,oBAAC,UAAD;IAAU,UAAU,oBAAC,QAAD,EAAU;cAC5B,oBAAC,QAAD;KACE,GAAI;KACJ,iBAAgB;KACN;KACV,SAAS,oBAAC,QAAD,EAAU;KACnB,cAAc,OAAO,SAAS,CAAC,QAAQ,OAAO,GAAG;KACjD,SAAS;KACC;KACV,SAAS;MACP,aAAa;MACb,UAAU;MACV,aAAa;MACb,SAAS,EAAE,SAAS,OAAO;MAC3B,WAAW;OACT,UAAU;OACV,uBAAuB;OACvB,yBAAyB;OAC1B;MACD,SAAS;MACT,6BAA6B;MAC7B,kBAAkB;MAClB,gBAAgB,EAAE,SAAS,OAAO;MAClC,4BAA4B;MAE5B,6BAA6B;MAC7B,uBAAuB;MACvB,sBAAsB;MACtB,aAAa,oBAAoB,OAAO;MACzC;KACM;KACP,WAAU;KACV;IACO;GACP,EACF"}
1
+ {"version":3,"file":"MonacoCode.mjs","names":[],"sources":["../../../../src/components/IDE/MonacoCode.tsx"],"sourcesContent":["'use client';\n\nimport type { OnChange, OnMount } from '@monaco-editor/react';\nimport { cn } from '@utils/cn';\nimport { type FC, lazy, Suspense, useRef, useState } from 'react';\nimport { CopyButton } from '../CopyButton';\nimport { Loader } from '../Loader';\n\nconst Editor = lazy(() =>\n import('@monaco-editor/react').then((mod) => ({ default: mod.Editor }))\n);\n\ntype CodeCompProps = {\n children: string;\n language: string;\n isDarkMode?: boolean;\n showLineNumbers?: boolean;\n showCopyButton?: boolean;\n isReadOnly?: boolean;\n onChange?: OnChange;\n};\n\nexport const MonacoCode: FC<CodeCompProps> = ({\n children,\n language,\n isDarkMode,\n showLineNumbers,\n showCopyButton = true,\n isReadOnly = false,\n onChange,\n}) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const ideRef = useRef(null);\n const [editorSize, setEditorSize] = useState<{\n height: number;\n width: number;\n }>({ height: 0, width: 0 });\n\n const theme = isDarkMode ? 'vs-dark-transparent' : 'hc-light-theme';\n\n const handleMountIde: OnMount = (editor, monaco) => {\n // first time you set the height based on content Height\n\n ideRef.current = editor as any;\n const contentHeight = (editor.getContentHeight() ?? 0) + 25;\n\n monaco.editor.defineTheme('vs-dark-transparent', {\n base: 'vs-dark',\n inherit: true,\n rules: [],\n colors: {\n 'editor.background': '#00000000',\n },\n });\n monaco.editor.defineTheme('hc-light-theme', {\n base: 'vs',\n inherit: true,\n rules: [],\n colors: {\n 'editor.background': '#00000000',\n },\n });\n\n monaco.editor.setTheme(theme);\n\n // Disable TypeScript diagnostics\n monaco.languages.typescript.typescriptDefaults.setDiagnosticsOptions({\n noSemanticValidation: true, // Disables type checking\n noSyntaxValidation: true, // Disables syntax errors\n });\n\n // Disable JavaScript diagnostics\n monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({\n noSemanticValidation: true,\n noSyntaxValidation: true,\n });\n\n // Disable unnecessary language features (e.g., suggestions, quick fixes)\n monaco.languages.typescript.typescriptDefaults.setCompilerOptions({\n noLib: true,\n allowNonTsExtensions: true,\n });\n\n monaco.languages.typescript.javascriptDefaults.setCompilerOptions({\n noLib: true,\n allowNonTsExtensions: true,\n });\n\n setEditorSize({\n height: contentHeight,\n width: containerRef.current?.clientWidth ?? 0,\n });\n };\n\n const isShowLineNumbers =\n showLineNumbers ??\n (typeof children === 'string' ? children.split('\\n').length > 1 : false);\n\n return (\n <div\n className={cn(\n 'relative h-full w-full text-sm',\n showLineNumbers && 'ml-0'\n )}\n >\n {showCopyButton && (\n <div className=\"sticky top-5 z-10\">\n <div\n className={cn('absolute right-2 bottom-0 flex h-7 items-center')}\n >\n <CopyButton content={children} />\n </div>\n </div>\n )}\n <div\n className=\"z-0 grid size-full grid-cols-[0px] overflow-auto\"\n ref={containerRef}\n >\n <Suspense fallback={<Loader />}>\n <Editor\n {...editorSize}\n defaultLanguage=\"typescript\"\n language={language}\n loading={<Loader />}\n defaultValue={String(children).replace(/\\n$/, '')}\n onMount={handleMountIde}\n onChange={onChange}\n options={{\n contextmenu: false,\n readOnly: isReadOnly,\n cursorStyle: 'line',\n minimap: { enabled: false },\n scrollbar: {\n vertical: 'hidden',\n verticalScrollbarSize: 0,\n alwaysConsumeMouseWheel: false,\n },\n folding: false, // Disable code folding\n renderValidationDecorations: 'off', // Disable error/warning decorations\n quickSuggestions: false, // Disable IntelliSense\n parameterHints: { enabled: false }, // Disable parameter hints\n suggestOnTriggerCharacters: false, // Disable suggestions on typing\n\n mouseWheelScrollSensitivity: 0,\n fastScrollSensitivity: 0,\n scrollBeyondLastLine: false,\n lineNumbers: isShowLineNumbers ? 'on' : 'off',\n }}\n theme={theme}\n className=\"my-2 rounded-md\"\n />\n </Suspense>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;AAQA,MAAM,SAAS,WACb,OAAO,wBAAwB,MAAM,SAAS,EAAE,SAAS,IAAI,OAAO,EAAE,CACxE;AAYA,MAAa,cAAiC,EAC5C,UACA,UACA,YACA,iBACA,iBAAiB,MACjB,aAAa,OACb,eACI;CACJ,MAAM,eAAe,OAAuB,IAAI;CAChD,MAAM,SAAS,OAAO,IAAI;CAC1B,MAAM,CAAC,YAAY,iBAAiB,SAGjC;EAAE,QAAQ;EAAG,OAAO;CAAE,CAAC;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AAS;KAClB,cAAc,OAAO,QAAQ,EAAE,QAAQ,OAAO,EAAE;KAChD,SAAS;KACC;KACV,SAAS;MACP,aAAa;MACb,UAAU;MACV,aAAa;MACb,SAAS,EAAE,SAAS,MAAM;MAC1B,WAAW;OACT,UAAU;OACV,uBAAuB;OACvB,yBAAyB;MAC3B;MACA,SAAS;MACT,6BAA6B;MAC7B,kBAAkB;MAClB,gBAAgB,EAAE,SAAS,MAAM;MACjC,4BAA4B;MAE5B,6BAA6B;MAC7B,uBAAuB;MACvB,sBAAsB;MACtB,aAAa,oBAAoB,OAAO;KAC1C;KACO;KACP,WAAU;IACX;GACO;EACP,EACF;;AAET"}
@@ -1 +1 @@
1
- {"version":3,"file":"PackageManagerSelector.mjs","names":[],"sources":["../../../../src/components/IDE/PackageManagerSelector.tsx"],"sourcesContent":["'use client';\n\nimport type { FC } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport { Select } from '../Select';\nimport { useCodeContext } from './CodeContext';\n\nexport const PackageManagerSelector: FC = () => {\n const { packageManager, setPackageManager } = useCodeContext();\n const content = useIntlayer('code-selectors');\n useIntlayer('code-selectors');\n\n return (\n <Select value={packageManager} onValueChange={setPackageManager}>\n <Select.Trigger\n className=\"py-1!\"\n aria-label={content.packageManager.label.value}\n >\n <Select.Value placeholder={content.packageManager.placeholder.value} />\n </Select.Trigger>\n <Select.Content>\n <Select.Item value=\"npm\">npm</Select.Item>\n <Select.Item value=\"pnpm\">pnpm</Select.Item>\n <Select.Item value=\"yarn\">yarn</Select.Item>\n <Select.Item value=\"bun\">bun</Select.Item>\n </Select.Content>\n </Select>\n );\n};\n"],"mappings":";;;;;;;;AAOA,MAAa,+BAAmC;CAC9C,MAAM,EAAE,gBAAgB,sBAAsB,gBAAgB;CAC9D,MAAM,UAAU,YAAY,iBAAiB;CAC7C,YAAY,iBAAiB;CAE7B,OACE,qBAAC,QAAD;EAAQ,OAAO;EAAgB,eAAe;YAA9C,CACE,oBAAC,OAAO,SAAR;GACE,WAAU;GACV,cAAY,QAAQ,eAAe,MAAM;aAEzC,oBAAC,OAAO,OAAR,EAAc,aAAa,QAAQ,eAAe,YAAY,OAAS;GACxD,GACjB,qBAAC,OAAO,SAAR;GACE,oBAAC,OAAO,MAAR;IAAa,OAAM;cAAM;IAAiB;GAC1C,oBAAC,OAAO,MAAR;IAAa,OAAM;cAAO;IAAkB;GAC5C,oBAAC,OAAO,MAAR;IAAa,OAAM;cAAO;IAAkB;GAC5C,oBAAC,OAAO,MAAR;IAAa,OAAM;cAAM;IAAiB;GAC3B,IACV"}
1
+ {"version":3,"file":"PackageManagerSelector.mjs","names":[],"sources":["../../../../src/components/IDE/PackageManagerSelector.tsx"],"sourcesContent":["'use client';\n\nimport type { FC } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport { Select } from '../Select';\nimport { useCodeContext } from './CodeContext';\n\nexport const PackageManagerSelector: FC = () => {\n const { packageManager, setPackageManager } = useCodeContext();\n const content = useIntlayer('code-selectors');\n useIntlayer('code-selectors');\n\n return (\n <Select value={packageManager} onValueChange={setPackageManager}>\n <Select.Trigger\n className=\"py-1!\"\n aria-label={content.packageManager.label.value}\n >\n <Select.Value placeholder={content.packageManager.placeholder.value} />\n </Select.Trigger>\n <Select.Content>\n <Select.Item value=\"npm\">npm</Select.Item>\n <Select.Item value=\"pnpm\">pnpm</Select.Item>\n <Select.Item value=\"yarn\">yarn</Select.Item>\n <Select.Item value=\"bun\">bun</Select.Item>\n </Select.Content>\n </Select>\n );\n};\n"],"mappings":";;;;;;;;AAOA,MAAa,+BAAmC;CAC9C,MAAM,EAAE,gBAAgB,sBAAsB,eAAe;CAC7D,MAAM,UAAU,YAAY,gBAAgB;CAC5C,YAAY,gBAAgB;CAE5B,OACE,qBAAC,QAAD;EAAQ,OAAO;EAAgB,eAAe;YAA9C,CACE,oBAAC,OAAO,SAAR;GACE,WAAU;GACV,cAAY,QAAQ,eAAe,MAAM;aAEzC,oBAAC,OAAO,OAAR,EAAc,aAAa,QAAQ,eAAe,YAAY,MAAQ;EACxD,IAChB,qBAAC,OAAO,SAAR;GACE,oBAAC,OAAO,MAAR;IAAa,OAAM;cAAM;GAAgB;GACzC,oBAAC,OAAO,MAAR;IAAa,OAAM;cAAO;GAAiB;GAC3C,oBAAC,OAAO,MAAR;IAAa,OAAM;cAAO;GAAiB;GAC3C,oBAAC,OAAO,MAAR;IAAa,OAAM;cAAM;GAAgB;EAC3B,IACV;;AAEZ"}
@@ -1 +1 @@
1
- {"version":3,"file":"code.content.mjs","names":[],"sources":["../../../../src/components/IDE/code.content.ts"],"sourcesContent":["import { type Dictionary, t } from 'intlayer';\n\nconst codeContent = {\n key: 'code',\n content: {\n title: t({\n en: 'Copy code',\n es: 'Copiar código',\n pt: 'Copiar código',\n fr: 'Copier le code',\n de: 'Code kopieren',\n it: 'Copiare il codice',\n ja: 'コードをコピー',\n ko: '코드 복사',\n zh: '复制代码',\n hi: 'कोड कॉपी करें',\n 'en-GB': 'Copy code',\n ru: 'Копировать код',\n ar: 'نسخ الكود',\n tr: 'Kodu kopyala',\n pl: 'Kopiuj kod',\n id: 'Salin kode',\n vi: 'Sao chép mã',\n uk: 'Копіювати код',\n }),\n description: t({\n en: 'Copy the code to the clipboard',\n es: 'Copiar el código al portapapeles',\n pt: 'Copiar o código para a área de transferência',\n fr: 'Copier le code dans le presse-papiers',\n de: 'Kopieren Sie den Code in die Zwischenablage',\n it: 'Copiare il codice nella clipboard',\n ja: 'コードをクリップボードにコピー',\n ko: '코드를 클립보드에 복사',\n zh: '复制代码到剪贴板',\n hi: 'कोड को क्लिपबोर्ड पर कॉपी करें',\n 'en-GB': 'Copy the code to the clipboard',\n ru: 'Копировать код в буфер обмена',\n ar: 'نسخ الكود إلى الحافظة',\n tr: 'Kodu panoya kopyala',\n pl: 'Skopiuj kod do schowka',\n id: 'Salin kode ke clipboard',\n vi: 'Sao chép đoạn mã vào khay nhớ tạm (clipboard)',\n uk: 'Скопіюйте код у буфер обміну',\n }),\n },\n title: 'Code block actions',\n description:\n 'Content declaration for code block interactions, allowing users to copy code snippets to the clipboard.',\n tags: ['code block', 'copy action', 'design system'],\n} satisfies Dictionary;\n\nexport default codeContent;\n"],"mappings":";;;AAEA,MAAM,cAAc;CAClB,KAAK;CACL,SAAS;EACP,OAAO,EAAE;GACP,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,SAAS;GACT,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL,CAAC;EACF,aAAa,EAAE;GACb,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,SAAS;GACT,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL,CAAC;EACH;CACD,OAAO;CACP,aACE;CACF,MAAM;EAAC;EAAc;EAAe;EAAgB;CACrD"}
1
+ {"version":3,"file":"code.content.mjs","names":[],"sources":["../../../../src/components/IDE/code.content.ts"],"sourcesContent":["import { type Dictionary, t } from 'intlayer';\n\nconst codeContent = {\n key: 'code',\n content: {\n title: t({\n en: 'Copy code',\n es: 'Copiar código',\n pt: 'Copiar código',\n fr: 'Copier le code',\n de: 'Code kopieren',\n it: 'Copiare il codice',\n ja: 'コードをコピー',\n ko: '코드 복사',\n zh: '复制代码',\n hi: 'कोड कॉपी करें',\n 'en-GB': 'Copy code',\n ru: 'Копировать код',\n ar: 'نسخ الكود',\n tr: 'Kodu kopyala',\n pl: 'Kopiuj kod',\n id: 'Salin kode',\n vi: 'Sao chép mã',\n uk: 'Копіювати код',\n }),\n description: t({\n en: 'Copy the code to the clipboard',\n es: 'Copiar el código al portapapeles',\n pt: 'Copiar o código para a área de transferência',\n fr: 'Copier le code dans le presse-papiers',\n de: 'Kopieren Sie den Code in die Zwischenablage',\n it: 'Copiare il codice nella clipboard',\n ja: 'コードをクリップボードにコピー',\n ko: '코드를 클립보드에 복사',\n zh: '复制代码到剪贴板',\n hi: 'कोड को क्लिपबोर्ड पर कॉपी करें',\n 'en-GB': 'Copy the code to the clipboard',\n ru: 'Копировать код в буфер обмена',\n ar: 'نسخ الكود إلى الحافظة',\n tr: 'Kodu panoya kopyala',\n pl: 'Skopiuj kod do schowka',\n id: 'Salin kode ke clipboard',\n vi: 'Sao chép đoạn mã vào khay nhớ tạm (clipboard)',\n uk: 'Скопіюйте код у буфер обміну',\n }),\n },\n title: 'Code block actions',\n description:\n 'Content declaration for code block interactions, allowing users to copy code snippets to the clipboard.',\n tags: ['code block', 'copy action', 'design system'],\n} satisfies Dictionary;\n\nexport default codeContent;\n"],"mappings":";;;AAEA,MAAM,cAAc;CAClB,KAAK;CACL,SAAS;EACP,OAAO,EAAE;GACP,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,SAAS;GACT,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN,CAAC;EACD,aAAa,EAAE;GACb,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,SAAS;GACT,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN,CAAC;CACH;CACA,OAAO;CACP,aACE;CACF,MAAM;EAAC;EAAc;EAAe;CAAe;AACrD"}
@@ -1 +1 @@
1
- {"version":3,"file":"codeTransformer.mjs","names":[],"sources":["../../../../src/components/IDE/codeTransformer.ts"],"sourcesContent":["/**\n * Runtime transformer: converts TypeScript source code to ESM or CommonJS format.\n *\n * Design constraints:\n * - Regex/string based (no AST) — runs in the browser\n * - Handles patterns that actually appear in the Intlayer docs\n * - Intentionally limited: exotic TypeScript features may not transform perfectly\n */\n\nexport type TargetCodeFormat = 'esm' | 'commonjs' | 'typescript';\n\n// ── Helpers ─────────────────────────────────────────────────────────────────\n\nconst trim = (text: string) => text.trim();\n\n/**\n * Given a string like `{ A, type B, C as D }`, return the non-type named\n * members preserving aliases: `[{ name:'A', alias:undefined }, { name:'C', alias:'D' }]`.\n */\nconst parseNamedImports = (\n inner: string\n): Array<{ name: string; alias?: string; isType: boolean }> =>\n inner\n .split(',')\n .map(trim)\n .filter(Boolean)\n .map((member) => {\n const isType = /^type\\s+/.test(member);\n const clean = member.replace(/^type\\s+/, '').trim();\n const asParts = clean.split(/\\s+as\\s+/);\n return {\n name: trim(asParts[0]),\n alias: asParts[1] ? trim(asParts[1]) : undefined,\n isType,\n };\n });\n\n/** Render a named imports list back to `{ A, B as C }` style. */\nconst renderNamedImports = (\n members: Array<{ name: string; alias?: string }>\n) => {\n return `{ ${members.map((member) => (member.alias ? `${member.name} as ${member.alias}` : member.name)).join(', ')} }`;\n};\n\n// ── Import parser ────────────────────────────────────────────────────────────\n\ninterface ParsedImport {\n raw: string; // original source lines (may be multi-line)\n source: string;\n defaultImport?: string;\n named: Array<{ name: string; alias?: string; isType: boolean }>;\n isSideEffect: boolean; // `import 'mod'`\n isTypeOnly: boolean; // `import type { ... }`\n}\n\n/**\n * Parse all import statements from `code`.\n * Returns them in order together with their start/end char positions.\n */\nconst parseImports = (\n code: string\n): Array<ParsedImport & { start: number; end: number }> => {\n const result: Array<ParsedImport & { start: number; end: number }> = [];\n // Match the full import statement (possibly multi-line), stopping at the semicolon.\n // Do NOT consume trailing whitespace/newlines — those belong to the surrounding code.\n const importStatementRegex =\n /^import\\s+(type\\s+)?(?:([^\\s{,;\"'`]+)\\s*,?\\s*)?(?:\\{([^}]*)\\}\\s*,?\\s*)?(?:from\\s+[\"']([^\"']+)[\"'])?(?:\\s*[\"']([^\"']+)[\"'])?;?/gm;\n\n let importMatch: RegExpExecArray | null = importStatementRegex.exec(code);\n while (importMatch !== null) {\n const isTypeOnly = !!importMatch[1];\n const defaultPart = importMatch[2] ? trim(importMatch[2]) : undefined;\n const namedPart = importMatch[3] ?? '';\n const fromModule = importMatch[4] ?? importMatch[5] ?? '';\n\n const isSideEffect =\n !defaultPart && !namedPart && !isTypeOnly && !!fromModule;\n\n const named = namedPart ? parseNamedImports(namedPart) : [];\n\n result.push({\n raw: importMatch[0],\n start: importMatch.index,\n end: importMatch.index + importMatch[0].length,\n source: fromModule,\n defaultImport: defaultPart,\n named,\n isSideEffect,\n isTypeOnly,\n });\n importMatch = importStatementRegex.exec(code);\n }\n return result;\n};\n\n// ── Type map ─────────────────────────────────────────────────────────────────\n\n/** Build map: typeName → module path, from parsed imports. */\nconst buildTypeMap = (imports: ParsedImport[]): Map<string, string> => {\n const map = new Map<string, string>();\n for (const parsedImport of imports) {\n if (parsedImport.isTypeOnly) {\n for (const namedMember of parsedImport.named) {\n if (!map.has(namedMember.name))\n map.set(namedMember.name, parsedImport.source);\n }\n } else {\n for (const namedMember of parsedImport.named) {\n if (namedMember.isType && !map.has(namedMember.name))\n map.set(namedMember.name, parsedImport.source);\n }\n }\n }\n return map;\n};\n\n// ── Import renderers ─────────────────────────────────────────────────────────\n\nconst renderImportESM = (parsedImport: ParsedImport): string | null => {\n if (parsedImport.isTypeOnly) return null; // remove entirely\n const valueNamed = parsedImport.named.filter(\n (namedMember) => !namedMember.isType\n );\n if (\n !valueNamed.length &&\n !parsedImport.defaultImport &&\n !parsedImport.isSideEffect\n )\n return null;\n if (parsedImport.isSideEffect) return `import '${parsedImport.source}';`;\n\n if (parsedImport.defaultImport && valueNamed.length) {\n return `import ${parsedImport.defaultImport}, ${renderNamedImports(valueNamed)} from '${parsedImport.source}';`;\n }\n if (parsedImport.defaultImport)\n return `import ${parsedImport.defaultImport} from '${parsedImport.source}';`;\n return `import ${renderNamedImports(valueNamed)} from '${parsedImport.source}';`;\n};\n\nconst renderImportCJS = (parsedImport: ParsedImport): string | null => {\n if (parsedImport.isTypeOnly) return null;\n const valueNamed = parsedImport.named.filter(\n (namedMember) => !namedMember.isType\n );\n const hasDefault = !!parsedImport.defaultImport;\n const hasNamed = valueNamed.length > 0;\n\n if (parsedImport.isSideEffect) return `require('${parsedImport.source}');`;\n\n if (hasDefault && hasNamed) {\n // e.g. import express, { Router } from 'express'\n // → const { default: express, Router } = require('express') OR two lines\n const allMembers = [\n { name: 'default', alias: parsedImport.defaultImport },\n ...valueNamed,\n ];\n return `const ${renderNamedImports(allMembers)} = require('${parsedImport.source}');`;\n }\n if (hasDefault && !hasNamed) {\n return `const ${parsedImport.defaultImport} = require('${parsedImport.source}');`;\n }\n if (!hasDefault && hasNamed) {\n return `const ${renderNamedImports(valueNamed)} = require('${parsedImport.source}');`;\n }\n return null;\n};\n\n// ── Type annotation stripping ────────────────────────────────────────────────\n\n/**\n * Strip TypeScript type annotations from a code string (line by line with\n * some multi-line awareness). Returns the stripped code and a list of JSDoc\n * comments to insert before specific lines (indexed by original line number).\n */\nconst stripTypeAnnotations = (\n code: string,\n typeMap: Map<string, string>\n): { code: string; jsdocInserts: Map<number, string> } => {\n const lines = code.split('\\n');\n const jsdocInserts = new Map<number, string>();\n const out: string[] = [];\n\n for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {\n let line = lines[lineIndex];\n\n // 1. `const/let/var name: SimpleType =` — simple variable type annotation\n // Add JSDoc if the type resolves to a known import module.\n const varTypeMatch = line.match(\n /^(\\s*(?:export\\s+)?(?:const|let|var)\\s+\\w+)\\s*:\\s*([A-Z]\\w*)\\s*=/\n );\n if (varTypeMatch) {\n const typeName = varTypeMatch[2];\n const modulePath = typeMap.get(typeName);\n if (modulePath) {\n jsdocInserts.set(\n out.length,\n `/** @type {import('${modulePath}').${typeName}} */`\n );\n }\n line = line.replace(\n /^(\\s*(?:export\\s+)?(?:const|let|var)\\s+\\w+)\\s*:\\s*[A-Z][\\w<>, ]*?\\s*=/,\n '$1 ='\n );\n }\n\n // 2. `const/let/var name: FC<Props> =` — generic type annotation (no JSDoc)\n line = line.replace(\n /^(\\s*(?:export\\s+)?(?:const|let|var)\\s+\\w+)\\s*:\\s*\\w+<[^>]*>\\s*=/,\n '$1 ='\n );\n\n // 3. Destructured parameter with type: `}: TypeName):` → `}):`\n // Also handles return type: `): ReturnType =>` → `) =>`\n line = line.replace(/\\}\\s*:\\s*\\w[\\w<>, .]*\\s*\\)/, '})');\n\n // 4. Return type after `)`: `): Promise<X> =>` or `): Type {`\n line = line.replace(/\\)\\s*:\\s*\\w[\\w<>, .]*\\s*(=>|\\{)/, ') $1');\n\n // 5. `satisfies TypeName` at end of expression\n line = line.replace(/\\s+satisfies\\s+\\w[\\w<>, .]*\\s*;/, ';');\n\n // 6. `as TypeName` type casts (excluding `as const`)\n line = line.replace(/\\s+as\\s+(?!const\\b)\\w[\\w<>, .]*/, '');\n\n // 7. Generic type parameter in arrow function: `<T>(` at start of arrow fn\n // e.g. `const t = <T>(content: IConfigLocales<T>) =>`\n line = line.replace(/(<\\w+>)\\(/, '(');\n\n // 8. Generic calls: `fn<Type>(` → `fn(`\n // Only strip when angle brackets look like type params, not JSX\n line = line.replace(/(\\w+)<[A-Z]\\w*(?:,\\s*[A-Z]\\w*)*>\\(/g, '$1(');\n\n // 9. Remove typed function parameters: `(param: Type)`, `param: Type,`\n // Simple single-param-with-type: `: TypeName)` → `)`\n // Avoid breaking object spread or return annotation already handled\n line = line.replace(/(\\w)\\s*:\\s*[A-Z]\\w*(\\))/g, '$1$2');\n\n out.push(line);\n }\n\n // Insert JSDoc lines (reverse order so indices stay valid)\n const insertPositions = [...jsdocInserts.entries()].sort(\n (first, second) => second[0] - first[0]\n );\n for (const [pos, jsdoc] of insertPositions) {\n // Preserve indent of the following line\n const indent = (out[pos] ?? '').match(/^(\\s*)/)?.[1] ?? '';\n out.splice(pos, 0, indent + jsdoc);\n }\n\n return { code: out.join('\\n'), jsdocInserts };\n};\n\n// ── Export processing (CJS) ──────────────────────────────────────────────────\n\ninterface CollectedExport {\n localName: string;\n exportedName: string;\n}\n\nconst processExportsCJS = (code: string): string => {\n const lines = code.split('\\n');\n const collected: CollectedExport[] = [];\n let defaultExport: string | null = null;\n const requireLines: string[] = []; // for re-exports\n const out: string[] = [];\n\n for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {\n const line = lines[lineIndex];\n\n // `export default X;` or `export default X`\n const defMatch = line.match(/^(\\s*)export\\s+default\\s+(.+?);?\\s*$/);\n if (defMatch) {\n defaultExport = trim(defMatch[2]);\n continue; // skip line, emit module.exports later\n }\n\n // `export const/let/var name = ...`\n const exportConstMatch = line.match(\n /^(\\s*)export\\s+(const|let|var)\\s+(\\w+)/\n );\n if (exportConstMatch) {\n const name = exportConstMatch[3];\n collected.push({ localName: name, exportedName: name });\n out.push(line.replace(/^(\\s*)export\\s+/, '$1'));\n continue;\n }\n\n // `export function name(...)` or `export async function name(...)`\n const exportFnMatch = line.match(\n /^(\\s*)export\\s+(?:async\\s+)?function\\s+(\\w+)/\n );\n if (exportFnMatch) {\n const name = exportFnMatch[2];\n collected.push({ localName: name, exportedName: name });\n out.push(line.replace(/^(\\s*)export\\s+/, '$1'));\n continue;\n }\n\n // `export { A, B as C } from 'mod'` — re-export\n const reexportFromMatch = line.match(\n /^(\\s*)export\\s+\\{([^}]+)\\}\\s+from\\s+[\"']([^\"']+)[\"'];?\\s*$/\n );\n if (reexportFromMatch) {\n const members = parseNamedImports(reexportFromMatch[2]);\n const modulePath = reexportFromMatch[3];\n // Only value members (no types)\n const valueMembers = members.filter((namedMember) => !namedMember.isType);\n if (valueMembers.length) {\n // require the original names\n const origNames = valueMembers.map((namedMember) => namedMember.name);\n requireLines.push(\n `const ${renderNamedImports(origNames.map((name) => ({ name })))} = require('${modulePath}');`\n );\n for (const namedMember of valueMembers) {\n collected.push({\n localName: namedMember.name,\n exportedName: namedMember.alias ?? namedMember.name,\n });\n }\n }\n continue;\n }\n\n // `export { A, B as C }` — named re-export (same module)\n const namedExportMatch = line.match(/^(\\s*)export\\s+\\{([^}]+)\\};?\\s*$/);\n if (namedExportMatch) {\n const members = parseNamedImports(namedExportMatch[2]).filter(\n (namedMember) => !namedMember.isType\n );\n for (const namedMember of members) {\n collected.push({\n localName: namedMember.name,\n exportedName: namedMember.alias ?? namedMember.name,\n });\n }\n continue;\n }\n\n out.push(line);\n }\n\n // Prepend any require lines for re-exports\n const finalLines = requireLines.length ? [...requireLines, '', ...out] : out;\n\n // Append module.exports\n if (defaultExport !== null && collected.length === 0) {\n finalLines.push(`module.exports = ${defaultExport};`);\n } else if (defaultExport !== null && collected.length > 0) {\n const parts = collected.map((exportEntry) =>\n exportEntry.localName === exportEntry.exportedName\n ? exportEntry.localName\n : `${exportEntry.exportedName}: ${exportEntry.localName}`\n );\n finalLines.push(\n `module.exports = { default: ${defaultExport}, ${parts.join(', ')} };`\n );\n } else if (collected.length > 0) {\n const parts = collected.map((exportEntry) =>\n exportEntry.localName === exportEntry.exportedName\n ? exportEntry.localName\n : `${exportEntry.exportedName}: ${exportEntry.localName}`\n );\n finalLines.push(`module.exports = { ${parts.join(', ')} };`);\n }\n\n return finalLines.join('\\n');\n};\n\n// ── Main transform entry point ────────────────────────────────────────────────\n\nexport const transformCode = (\n code: string,\n target: TargetCodeFormat\n): string => {\n // 1. Parse all imports\n const imports = parseImports(code);\n const typeMap = buildTypeMap(imports);\n\n // 2. Replace import statements in the code\n let result = code;\n // Process in reverse order so string offsets stay valid\n const sorted = [...imports].sort(\n (firstImport, secondImport) => secondImport.start - firstImport.start\n );\n for (const parsedImport of sorted) {\n const rendered =\n target === 'esm'\n ? renderImportESM(parsedImport)\n : renderImportCJS(parsedImport);\n // rendered === null means remove the import\n const replacement = rendered ?? '';\n result =\n result.slice(0, parsedImport.start) +\n replacement +\n result.slice(parsedImport.end);\n }\n\n // 3. Collapse consecutive blank lines that may result from removed imports\n result = result.replace(/\\n{3,}/g, '\\n\\n');\n\n // 4. Strip TypeScript type annotations\n const stripped = stripTypeAnnotations(result, typeMap);\n result = stripped.code;\n\n // 5. Process exports (CJS only)\n if (target === 'commonjs') {\n result = processExportsCJS(result);\n }\n\n // 6. Final cleanup: collapse any triple+ blank lines introduced by export processing,\n // then trim leading/trailing blank lines.\n result = result.replace(/\\n{3,}/g, '\\n\\n');\n result = result.replace(/^\\n+/, '').replace(/\\n+$/, '');\n\n return result;\n};\n\n/**\n * Derive the file name for a transformed format.\n * `next.config.ts` → `next.config.mjs` (ESM) / `next.config.cjs` (CJS)\n * `layout.tsx` → `layout.jsx` (ESM or CJS — JSX always stays .jsx)\n */\nexport const deriveFileName = (\n fileName: string,\n target: TargetCodeFormat\n): string => {\n if (target === 'esm') {\n // TSX → .jsx (standard ESM JSX), TS → .mjs (standard ESM module)\n return fileName.replace(/\\.tsx$/, '.jsx').replace(/\\.ts$/, '.mjs');\n }\n // CJS: TSX → .jsx (JSX stays .jsx), TS → .cjs\n return fileName.replace(/\\.tsx$/, '.jsx').replace(/\\.ts$/, '.cjs');\n};\n\n/**\n * Derive the syntax-highlighting language for a transformed format.\n * `typescript` → `javascript`; `tsx` → `jsx`\n */\nexport const deriveLanguage = (\n language: string,\n target: TargetCodeFormat\n): string => {\n if (target === 'typescript') return language;\n return language === 'tsx'\n ? 'jsx'\n : language === 'typescript'\n ? 'javascript'\n : language;\n};\n"],"mappings":";AAaA,MAAM,QAAQ,SAAiB,KAAK,MAAM;;;;;AAM1C,MAAM,qBACJ,UAEA,MACG,MAAM,IAAI,CACV,IAAI,KAAK,CACT,OAAO,QAAQ,CACf,KAAK,WAAW;CACf,MAAM,SAAS,WAAW,KAAK,OAAO;CAEtC,MAAM,UADQ,OAAO,QAAQ,YAAY,GAAG,CAAC,MACxB,CAAC,MAAM,WAAW;CACvC,OAAO;EACL,MAAM,KAAK,QAAQ,GAAG;EACtB,OAAO,QAAQ,KAAK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AAO;;;;;;AAOpE,MAAa,kBACX,UACA,WACW;CACX,IAAI,WAAW,cAAc,OAAO;CACpC,OAAO,aAAa,QAChB,QACA,aAAa,eACX,eACA"}
1
+ {"version":3,"file":"codeTransformer.mjs","names":[],"sources":["../../../../src/components/IDE/codeTransformer.ts"],"sourcesContent":["/**\n * Runtime transformer: converts TypeScript source code to ESM or CommonJS format.\n *\n * Design constraints:\n * - Regex/string based (no AST) — runs in the browser\n * - Handles patterns that actually appear in the Intlayer docs\n * - Intentionally limited: exotic TypeScript features may not transform perfectly\n */\n\nexport type TargetCodeFormat = 'esm' | 'commonjs' | 'typescript';\n\n// ── Helpers ─────────────────────────────────────────────────────────────────\n\nconst trim = (text: string) => text.trim();\n\n/**\n * Given a string like `{ A, type B, C as D }`, return the non-type named\n * members preserving aliases: `[{ name:'A', alias:undefined }, { name:'C', alias:'D' }]`.\n */\nconst parseNamedImports = (\n inner: string\n): Array<{ name: string; alias?: string; isType: boolean }> =>\n inner\n .split(',')\n .map(trim)\n .filter(Boolean)\n .map((member) => {\n const isType = /^type\\s+/.test(member);\n const clean = member.replace(/^type\\s+/, '').trim();\n const asParts = clean.split(/\\s+as\\s+/);\n return {\n name: trim(asParts[0]),\n alias: asParts[1] ? trim(asParts[1]) : undefined,\n isType,\n };\n });\n\n/** Render a named imports list back to `{ A, B as C }` style. */\nconst renderNamedImports = (\n members: Array<{ name: string; alias?: string }>\n) => {\n return `{ ${members.map((member) => (member.alias ? `${member.name} as ${member.alias}` : member.name)).join(', ')} }`;\n};\n\n// ── Import parser ────────────────────────────────────────────────────────────\n\ninterface ParsedImport {\n raw: string; // original source lines (may be multi-line)\n source: string;\n defaultImport?: string;\n named: Array<{ name: string; alias?: string; isType: boolean }>;\n isSideEffect: boolean; // `import 'mod'`\n isTypeOnly: boolean; // `import type { ... }`\n}\n\n/**\n * Parse all import statements from `code`.\n * Returns them in order together with their start/end char positions.\n */\nconst parseImports = (\n code: string\n): Array<ParsedImport & { start: number; end: number }> => {\n const result: Array<ParsedImport & { start: number; end: number }> = [];\n // Match the full import statement (possibly multi-line), stopping at the semicolon.\n // Do NOT consume trailing whitespace/newlines — those belong to the surrounding code.\n const importStatementRegex =\n /^import\\s+(type\\s+)?(?:([^\\s{,;\"'`]+)\\s*,?\\s*)?(?:\\{([^}]*)\\}\\s*,?\\s*)?(?:from\\s+[\"']([^\"']+)[\"'])?(?:\\s*[\"']([^\"']+)[\"'])?;?/gm;\n\n let importMatch: RegExpExecArray | null = importStatementRegex.exec(code);\n while (importMatch !== null) {\n const isTypeOnly = !!importMatch[1];\n const defaultPart = importMatch[2] ? trim(importMatch[2]) : undefined;\n const namedPart = importMatch[3] ?? '';\n const fromModule = importMatch[4] ?? importMatch[5] ?? '';\n\n const isSideEffect =\n !defaultPart && !namedPart && !isTypeOnly && !!fromModule;\n\n const named = namedPart ? parseNamedImports(namedPart) : [];\n\n result.push({\n raw: importMatch[0],\n start: importMatch.index,\n end: importMatch.index + importMatch[0].length,\n source: fromModule,\n defaultImport: defaultPart,\n named,\n isSideEffect,\n isTypeOnly,\n });\n importMatch = importStatementRegex.exec(code);\n }\n return result;\n};\n\n// ── Type map ─────────────────────────────────────────────────────────────────\n\n/** Build map: typeName → module path, from parsed imports. */\nconst buildTypeMap = (imports: ParsedImport[]): Map<string, string> => {\n const map = new Map<string, string>();\n for (const parsedImport of imports) {\n if (parsedImport.isTypeOnly) {\n for (const namedMember of parsedImport.named) {\n if (!map.has(namedMember.name))\n map.set(namedMember.name, parsedImport.source);\n }\n } else {\n for (const namedMember of parsedImport.named) {\n if (namedMember.isType && !map.has(namedMember.name))\n map.set(namedMember.name, parsedImport.source);\n }\n }\n }\n return map;\n};\n\n// ── Import renderers ─────────────────────────────────────────────────────────\n\nconst renderImportESM = (parsedImport: ParsedImport): string | null => {\n if (parsedImport.isTypeOnly) return null; // remove entirely\n const valueNamed = parsedImport.named.filter(\n (namedMember) => !namedMember.isType\n );\n if (\n !valueNamed.length &&\n !parsedImport.defaultImport &&\n !parsedImport.isSideEffect\n )\n return null;\n if (parsedImport.isSideEffect) return `import '${parsedImport.source}';`;\n\n if (parsedImport.defaultImport && valueNamed.length) {\n return `import ${parsedImport.defaultImport}, ${renderNamedImports(valueNamed)} from '${parsedImport.source}';`;\n }\n if (parsedImport.defaultImport)\n return `import ${parsedImport.defaultImport} from '${parsedImport.source}';`;\n return `import ${renderNamedImports(valueNamed)} from '${parsedImport.source}';`;\n};\n\nconst renderImportCJS = (parsedImport: ParsedImport): string | null => {\n if (parsedImport.isTypeOnly) return null;\n const valueNamed = parsedImport.named.filter(\n (namedMember) => !namedMember.isType\n );\n const hasDefault = !!parsedImport.defaultImport;\n const hasNamed = valueNamed.length > 0;\n\n if (parsedImport.isSideEffect) return `require('${parsedImport.source}');`;\n\n if (hasDefault && hasNamed) {\n // e.g. import express, { Router } from 'express'\n // → const { default: express, Router } = require('express') OR two lines\n const allMembers = [\n { name: 'default', alias: parsedImport.defaultImport },\n ...valueNamed,\n ];\n return `const ${renderNamedImports(allMembers)} = require('${parsedImport.source}');`;\n }\n if (hasDefault && !hasNamed) {\n return `const ${parsedImport.defaultImport} = require('${parsedImport.source}');`;\n }\n if (!hasDefault && hasNamed) {\n return `const ${renderNamedImports(valueNamed)} = require('${parsedImport.source}');`;\n }\n return null;\n};\n\n// ── Type annotation stripping ────────────────────────────────────────────────\n\n/**\n * Strip TypeScript type annotations from a code string (line by line with\n * some multi-line awareness). Returns the stripped code and a list of JSDoc\n * comments to insert before specific lines (indexed by original line number).\n */\nconst stripTypeAnnotations = (\n code: string,\n typeMap: Map<string, string>\n): { code: string; jsdocInserts: Map<number, string> } => {\n const lines = code.split('\\n');\n const jsdocInserts = new Map<number, string>();\n const out: string[] = [];\n\n for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {\n let line = lines[lineIndex];\n\n // 1. `const/let/var name: SimpleType =` — simple variable type annotation\n // Add JSDoc if the type resolves to a known import module.\n const varTypeMatch = line.match(\n /^(\\s*(?:export\\s+)?(?:const|let|var)\\s+\\w+)\\s*:\\s*([A-Z]\\w*)\\s*=/\n );\n if (varTypeMatch) {\n const typeName = varTypeMatch[2];\n const modulePath = typeMap.get(typeName);\n if (modulePath) {\n jsdocInserts.set(\n out.length,\n `/** @type {import('${modulePath}').${typeName}} */`\n );\n }\n line = line.replace(\n /^(\\s*(?:export\\s+)?(?:const|let|var)\\s+\\w+)\\s*:\\s*[A-Z][\\w<>, ]*?\\s*=/,\n '$1 ='\n );\n }\n\n // 2. `const/let/var name: FC<Props> =` — generic type annotation (no JSDoc)\n line = line.replace(\n /^(\\s*(?:export\\s+)?(?:const|let|var)\\s+\\w+)\\s*:\\s*\\w+<[^>]*>\\s*=/,\n '$1 ='\n );\n\n // 3. Destructured parameter with type: `}: TypeName):` → `}):`\n // Also handles return type: `): ReturnType =>` → `) =>`\n line = line.replace(/\\}\\s*:\\s*\\w[\\w<>, .]*\\s*\\)/, '})');\n\n // 4. Return type after `)`: `): Promise<X> =>` or `): Type {`\n line = line.replace(/\\)\\s*:\\s*\\w[\\w<>, .]*\\s*(=>|\\{)/, ') $1');\n\n // 5. `satisfies TypeName` at end of expression\n line = line.replace(/\\s+satisfies\\s+\\w[\\w<>, .]*\\s*;/, ';');\n\n // 6. `as TypeName` type casts (excluding `as const`)\n line = line.replace(/\\s+as\\s+(?!const\\b)\\w[\\w<>, .]*/, '');\n\n // 7. Generic type parameter in arrow function: `<T>(` at start of arrow fn\n // e.g. `const t = <T>(content: IConfigLocales<T>) =>`\n line = line.replace(/(<\\w+>)\\(/, '(');\n\n // 8. Generic calls: `fn<Type>(` → `fn(`\n // Only strip when angle brackets look like type params, not JSX\n line = line.replace(/(\\w+)<[A-Z]\\w*(?:,\\s*[A-Z]\\w*)*>\\(/g, '$1(');\n\n // 9. Remove typed function parameters: `(param: Type)`, `param: Type,`\n // Simple single-param-with-type: `: TypeName)` → `)`\n // Avoid breaking object spread or return annotation already handled\n line = line.replace(/(\\w)\\s*:\\s*[A-Z]\\w*(\\))/g, '$1$2');\n\n out.push(line);\n }\n\n // Insert JSDoc lines (reverse order so indices stay valid)\n const insertPositions = [...jsdocInserts.entries()].sort(\n (first, second) => second[0] - first[0]\n );\n for (const [pos, jsdoc] of insertPositions) {\n // Preserve indent of the following line\n const indent = (out[pos] ?? '').match(/^(\\s*)/)?.[1] ?? '';\n out.splice(pos, 0, indent + jsdoc);\n }\n\n return { code: out.join('\\n'), jsdocInserts };\n};\n\n// ── Export processing (CJS) ──────────────────────────────────────────────────\n\ninterface CollectedExport {\n localName: string;\n exportedName: string;\n}\n\nconst processExportsCJS = (code: string): string => {\n const lines = code.split('\\n');\n const collected: CollectedExport[] = [];\n let defaultExport: string | null = null;\n const requireLines: string[] = []; // for re-exports\n const out: string[] = [];\n\n for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {\n const line = lines[lineIndex];\n\n // `export default X;` or `export default X`\n const defMatch = line.match(/^(\\s*)export\\s+default\\s+(.+?);?\\s*$/);\n if (defMatch) {\n defaultExport = trim(defMatch[2]);\n continue; // skip line, emit module.exports later\n }\n\n // `export const/let/var name = ...`\n const exportConstMatch = line.match(\n /^(\\s*)export\\s+(const|let|var)\\s+(\\w+)/\n );\n if (exportConstMatch) {\n const name = exportConstMatch[3];\n collected.push({ localName: name, exportedName: name });\n out.push(line.replace(/^(\\s*)export\\s+/, '$1'));\n continue;\n }\n\n // `export function name(...)` or `export async function name(...)`\n const exportFnMatch = line.match(\n /^(\\s*)export\\s+(?:async\\s+)?function\\s+(\\w+)/\n );\n if (exportFnMatch) {\n const name = exportFnMatch[2];\n collected.push({ localName: name, exportedName: name });\n out.push(line.replace(/^(\\s*)export\\s+/, '$1'));\n continue;\n }\n\n // `export { A, B as C } from 'mod'` — re-export\n const reexportFromMatch = line.match(\n /^(\\s*)export\\s+\\{([^}]+)\\}\\s+from\\s+[\"']([^\"']+)[\"'];?\\s*$/\n );\n if (reexportFromMatch) {\n const members = parseNamedImports(reexportFromMatch[2]);\n const modulePath = reexportFromMatch[3];\n // Only value members (no types)\n const valueMembers = members.filter((namedMember) => !namedMember.isType);\n if (valueMembers.length) {\n // require the original names\n const origNames = valueMembers.map((namedMember) => namedMember.name);\n requireLines.push(\n `const ${renderNamedImports(origNames.map((name) => ({ name })))} = require('${modulePath}');`\n );\n for (const namedMember of valueMembers) {\n collected.push({\n localName: namedMember.name,\n exportedName: namedMember.alias ?? namedMember.name,\n });\n }\n }\n continue;\n }\n\n // `export { A, B as C }` — named re-export (same module)\n const namedExportMatch = line.match(/^(\\s*)export\\s+\\{([^}]+)\\};?\\s*$/);\n if (namedExportMatch) {\n const members = parseNamedImports(namedExportMatch[2]).filter(\n (namedMember) => !namedMember.isType\n );\n for (const namedMember of members) {\n collected.push({\n localName: namedMember.name,\n exportedName: namedMember.alias ?? namedMember.name,\n });\n }\n continue;\n }\n\n out.push(line);\n }\n\n // Prepend any require lines for re-exports\n const finalLines = requireLines.length ? [...requireLines, '', ...out] : out;\n\n // Append module.exports\n if (defaultExport !== null && collected.length === 0) {\n finalLines.push(`module.exports = ${defaultExport};`);\n } else if (defaultExport !== null && collected.length > 0) {\n const parts = collected.map((exportEntry) =>\n exportEntry.localName === exportEntry.exportedName\n ? exportEntry.localName\n : `${exportEntry.exportedName}: ${exportEntry.localName}`\n );\n finalLines.push(\n `module.exports = { default: ${defaultExport}, ${parts.join(', ')} };`\n );\n } else if (collected.length > 0) {\n const parts = collected.map((exportEntry) =>\n exportEntry.localName === exportEntry.exportedName\n ? exportEntry.localName\n : `${exportEntry.exportedName}: ${exportEntry.localName}`\n );\n finalLines.push(`module.exports = { ${parts.join(', ')} };`);\n }\n\n return finalLines.join('\\n');\n};\n\n// ── Main transform entry point ────────────────────────────────────────────────\n\nexport const transformCode = (\n code: string,\n target: TargetCodeFormat\n): string => {\n // 1. Parse all imports\n const imports = parseImports(code);\n const typeMap = buildTypeMap(imports);\n\n // 2. Replace import statements in the code\n let result = code;\n // Process in reverse order so string offsets stay valid\n const sorted = [...imports].sort(\n (firstImport, secondImport) => secondImport.start - firstImport.start\n );\n for (const parsedImport of sorted) {\n const rendered =\n target === 'esm'\n ? renderImportESM(parsedImport)\n : renderImportCJS(parsedImport);\n // rendered === null means remove the import\n const replacement = rendered ?? '';\n result =\n result.slice(0, parsedImport.start) +\n replacement +\n result.slice(parsedImport.end);\n }\n\n // 3. Collapse consecutive blank lines that may result from removed imports\n result = result.replace(/\\n{3,}/g, '\\n\\n');\n\n // 4. Strip TypeScript type annotations\n const stripped = stripTypeAnnotations(result, typeMap);\n result = stripped.code;\n\n // 5. Process exports (CJS only)\n if (target === 'commonjs') {\n result = processExportsCJS(result);\n }\n\n // 6. Final cleanup: collapse any triple+ blank lines introduced by export processing,\n // then trim leading/trailing blank lines.\n result = result.replace(/\\n{3,}/g, '\\n\\n');\n result = result.replace(/^\\n+/, '').replace(/\\n+$/, '');\n\n return result;\n};\n\n/**\n * Derive the file name for a transformed format.\n * `next.config.ts` → `next.config.mjs` (ESM) / `next.config.cjs` (CJS)\n * `layout.tsx` → `layout.jsx` (ESM or CJS — JSX always stays .jsx)\n */\nexport const deriveFileName = (\n fileName: string,\n target: TargetCodeFormat\n): string => {\n if (target === 'esm') {\n // TSX → .jsx (standard ESM JSX), TS → .mjs (standard ESM module)\n return fileName.replace(/\\.tsx$/, '.jsx').replace(/\\.ts$/, '.mjs');\n }\n // CJS: TSX → .jsx (JSX stays .jsx), TS → .cjs\n return fileName.replace(/\\.tsx$/, '.jsx').replace(/\\.ts$/, '.cjs');\n};\n\n/**\n * Derive the syntax-highlighting language for a transformed format.\n * `typescript` → `javascript`; `tsx` → `jsx`\n */\nexport const deriveLanguage = (\n language: string,\n target: TargetCodeFormat\n): string => {\n if (target === 'typescript') return language;\n return language === 'tsx'\n ? 'jsx'\n : language === 'typescript'\n ? 'javascript'\n : language;\n};\n"],"mappings":";AAaA,MAAM,QAAQ,SAAiB,KAAK,KAAK;;;;;AAMzC,MAAM,qBACJ,UAEA,MACG,MAAM,GAAG,EACT,IAAI,IAAI,EACR,OAAO,OA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C,SAAS,OAAO,QAAQ,WAAW,MAAM;CACzC,SAAS,OAAO,QAAQ,QAAQ,EAAE,EAAE,QAAQ,QAAQ,EAAE;CAEtD,OAAO;AACT;;;;;;AAOA,MAAa,kBACX,UACA,WACW;CACX,IAAI,WAAW,OAEb,OAAO,SAAS,QAAQ,UAAU,MAAM,EAAE,QAAQ,SAAS,MAAM;CAGnE,OAAO,SAAS,QAAQ,UAAU,MAAM,EAAE,QAAQ,SAAS,MAAM;AACnE;;;;;AAMA,MAAa,kBACX,UACA,WACW;CACX,IAAI,WAAW,cAAc,OAAO;CACpC,OAAO,aAAa,QAChB,QACA,aAAa,eACX,eACA;AACR"}
@@ -1 +1 @@
1
- {"version":3,"file":"copyCode.content.mjs","names":[],"sources":["../../../../src/components/IDE/copyCode.content.ts"],"sourcesContent":["import { type Dictionary, t } from 'intlayer';\n\nconst copyContentContent = {\n key: 'code',\n content: {\n title: t({\n en: 'Copy code',\n es: 'Copiar código',\n pt: 'Copiar código',\n fr: 'Copier le code',\n de: 'Code kopieren',\n it: 'Copiare il codice',\n ja: 'コードをコピー',\n ko: '코드 복사',\n zh: '复制代码',\n hi: 'कोड कॉपी करें',\n 'en-GB': 'Copy code',\n ru: 'Копировать код',\n ar: 'نسخ الكود',\n tr: 'Kodu kopyala',\n pl: 'Kopiuj kod',\n id: 'Salin kode',\n vi: 'Sao chép mã',\n uk: 'Копіювати код',\n }),\n description: t({\n en: 'Copy the code to the clipboard',\n es: 'Copiar el código al portapapeles',\n pt: 'Copiar o código para a área de transferência',\n fr: 'Copier le code dans le presse-papiers',\n de: 'Kopieren Sie den Code in die Zwischenablage',\n it: 'Copiare il codice nella clipboard',\n ja: 'コードをクリップボードにコピー',\n ko: '코드를 클립보드에 복사',\n zh: '复制代码到剪贴板',\n hi: 'कोड को क्लिपबोर्ड पर कॉपी करें',\n 'en-GB': 'Copy the code to the clipboard',\n ru: 'Копировать код в буфер обмена',\n ar: 'نسخ الكود إلى الحافظة',\n tr: 'Kodu panoya kopyala',\n pl: 'Skopiuj kod do schowka',\n id: 'Salin kode ke clipboard',\n vi: 'Sao chép mã vào clipboard',\n uk: 'Скопіюйте код у буфер обміну',\n }),\n },\n title: 'Copy code button',\n description:\n 'Content declaration for the copy code button. Provides the title and tooltip description used to allow users to copy code snippets to the clipboard.',\n tags: ['component', 'code snippet', 'copy functionality'],\n} satisfies Dictionary;\n\nexport default copyContentContent;\n"],"mappings":";;;AAEA,MAAM,qBAAqB;CACzB,KAAK;CACL,SAAS;EACP,OAAO,EAAE;GACP,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,SAAS;GACT,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL,CAAC;EACF,aAAa,EAAE;GACb,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,SAAS;GACT,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL,CAAC;EACH;CACD,OAAO;CACP,aACE;CACF,MAAM;EAAC;EAAa;EAAgB;EAAqB;CAC1D"}
1
+ {"version":3,"file":"copyCode.content.mjs","names":[],"sources":["../../../../src/components/IDE/copyCode.content.ts"],"sourcesContent":["import { type Dictionary, t } from 'intlayer';\n\nconst copyContentContent = {\n key: 'code',\n content: {\n title: t({\n en: 'Copy code',\n es: 'Copiar código',\n pt: 'Copiar código',\n fr: 'Copier le code',\n de: 'Code kopieren',\n it: 'Copiare il codice',\n ja: 'コードをコピー',\n ko: '코드 복사',\n zh: '复制代码',\n hi: 'कोड कॉपी करें',\n 'en-GB': 'Copy code',\n ru: 'Копировать код',\n ar: 'نسخ الكود',\n tr: 'Kodu kopyala',\n pl: 'Kopiuj kod',\n id: 'Salin kode',\n vi: 'Sao chép mã',\n uk: 'Копіювати код',\n }),\n description: t({\n en: 'Copy the code to the clipboard',\n es: 'Copiar el código al portapapeles',\n pt: 'Copiar o código para a área de transferência',\n fr: 'Copier le code dans le presse-papiers',\n de: 'Kopieren Sie den Code in die Zwischenablage',\n it: 'Copiare il codice nella clipboard',\n ja: 'コードをクリップボードにコピー',\n ko: '코드를 클립보드에 복사',\n zh: '复制代码到剪贴板',\n hi: 'कोड को क्लिपबोर्ड पर कॉपी करें',\n 'en-GB': 'Copy the code to the clipboard',\n ru: 'Копировать код в буфер обмена',\n ar: 'نسخ الكود إلى الحافظة',\n tr: 'Kodu panoya kopyala',\n pl: 'Skopiuj kod do schowka',\n id: 'Salin kode ke clipboard',\n vi: 'Sao chép mã vào clipboard',\n uk: 'Скопіюйте код у буфер обміну',\n }),\n },\n title: 'Copy code button',\n description:\n 'Content declaration for the copy code button. Provides the title and tooltip description used to allow users to copy code snippets to the clipboard.',\n tags: ['component', 'code snippet', 'copy functionality'],\n} satisfies Dictionary;\n\nexport default copyContentContent;\n"],"mappings":";;;AAEA,MAAM,qBAAqB;CACzB,KAAK;CACL,SAAS;EACP,OAAO,EAAE;GACP,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,SAAS;GACT,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN,CAAC;EACD,aAAa,EAAE;GACb,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,SAAS;GACT,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN,CAAC;CACH;CACA,OAAO;CACP,aACE;CACF,MAAM;EAAC;EAAa;EAAgB;CAAoB;AAC1D"}
@@ -1 +1 @@
1
- {"version":3,"file":"createFileTree.mjs","names":[],"sources":["../../../../src/components/IDE/createFileTree.ts"],"sourcesContent":["export type FilePath = {\n path: string;\n subPath?: FilePath[];\n isFile: boolean;\n};\n\nexport const createFileTree = (paths: string[]): FilePath[] => {\n const root: FilePath = { path: '', subPath: [], isFile: false };\n\n paths.forEach((path) => {\n const parts = path.split('/').filter((part) => part !== ''); // Remove empty strings due to leading slash\n let current = root;\n\n for (let i = 0; i < parts.length; i++) {\n const part = parts[i];\n const isFile = i === parts.length - 1; // Last part of the path is a file\n\n if (!current.subPath) {\n current.subPath = [];\n }\n\n let next = current.subPath.find((sub) => sub.path === part);\n\n if (!next) {\n next = { path: part, isFile, subPath: isFile ? undefined : [] };\n current.subPath.push(next);\n }\n\n current = next;\n }\n });\n\n return root.subPath ?? [];\n};\n"],"mappings":";AAMA,MAAa,kBAAkB,UAAgC;CAC7D,MAAM,OAAiB;EAAE,MAAM;EAAI,SAAS,EAAE;EAAE,QAAQ;EAAO;CAE/D,MAAM,SAAS,SAAS;EACtB,MAAM,QAAQ,KAAK,MAAM,IAAI,CAAC,QAAQ,SAAS,SAAS,GAAG;EAC3D,IAAI,UAAU;EAEd,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;GACrC,MAAM,OAAO,MAAM;GACnB,MAAM,SAAS,MAAM,MAAM,SAAS;GAEpC,IAAI,CAAC,QAAQ,SACX,QAAQ,UAAU,EAAE;GAGtB,IAAI,OAAO,QAAQ,QAAQ,MAAM,QAAQ,IAAI,SAAS,KAAK;GAE3D,IAAI,CAAC,MAAM;IACT,OAAO;KAAE,MAAM;KAAM;KAAQ,SAAS,SAAS,SAAY,EAAE;KAAE;IAC/D,QAAQ,QAAQ,KAAK,KAAK;;GAG5B,UAAU;;GAEZ;CAEF,OAAO,KAAK,WAAW,EAAE"}
1
+ {"version":3,"file":"createFileTree.mjs","names":[],"sources":["../../../../src/components/IDE/createFileTree.ts"],"sourcesContent":["export type FilePath = {\n path: string;\n subPath?: FilePath[];\n isFile: boolean;\n};\n\nexport const createFileTree = (paths: string[]): FilePath[] => {\n const root: FilePath = { path: '', subPath: [], isFile: false };\n\n paths.forEach((path) => {\n const parts = path.split('/').filter((part) => part !== ''); // Remove empty strings due to leading slash\n let current = root;\n\n for (let i = 0; i < parts.length; i++) {\n const part = parts[i];\n const isFile = i === parts.length - 1; // Last part of the path is a file\n\n if (!current.subPath) {\n current.subPath = [];\n }\n\n let next = current.subPath.find((sub) => sub.path === part);\n\n if (!next) {\n next = { path: part, isFile, subPath: isFile ? undefined : [] };\n current.subPath.push(next);\n }\n\n current = next;\n }\n });\n\n return root.subPath ?? [];\n};\n"],"mappings":";AAMA,MAAa,kBAAkB,UAAgC;CAC7D,MAAM,OAAiB;EAAE,MAAM;EAAI,SAAS,CAAC;EAAG,QAAQ;CAAM;CAE9D,MAAM,SAAS,SAAS;EACtB,MAAM,QAAQ,KAAK,MAAM,GAAG,EAAE,QAAQ,SAAS,SAAS,EAAE;EAC1D,IAAI,UAAU;EAEd,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;GACrC,MAAM,OAAO,MAAM;GACnB,MAAM,SAAS,MAAM,MAAM,SAAS;GAEpC,IAAI,CAAC,QAAQ,SACX,QAAQ,UAAU,CAAC;GAGrB,IAAI,OAAO,QAAQ,QAAQ,MAAM,QAAQ,IAAI,SAAS,IAAI;GAE1D,IAAI,CAAC,MAAM;IACT,OAAO;KAAE,MAAM;KAAM;KAAQ,SAAS,SAAS,SAAY,CAAC;IAAE;IAC9D,QAAQ,QAAQ,KAAK,IAAI;GAC3B;GAEA,UAAU;EACZ;CACF,CAAC;CAED,OAAO,KAAK,WAAW,CAAC;AAC1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"selectors.content.mjs","names":[],"sources":["../../../../src/components/IDE/selectors.content.ts"],"sourcesContent":["import { type Dictionary, t } from 'intlayer';\n\nconst selectorsContent = {\n key: 'code-selectors',\n content: {\n packageManager: {\n placeholder: t({\n en: 'Package Manager',\n es: 'Gestor de paquetes',\n pt: 'Gerenciador de pacotes',\n fr: 'Gestionnaire de paquets',\n de: 'Paketmanager',\n it: 'Gestore dei pacchetti',\n ja: 'パッケージマネージャー',\n ko: '패키지 관리자',\n zh: '包管理器',\n hi: 'पैकेज प्रबंधक',\n 'en-GB': 'Package Manager',\n ru: 'Менеджер пакетов',\n ar: 'مدير الحزم',\n tr: 'Paket yöneticisi',\n pl: 'Menedżer pakietów',\n id: 'Pengelola paket',\n vi: 'Trình quản lý gói',\n uk: 'Менеджер пакетів',\n }),\n label: t({\n en: 'Select package manager',\n es: 'Seleccionar gestor de paquetes',\n pt: 'Selecionar gerenciador de pacotes',\n fr: 'Sélectionner le gestionnaire de paquets',\n de: 'Paketmanager auswählen',\n it: 'Seleziona il gestore dei pacchetti',\n ja: 'パッケージマネージャーを選択',\n ko: '패키지 관리자 선택',\n zh: '选择包管理器',\n hi: 'पैकेज प्रबंधक चुनें',\n 'en-GB': 'Select package manager',\n ru: 'Выбрать менеджер пакетов',\n ar: 'اختر مدير الحزم',\n tr: 'Paket yöneticisi seç',\n pl: 'Wybierz menedżera pakietów',\n id: 'Pilih pengelola paket',\n vi: 'Chọn trình quản lý gói',\n uk: 'Виберіть менеджер пакетів',\n }),\n },\n codeFormat: {\n placeholder: t({\n en: 'Code Format',\n es: 'Formato de código',\n pt: 'Formato de código',\n fr: 'Format de code',\n de: 'Code-Format',\n it: 'Formato del codice',\n ja: 'コード形式',\n ko: '코드 형식',\n zh: '代码格式',\n hi: 'कोड प्रारूप',\n 'en-GB': 'Code Format',\n ru: 'Формат кода',\n ar: 'تنسيق الكود',\n tr: 'Kod formatı',\n pl: 'Format kodu',\n id: 'Format kode',\n vi: 'Định dạng mã',\n uk: 'Формат коду',\n }),\n label: t({\n en: 'Select code format',\n es: 'Seleccionar formato de código',\n pt: 'Selecionar formato de código',\n fr: 'Sélectionner le format de code',\n de: 'Code-Format auswählen',\n it: 'Seleziona il formato del codice',\n ja: 'コード形式を選択',\n ko: '코드 형식 선택',\n zh: '选择代码格式',\n hi: 'कोड प्रारूप चुनें',\n 'en-GB': 'Select code format',\n ru: 'Выбрать формат кода',\n ar: 'اختر تنسيق الكود',\n tr: 'Kod formatı seç',\n pl: 'Wybierz format kodu',\n id: 'Pilih format kode',\n vi: 'Chọn định dạng mã',\n uk: 'Виберіть формат коду',\n }),\n },\n contentDeclarationFormat: {\n placeholder: t({\n en: 'Dictionary Format',\n es: 'Formato de diccionario',\n pt: 'Formato de dicionário',\n fr: 'Format de dictionnaire',\n de: 'Wörterbuchformat',\n it: 'Formato del dizionario',\n ja: '辞書形式',\n ko: '사전 형식',\n zh: '字典格式',\n hi: 'शब्दकोश प्रारूप',\n 'en-GB': 'Dictionary Format',\n ru: 'Формат словаря',\n ar: 'تنسيق القاموس',\n tr: 'Sözlük formatı',\n pl: 'Format słownika',\n id: 'Format kamus',\n vi: 'Định dạng từ điển',\n uk: 'Формат словника',\n }),\n label: t({\n en: 'Select dictionary format',\n es: 'Seleccionar formato de diccionario',\n pt: 'Selecionar formato de dicionário',\n fr: 'Sélectionner le format de dictionnaire',\n de: 'Wörterbuchformat auswählen',\n it: 'Seleziona il formato del dizionario',\n ja: '辞書形式を選択',\n ko: '사전 형식 선택',\n zh: '选择字典格式',\n hi: 'शब्दकोश प्रारूप चुनें',\n 'en-GB': 'Select dictionary format',\n ru: 'Выбрать формат словаря',\n ar: 'اختر تنسيق القاموس',\n tr: 'Sözlük formatı seç',\n pl: 'Wybierz format słownika',\n id: 'Pilih format kamus',\n vi: 'Chọn định dạng từ điển',\n uk: 'Виберіть формат словника',\n }),\n },\n },\n title: 'Code selector accessibility labels',\n description:\n 'Accessible labels for code block selector buttons used by screen readers.',\n tags: ['accessibility', 'code block', 'design system'],\n} satisfies Dictionary;\n\nexport default selectorsContent;\n"],"mappings":";;;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J,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACL,CAAC;GACF,OAAO,EAAE;IACP,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,SAAS;IACT,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACL,CAAC;GACH;EACF;CACD,OAAO;CACP,aACE;CACF,MAAM;EAAC;EAAiB;EAAc;EAAgB;CACvD"}
1
+ {"version":3,"file":"selectors.content.mjs","names":[],"sources":["../../../../src/components/IDE/selectors.content.ts"],"sourcesContent":["import { type Dictionary, t } from 'intlayer';\n\nconst selectorsContent = {\n key: 'code-selectors',\n content: {\n packageManager: {\n placeholder: t({\n en: 'Package Manager',\n es: 'Gestor de paquetes',\n pt: 'Gerenciador de pacotes',\n fr: 'Gestionnaire de paquets',\n de: 'Paketmanager',\n it: 'Gestore dei pacchetti',\n ja: 'パッケージマネージャー',\n ko: '패키지 관리자',\n zh: '包管理器',\n hi: 'पैकेज प्रबंधक',\n 'en-GB': 'Package Manager',\n ru: 'Менеджер пакетов',\n ar: 'مدير الحزم',\n tr: 'Paket yöneticisi',\n pl: 'Menedżer pakietów',\n id: 'Pengelola paket',\n vi: 'Trình quản lý gói',\n uk: 'Менеджер пакетів',\n }),\n label: t({\n en: 'Select package manager',\n es: 'Seleccionar gestor de paquetes',\n pt: 'Selecionar gerenciador de pacotes',\n fr: 'Sélectionner le gestionnaire de paquets',\n de: 'Paketmanager auswählen',\n it: 'Seleziona il gestore dei pacchetti',\n ja: 'パッケージマネージャーを選択',\n ko: '패키지 관리자 선택',\n zh: '选择包管理器',\n hi: 'पैकेज प्रबंधक चुनें',\n 'en-GB': 'Select package manager',\n ru: 'Выбрать менеджер пакетов',\n ar: 'اختر مدير الحزم',\n tr: 'Paket yöneticisi seç',\n pl: 'Wybierz menedżera pakietów',\n id: 'Pilih pengelola paket',\n vi: 'Chọn trình quản lý gói',\n uk: 'Виберіть менеджер пакетів',\n }),\n },\n codeFormat: {\n placeholder: t({\n en: 'Code Format',\n es: 'Formato de código',\n pt: 'Formato de código',\n fr: 'Format de code',\n de: 'Code-Format',\n it: 'Formato del codice',\n ja: 'コード形式',\n ko: '코드 형식',\n zh: '代码格式',\n hi: 'कोड प्रारूप',\n 'en-GB': 'Code Format',\n ru: 'Формат кода',\n ar: 'تنسيق الكود',\n tr: 'Kod formatı',\n pl: 'Format kodu',\n id: 'Format kode',\n vi: 'Định dạng mã',\n uk: 'Формат коду',\n }),\n label: t({\n en: 'Select code format',\n es: 'Seleccionar formato de código',\n pt: 'Selecionar formato de código',\n fr: 'Sélectionner le format de code',\n de: 'Code-Format auswählen',\n it: 'Seleziona il formato del codice',\n ja: 'コード形式を選択',\n ko: '코드 형식 선택',\n zh: '选择代码格式',\n hi: 'कोड प्रारूप चुनें',\n 'en-GB': 'Select code format',\n ru: 'Выбрать формат кода',\n ar: 'اختر تنسيق الكود',\n tr: 'Kod formatı seç',\n pl: 'Wybierz format kodu',\n id: 'Pilih format kode',\n vi: 'Chọn định dạng mã',\n uk: 'Виберіть формат коду',\n }),\n },\n contentDeclarationFormat: {\n placeholder: t({\n en: 'Dictionary Format',\n es: 'Formato de diccionario',\n pt: 'Formato de dicionário',\n fr: 'Format de dictionnaire',\n de: 'Wörterbuchformat',\n it: 'Formato del dizionario',\n ja: '辞書形式',\n ko: '사전 형식',\n zh: '字典格式',\n hi: 'शब्दकोश प्रारूप',\n 'en-GB': 'Dictionary Format',\n ru: 'Формат словаря',\n ar: 'تنسيق القاموس',\n tr: 'Sözlük formatı',\n pl: 'Format słownika',\n id: 'Format kamus',\n vi: 'Định dạng từ điển',\n uk: 'Формат словника',\n }),\n label: t({\n en: 'Select dictionary format',\n es: 'Seleccionar formato de diccionario',\n pt: 'Selecionar formato de dicionário',\n fr: 'Sélectionner le format de dictionnaire',\n de: 'Wörterbuchformat auswählen',\n it: 'Seleziona il formato del dizionario',\n ja: '辞書形式を選択',\n ko: '사전 형식 선택',\n zh: '选择字典格式',\n hi: 'शब्दकोश प्रारूप चुनें',\n 'en-GB': 'Select dictionary format',\n ru: 'Выбрать формат словаря',\n ar: 'اختر تنسيق القاموس',\n tr: 'Sözlük formatı seç',\n pl: 'Wybierz format słownika',\n id: 'Pilih format kamus',\n vi: 'Chọn định dạng từ điển',\n uk: 'Виберіть формат словника',\n }),\n },\n },\n title: 'Code selector accessibility labels',\n description:\n 'Accessible labels for code block selector buttons used by screen readers.',\n tags: ['accessibility', 'code block', 'design system'],\n} satisfies Dictionary;\n\nexport default selectorsContent;\n"],"mappings":";;;AAEA,MAAM,mBAAmB;CACvB,KAAK;CACL,SAAS;EACP,gBAAgB;GACd,aAAa,EAAE;IACb,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,SAAS;IACT,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;GACN,CAAC;GACD,OAAO,EAAE;IACP,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,SAAS;IACT,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;GACN,CAAC;EACH;EACA,YAAY;GACV,aAAa,EAAE;IACb,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,SAAS;IACT,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;GACN,CAAC;GACD,OAAO,EAAE;IACP,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,SAAS;IACT,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;GACN,CAAC;EACH;EACA,0BAA0B;GACxB,aAAa,EAAE;IACb,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,SAAS;IACT,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;GACN,CAAC;GACD,OAAO,EAAE;IACP,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,SAAS;IACT,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;GACN,CAAC;EACH;CACF;CACA,OAAO;CACP,aACE;CACF,MAAM;EAAC;EAAiB;EAAc;CAAe;AACvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/InformationTag/index.tsx"],"sourcesContent":["import { cn } from '@utils/cn';\nimport type { DetailedHTMLProps, FC } from 'react';\n\n/**\n * Props for the InformationTag component.\n * Extends standard HTML element attributes for maximum flexibility.\n */\ntype CopiedTextInformationProps = DetailedHTMLProps<\n React.HTMLAttributes<HTMLElement>,\n HTMLElement\n>;\n\n/**\n * InformationTag Component\n *\n * A lightweight component that displays informational text with a distinctive info icon (ⓘ).\n * Perfect for showing contextual hints, supplementary information, or subtle guidance text.\n *\n * @component\n * @example\n * Basic usage:\n * ```tsx\n * <InformationTag>This field is required</InformationTag>\n * ```\n *\n * @example\n * With custom styling:\n * ```tsx\n * <InformationTag className=\"text-blue-600 font-medium\">\n * Pro tip: Use keyboard shortcuts for faster navigation\n * </InformationTag>\n * ```\n *\n * @example\n * Form field context:\n * ```tsx\n * <div>\n * <input type=\"email\" placeholder=\"your@email.com\" />\n * <InformationTag>We'll never share your email address</InformationTag>\n * </div>\n * ```\n *\n * @example\n * Status information:\n * ```tsx\n * <InformationTag className=\"text-green-500\">\n * Changes saved automatically\n * </InformationTag>\n * ```\n *\n * Features:\n * - Lightweight and semantic HTML structure using <i> tag\n * - Distinctive info icon (ⓘ) for visual recognition\n * - Default subtle styling with neutral colors\n * - Fully customizable with className overrides\n * - Supports all standard HTML element attributes\n * - Screen reader friendly with meaningful semantic content\n *\n * Accessibility:\n * - Uses semantic <i> tag which is announced by screen readers\n * - Info icon (ⓘ) provides visual context for sighted users\n * - Text content is fully accessible and readable\n * - Supports ARIA attributes through props spreading\n *\n * @param props - Component props extending HTML element attributes\n * @param props.children - The informational text content to display\n * @param props.className - Additional CSS classes for custom styling\n * @param props.title - Optional tooltip text (HTML title attribute)\n * @param props.role - ARIA role (defaults to implicit role from <i> tag)\n * @param props.aria-label - ARIA label for screen readers\n * @param props.id - Unique identifier for the element\n * @param props.onClick - Click event handler\n * @param props.onMouseEnter - Mouse enter event handler\n * @param props.onMouseLeave - Mouse leave event handler\n * @param props.style - Inline styles object\n * @param props.data-* - Data attributes for testing or tracking\n * @param props...rest - All other standard HTML element attributes\n *\n * @returns A rendered information tag with icon and text content\n */\nexport const InformationTag: FC<CopiedTextInformationProps> = ({\n className,\n children,\n ...props\n}) => (\n <i className={cn('text-neutral-400 text-xs', className)} {...props}>\n ⓘ {children}\n </i>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgFA,MAAa,kBAAkD,EAC7D,WACA,UACA,GAAG,YAEH,qBAAC,KAAD;CAAG,WAAW,GAAG,4BAA4B,UAAU;CAAE,GAAI;WAA7D,CAAoE,MAC/D,SACD"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/InformationTag/index.tsx"],"sourcesContent":["import { cn } from '@utils/cn';\nimport type { DetailedHTMLProps, FC } from 'react';\n\n/**\n * Props for the InformationTag component.\n * Extends standard HTML element attributes for maximum flexibility.\n */\ntype CopiedTextInformationProps = DetailedHTMLProps<\n React.HTMLAttributes<HTMLElement>,\n HTMLElement\n>;\n\n/**\n * InformationTag Component\n *\n * A lightweight component that displays informational text with a distinctive info icon (ⓘ).\n * Perfect for showing contextual hints, supplementary information, or subtle guidance text.\n *\n * @component\n * @example\n * Basic usage:\n * ```tsx\n * <InformationTag>This field is required</InformationTag>\n * ```\n *\n * @example\n * With custom styling:\n * ```tsx\n * <InformationTag className=\"text-blue-600 font-medium\">\n * Pro tip: Use keyboard shortcuts for faster navigation\n * </InformationTag>\n * ```\n *\n * @example\n * Form field context:\n * ```tsx\n * <div>\n * <input type=\"email\" placeholder=\"your@email.com\" />\n * <InformationTag>We'll never share your email address</InformationTag>\n * </div>\n * ```\n *\n * @example\n * Status information:\n * ```tsx\n * <InformationTag className=\"text-green-500\">\n * Changes saved automatically\n * </InformationTag>\n * ```\n *\n * Features:\n * - Lightweight and semantic HTML structure using <i> tag\n * - Distinctive info icon (ⓘ) for visual recognition\n * - Default subtle styling with neutral colors\n * - Fully customizable with className overrides\n * - Supports all standard HTML element attributes\n * - Screen reader friendly with meaningful semantic content\n *\n * Accessibility:\n * - Uses semantic <i> tag which is announced by screen readers\n * - Info icon (ⓘ) provides visual context for sighted users\n * - Text content is fully accessible and readable\n * - Supports ARIA attributes through props spreading\n *\n * @param props - Component props extending HTML element attributes\n * @param props.children - The informational text content to display\n * @param props.className - Additional CSS classes for custom styling\n * @param props.title - Optional tooltip text (HTML title attribute)\n * @param props.role - ARIA role (defaults to implicit role from <i> tag)\n * @param props.aria-label - ARIA label for screen readers\n * @param props.id - Unique identifier for the element\n * @param props.onClick - Click event handler\n * @param props.onMouseEnter - Mouse enter event handler\n * @param props.onMouseLeave - Mouse leave event handler\n * @param props.style - Inline styles object\n * @param props.data-* - Data attributes for testing or tracking\n * @param props...rest - All other standard HTML element attributes\n *\n * @returns A rendered information tag with icon and text content\n */\nexport const InformationTag: FC<CopiedTextInformationProps> = ({\n className,\n children,\n ...props\n}) => (\n <i className={cn('text-neutral-400 text-xs', className)} {...props}>\n ⓘ {children}\n </i>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgFA,MAAa,kBAAkD,EAC7D,WACA,UACA,GAAG,YAEH,qBAAC,KAAD;CAAG,WAAW,GAAG,4BAA4B,SAAS;CAAG,GAAI;WAA7D,CAAoE,MAC/D,QACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.mjs","names":[],"sources":["../../../../src/components/Input/Checkbox.tsx"],"sourcesContent":["import { cn } from '@utils/cn';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport type {\n DetailedHTMLProps,\n FC,\n InputHTMLAttributes,\n ReactNode,\n} from 'react';\n\nexport const checkboxVariants = cva(\n [\n 'appearance-none',\n 'relative cursor-pointer border-2',\n 'focus:outline-0',\n 'checked:hover:opacity-80',\n 'ring-offset-background',\n 'hover:bg-neutral-500/10',\n 'disabled:opacity-50',\n\n // Ring + animation\n 'ring-0 transition-all duration-300 ease-in-out hover:ring-4 focus-visible:ring-6',\n\n // centered custom checkmark with text-opposite color\n \"checked:before:absolute checked:before:inset-0 checked:before:content-['✓']\",\n 'checked:before:flex checked:before:items-center checked:before:justify-center',\n 'checked:before:text-text-opposite/80',\n\n // Corner shape\n 'rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl',\n\n \"after:absolute after:-inset-2 after:content-['']\",\n ].join(' '),\n {\n variants: {\n variant: {\n default: '',\n },\n size: {\n xs: 'size-3 rounded-sm',\n sm: 'size-4 rounded-md',\n md: 'size-5 rounded-lg',\n lg: 'size-6 rounded-xl',\n },\n color: {\n primary:\n 'border-primary/30 text-primary ring-primary/20 checked:border-primary checked:bg-primary',\n secondary:\n 'border-secondary/30 text-secondary ring-secondary/20 checked:border-secondary checked:bg-secondary',\n destructive:\n 'border-destructive/30 text-destructive ring-destructive/20 checked:border-destructive checked:bg-destructive',\n neutral:\n 'border-neutral/30 text-neutral ring-neutral/20 checked:border-neutral checked:bg-neutral',\n light:\n 'border-white/30 text-white ring-white/20 checked:border-white checked:bg-white',\n text: 'border-text/30 text-text ring-text/20 checked:border-text checked:bg-text',\n ['text-inverse']:\n 'border-text-inverse/30 text-text-inverse ring-text-inverse/20 checked:border-text-inverse checked:bg-text-inverse',\n dark: 'border-neutral-800/30 text-neutral-800 ring-neutral-800/20 checked:border-neutral-800 checked:bg-neutral-800',\n error:\n 'border-error/30 text-error ring-error/20 checked:border-error checked:bg-error',\n success:\n 'border-success/30 text-success ring-success/20 checked:border-success checked:bg-success',\n custom:\n 'border-custom/30 text-custom ring-custom/20 checked:border-custom checked:bg-custom',\n },\n validationStyleEnabled: {\n disabled: '',\n enabled: 'valid:border-success invalid:border-error',\n },\n },\n defaultVariants: {\n variant: 'default',\n color: 'primary',\n validationStyleEnabled: 'disabled',\n size: 'md',\n },\n }\n);\n\nexport enum CheckboxSize {\n XS = 'xs',\n SM = 'sm',\n MD = 'md',\n LG = 'lg',\n}\n\nexport enum CheckboxColor {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n DESTRUCTIVE = 'destructive',\n NEUTRAL = 'neutral',\n LIGHT = 'light',\n TEXT = 'text',\n TEXT_INVERSE = 'text-inverse',\n DARK = 'dark',\n ERROR = 'error',\n SUCCESS = 'success',\n CUSTOM = 'custom',\n}\n\nexport type CheckboxProps = Omit<\n DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>,\n 'size'\n> & {\n name: string;\n validationStyleEnabled?: boolean;\n label?: ReactNode;\n} & Omit<\n VariantProps<typeof checkboxVariants>,\n 'validationStyleEnabled' | 'size' | 'color'\n > & {\n size?: CheckboxSize | `${CheckboxSize}`;\n color?: CheckboxColor | `${CheckboxColor}`;\n labelClassName?: string;\n };\n\nconst Input: FC<CheckboxProps> = ({\n validationStyleEnabled = false,\n label,\n size,\n color,\n name,\n variant,\n className,\n labelClassName,\n ...props\n}) => (\n <input\n type=\"checkbox\"\n className={cn(\n checkboxVariants({\n variant,\n size,\n color,\n validationStyleEnabled: validationStyleEnabled ? 'enabled' : 'disabled',\n }),\n className\n )}\n {...props}\n />\n);\n\nexport const Checkbox: FC<CheckboxProps> = (props) => {\n const { label, name, id } = props;\n\n return label ? (\n <label\n htmlFor={id ?? name}\n className={cn(\n 'flex w-full cursor-pointer items-center gap-x-4 font-medium text-sm',\n props.size === 'xs' && 'text-xs',\n props.labelClassName\n )}\n >\n <Input id={id ?? name} {...props} />\n {label}\n </label>\n ) : (\n <Input id={id ?? name} {...props} />\n );\n};\n"],"mappings":";;;;;AASA,MAAa,mBAAmB,IAC9B;CACE;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CAGA;CACA;CACA;CAGA;CAEA;CACD,CAAC,KAAK,IAAI,EACX;CACE,UAAU;EACR,SAAS,EACP,SAAS,IACV;EACD,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL;EACD,OAAO;GACL,SACE;GACF,WACE;GACF,aACE;GACF,SACE;GACF,OACE;GACF,MAAM;IACL,iBACC;GACF,MAAM;GACN,OACE;GACF,SACE;GACF,QACE;GACH;EACD,wBAAwB;GACtB,UAAU;GACV,SAAS;GACV;EACF;CACD,iBAAiB;EACf,SAAS;EACT,OAAO;EACP,wBAAwB;EACxB,MAAM;EACP;CACF,CACF;AAED,IAAY,eAAL;CACL;CACA;CACA;CACA;;KACD;AAED,IAAY,gBAAL;CACL;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;KACD;AAkBD,MAAM,SAA4B,EAChC,yBAAyB,OACzB,OACA,MACA,OACA,MACA,SACA,WACA,gBACA,GAAG,YAEH,oBAAC,SAAD;CACE,MAAK;CACL,WAAW,GACT,iBAAiB;EACf;EACA;EACA;EACA,wBAAwB,yBAAyB,YAAY;EAC9D,CAAC,EACF,UACD;CACD,GAAI;CACJ;AAGJ,MAAa,YAA+B,UAAU;CACpD,MAAM,EAAE,OAAO,MAAM,OAAO;CAE5B,OAAO,QACL,qBAAC,SAAD;EACE,SAAS,MAAM;EACf,WAAW,GACT,uEACA,MAAM,SAAS,QAAQ,WACvB,MAAM,eACP;YANH,CAQE,oBAAC,OAAD;GAAO,IAAI,MAAM;GAAM,GAAI;GAAS,GACnC,MACK;MAER,oBAAC,OAAD;EAAO,IAAI,MAAM;EAAM,GAAI;EAAS"}
1
+ {"version":3,"file":"Checkbox.mjs","names":[],"sources":["../../../../src/components/Input/Checkbox.tsx"],"sourcesContent":["import { cn } from '@utils/cn';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport type {\n DetailedHTMLProps,\n FC,\n InputHTMLAttributes,\n ReactNode,\n} from 'react';\n\nexport const checkboxVariants = cva(\n [\n 'appearance-none',\n 'relative cursor-pointer border-2',\n 'focus:outline-0',\n 'checked:hover:opacity-80',\n 'ring-offset-background',\n 'hover:bg-neutral-500/10',\n 'disabled:opacity-50',\n\n // Ring + animation\n 'ring-0 transition-all duration-300 ease-in-out hover:ring-4 focus-visible:ring-6',\n\n // centered custom checkmark with text-opposite color\n \"checked:before:absolute checked:before:inset-0 checked:before:content-['✓']\",\n 'checked:before:flex checked:before:items-center checked:before:justify-center',\n 'checked:before:text-text-opposite/80',\n\n // Corner shape\n 'rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl',\n\n \"after:absolute after:-inset-2 after:content-['']\",\n ].join(' '),\n {\n variants: {\n variant: {\n default: '',\n },\n size: {\n xs: 'size-3 rounded-sm',\n sm: 'size-4 rounded-md',\n md: 'size-5 rounded-lg',\n lg: 'size-6 rounded-xl',\n },\n color: {\n primary:\n 'border-primary/30 text-primary ring-primary/20 checked:border-primary checked:bg-primary',\n secondary:\n 'border-secondary/30 text-secondary ring-secondary/20 checked:border-secondary checked:bg-secondary',\n destructive:\n 'border-destructive/30 text-destructive ring-destructive/20 checked:border-destructive checked:bg-destructive',\n neutral:\n 'border-neutral/30 text-neutral ring-neutral/20 checked:border-neutral checked:bg-neutral',\n light:\n 'border-white/30 text-white ring-white/20 checked:border-white checked:bg-white',\n text: 'border-text/30 text-text ring-text/20 checked:border-text checked:bg-text',\n ['text-inverse']:\n 'border-text-inverse/30 text-text-inverse ring-text-inverse/20 checked:border-text-inverse checked:bg-text-inverse',\n dark: 'border-neutral-800/30 text-neutral-800 ring-neutral-800/20 checked:border-neutral-800 checked:bg-neutral-800',\n error:\n 'border-error/30 text-error ring-error/20 checked:border-error checked:bg-error',\n success:\n 'border-success/30 text-success ring-success/20 checked:border-success checked:bg-success',\n custom:\n 'border-custom/30 text-custom ring-custom/20 checked:border-custom checked:bg-custom',\n },\n validationStyleEnabled: {\n disabled: '',\n enabled: 'valid:border-success invalid:border-error',\n },\n },\n defaultVariants: {\n variant: 'default',\n color: 'primary',\n validationStyleEnabled: 'disabled',\n size: 'md',\n },\n }\n);\n\nexport enum CheckboxSize {\n XS = 'xs',\n SM = 'sm',\n MD = 'md',\n LG = 'lg',\n}\n\nexport enum CheckboxColor {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n DESTRUCTIVE = 'destructive',\n NEUTRAL = 'neutral',\n LIGHT = 'light',\n TEXT = 'text',\n TEXT_INVERSE = 'text-inverse',\n DARK = 'dark',\n ERROR = 'error',\n SUCCESS = 'success',\n CUSTOM = 'custom',\n}\n\nexport type CheckboxProps = Omit<\n DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>,\n 'size'\n> & {\n name: string;\n validationStyleEnabled?: boolean;\n label?: ReactNode;\n} & Omit<\n VariantProps<typeof checkboxVariants>,\n 'validationStyleEnabled' | 'size' | 'color'\n > & {\n size?: CheckboxSize | `${CheckboxSize}`;\n color?: CheckboxColor | `${CheckboxColor}`;\n labelClassName?: string;\n };\n\nconst Input: FC<CheckboxProps> = ({\n validationStyleEnabled = false,\n label,\n size,\n color,\n name,\n variant,\n className,\n labelClassName,\n ...props\n}) => (\n <input\n type=\"checkbox\"\n className={cn(\n checkboxVariants({\n variant,\n size,\n color,\n validationStyleEnabled: validationStyleEnabled ? 'enabled' : 'disabled',\n }),\n className\n )}\n {...props}\n />\n);\n\nexport const Checkbox: FC<CheckboxProps> = (props) => {\n const { label, name, id } = props;\n\n return label ? (\n <label\n htmlFor={id ?? name}\n className={cn(\n 'flex w-full cursor-pointer items-center gap-x-4 font-medium text-sm',\n props.size === 'xs' && 'text-xs',\n props.labelClassName\n )}\n >\n <Input id={id ?? name} {...props} />\n {label}\n </label>\n ) : (\n <Input id={id ?? name} {...props} />\n );\n};\n"],"mappings":";;;;;AASA,MAAa,mBAAmB,IAC9B;CACE;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CAGA;CACA;CACA;CAGA;CAEA;AACF,EAAE,KAAK,GAAG,GACV;CACE,UAAU;EACR,SAAS,EACP,SAAS,GACX;EACA,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;EACA,OAAO;GACL,SACE;GACF,WACE;GACF,aACE;GACF,SACE;GACF,OACE;GACF,MAAM;IACL,iBACC;GACF,MAAM;GACN,OACE;GACF,SACE;GACF,QACE;EACJ;EACA,wBAAwB;GACtB,UAAU;GACV,SAAS;EACX;CACF;CACA,iBAAiB;EACf,SAAS;EACT,OAAO;EACP,wBAAwB;EACxB,MAAM;CACR;AACF,CACF;AAEA,IAAY,eAAL;CACL;CACA;CACA;CACA;;AACF;AAEA,IAAY,gBAAL;CACL;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;AACF;AAkBA,MAAM,SAA4B,EAChC,yBAAyB,OACzB,OACA,MACA,OACA,MACA,SACA,WACA,gBACA,GAAG,YAEH,oBAAC,SAAD;CACE,MAAK;CACL,WAAW,GACT,iBAAiB;EACf;EACA;EACA;EACA,wBAAwB,yBAAyB,YAAY;CAC/D,CAAC,GACD,SACF;CACA,GAAI;AACL;AAGH,MAAa,YAA+B,UAAU;CACpD,MAAM,EAAE,OAAO,MAAM,OAAO;CAE5B,OAAO,QACL,qBAAC,SAAD;EACE,SAAS,MAAM;EACf,WAAW,GACT,uEACA,MAAM,SAAS,QAAQ,WACvB,MAAM,cACR;YANF,CAQE,oBAAC,OAAD;GAAO,IAAI,MAAM;GAAM,GAAI;EAAQ,IAClC,KACI;MAEP,oBAAC,OAAD;EAAO,IAAI,MAAM;EAAM,GAAI;CAAQ;AAEvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Input.mjs","names":[],"sources":["../../../../src/components/Input/Input.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport type { DetailedHTMLProps, FC, InputHTMLAttributes } from 'react';\n\n// Optional: your own cn helper to merge class names\nconst cn = (...classes: (string | undefined | false | null)[]) =>\n classes.filter(Boolean).join(' ');\n\nexport const inputVariants = cva(\n [\n // base styles\n 'w-full select-text resize-none text-base shadow-none outline-none',\n 'transition-all duration-300 md:text-sm',\n 'ring-0',\n 'disabled:opacity-50',\n\n // Corner shape\n 'rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl',\n ].join(' '),\n {\n variants: {\n variant: {\n default: [\n 'text-text',\n 'bg-neutral-50 dark:bg-neutral-950',\n 'ring-text/20',\n\n // Focus ring\n 'disabled:ring-0',\n 'hover:ring-3',\n 'focus-within:ring-4',\n 'focus-visible:outline-none focus-visible:ring-4',\n\n // Remove any weird box-shadow\n '[box-shadow:none] focus:[box-shadow:none]',\n\n // aria-invalid border color\n 'aria-invalid:border-error',\n ].join(' '),\n invisible: 'border-none text-inherit outline-none ring-0',\n },\n size: {\n sm: 'px-2 py-2 text-sm md:py-1.5 md:text-xs',\n md: 'px-2 py-3 md:py-2',\n lg: 'p-4',\n },\n validationStyleEnabled: {\n disabled: '',\n enabled: 'valid:border-success invalid:border-error',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n validationStyleEnabled: 'disabled',\n },\n }\n);\n\nexport enum InputVariant {\n DEFAULT = 'default',\n INVISIBLE = 'invisible',\n}\n\nexport enum InputSize {\n MD = 'md',\n LG = 'lg',\n}\n\nexport type InputProps = Omit<\n DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>,\n 'size'\n> & {\n validationStyleEnabled?: boolean;\n} & Omit<VariantProps<typeof inputVariants>, 'validationStyleEnabled'>;\n\nexport const Input: FC<InputProps> = ({\n validationStyleEnabled = false,\n variant,\n size,\n className,\n ...props\n}) => (\n <input\n className={cn(\n inputVariants({\n variant,\n size,\n validationStyleEnabled: validationStyleEnabled ? 'enabled' : 'disabled',\n }),\n className\n )}\n suppressHydrationWarning\n {...props}\n />\n);\n"],"mappings":";;;;AAIA,MAAM,MAAM,GAAG,YACb,QAAQ,OAAO,QAAQ,CAAC,KAAK,IAAI;AAEnC,MAAa,gBAAgB,IAC3B;CAEE;CACA;CACA;CACA;CAGA;CACD,CAAC,KAAK,IAAI,EACX;CACE,UAAU;EACR,SAAS;GACP,SAAS;IACP;IACA;IACA;IAGA;IACA;IACA;IACA;IAGA;IAGA;IACD,CAAC,KAAK,IAAI;GACX,WAAW;GACZ;EACD,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL;EACD,wBAAwB;GACtB,UAAU;GACV,SAAS;GACV;EACF;CACD,iBAAiB;EACf,SAAS;EACT,MAAM;EACN,wBAAwB;EACzB;CACF,CACF;AAED,IAAY,eAAL;CACL;CACA;;KACD;AAED,IAAY,YAAL;CACL;CACA;;KACD;AASD,MAAa,SAAyB,EACpC,yBAAyB,OACzB,SACA,MACA,WACA,GAAG,YAEH,oBAAC,SAAD;CACE,WAAW,GACT,cAAc;EACZ;EACA;EACA,wBAAwB,yBAAyB,YAAY;EAC9D,CAAC,EACF,UACD;CACD;CACA,GAAI;CACJ"}
1
+ {"version":3,"file":"Input.mjs","names":[],"sources":["../../../../src/components/Input/Input.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport type { DetailedHTMLProps, FC, InputHTMLAttributes } from 'react';\n\n// Optional: your own cn helper to merge class names\nconst cn = (...classes: (string | undefined | false | null)[]) =>\n classes.filter(Boolean).join(' ');\n\nexport const inputVariants = cva(\n [\n // base styles\n 'w-full select-text resize-none text-base shadow-none outline-none',\n 'transition-all duration-300 md:text-sm',\n 'ring-0',\n 'disabled:opacity-50',\n\n // Corner shape\n 'rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl',\n ].join(' '),\n {\n variants: {\n variant: {\n default: [\n 'text-text',\n 'bg-neutral-50 dark:bg-neutral-950',\n 'ring-text/20',\n\n // Focus ring\n 'disabled:ring-0',\n 'hover:ring-3',\n 'focus-within:ring-4',\n 'focus-visible:outline-none focus-visible:ring-4',\n\n // Remove any weird box-shadow\n '[box-shadow:none] focus:[box-shadow:none]',\n\n // aria-invalid border color\n 'aria-invalid:border-error',\n ].join(' '),\n invisible: 'border-none text-inherit outline-none ring-0',\n },\n size: {\n sm: 'px-2 py-2 text-sm md:py-1.5 md:text-xs',\n md: 'px-2 py-3 md:py-2',\n lg: 'p-4',\n },\n validationStyleEnabled: {\n disabled: '',\n enabled: 'valid:border-success invalid:border-error',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n validationStyleEnabled: 'disabled',\n },\n }\n);\n\nexport enum InputVariant {\n DEFAULT = 'default',\n INVISIBLE = 'invisible',\n}\n\nexport enum InputSize {\n MD = 'md',\n LG = 'lg',\n}\n\nexport type InputProps = Omit<\n DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>,\n 'size'\n> & {\n validationStyleEnabled?: boolean;\n} & Omit<VariantProps<typeof inputVariants>, 'validationStyleEnabled'>;\n\nexport const Input: FC<InputProps> = ({\n validationStyleEnabled = false,\n variant,\n size,\n className,\n ...props\n}) => (\n <input\n className={cn(\n inputVariants({\n variant,\n size,\n validationStyleEnabled: validationStyleEnabled ? 'enabled' : 'disabled',\n }),\n className\n )}\n suppressHydrationWarning\n {...props}\n />\n);\n"],"mappings":";;;;AAIA,MAAM,MAAM,GAAG,YACb,QAAQ,OAAO,OAAO,EAAE,KAAK,GAAG;AAElC,MAAa,gBAAgB,IAC3B;CAEE;CACA;CACA;CACA;CAGA;AACF,EAAE,KAAK,GAAG,GACV;CACE,UAAU;EACR,SAAS;GACP,SAAS;IACP;IACA;IACA;IAGA;IACA;IACA;IACA;IAGA;IAGA;GACF,EAAE,KAAK,GAAG;GACV,WAAW;EACb;EACA,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;EACA,wBAAwB;GACtB,UAAU;GACV,SAAS;EACX;CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;EACN,wBAAwB;CAC1B;AACF,CACF;AAEA,IAAY,eAAL;CACL;CACA;;AACF;AAEA,IAAY,YAAL;CACL;CACA;;AACF;AASA,MAAa,SAAyB,EACpC,yBAAyB,OACzB,SACA,MACA,WACA,GAAG,YAEH,oBAAC,SAAD;CACE,WAAW,GACT,cAAc;EACZ;EACA;EACA,wBAAwB,yBAAyB,YAAY;CAC/D,CAAC,GACD,SACF;CACA;CACA,GAAI;AACL"}
@@ -1 +1 @@
1
- {"version":3,"file":"InputPassword.mjs","names":[],"sources":["../../../../src/components/Input/InputPassword.tsx"],"sourcesContent":["'use client';\n\nimport { EyeIcon, EyeOffIcon } from 'lucide-react';\nimport { type FC, type MouseEventHandler, useState } from 'react';\nimport { Input, type InputProps } from './Input';\n\ntype InputPasswordProps = Omit<InputProps, 'type'>;\n\nexport const InputPassword: FC<InputPasswordProps> = (props) => {\n const [isPasswordRevealed, setIsPasswordRevealed] = useState(false);\n\n const handlePasswordReveal: MouseEventHandler<HTMLButtonElement> = (e) => {\n e.preventDefault();\n e.stopPropagation();\n setIsPasswordRevealed((isPasswordRevealed) => !isPasswordRevealed);\n };\n\n const EyeIconComponent = isPasswordRevealed ? EyeIcon : EyeOffIcon;\n\n return (\n <div className=\"relative\">\n <Input\n {...props}\n aria-label=\"password\"\n type={isPasswordRevealed ? 'text' : 'password'}\n />\n\n <button\n data-testid=\"eye-icon\"\n type=\"button\"\n className=\"absolute right-2 h-full flex-row items-center\"\n onClick={handlePasswordReveal}\n aria-label={isPasswordRevealed ? 'Hide password' : 'Show password'}\n >\n <EyeIconComponent\n className=\"mr-2 inline-block cursor-pointer text-neutral\"\n size={20}\n />\n </button>\n </div>\n );\n};\n"],"mappings":";;;;;;;;AAQA,MAAa,iBAAyC,UAAU;CAC9D,MAAM,CAAC,oBAAoB,yBAAyB,SAAS,MAAM;CAEnE,MAAM,wBAA8D,MAAM;EACxE,EAAE,gBAAgB;EAClB,EAAE,iBAAiB;EACnB,uBAAuB,uBAAuB,CAAC,mBAAmB;;CAGpE,MAAM,mBAAmB,qBAAqB,UAAU;CAExD,OACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,OAAD;GACE,GAAI;GACJ,cAAW;GACX,MAAM,qBAAqB,SAAS;GACpC,GAEF,oBAAC,UAAD;GACE,eAAY;GACZ,MAAK;GACL,WAAU;GACV,SAAS;GACT,cAAY,qBAAqB,kBAAkB;aAEnD,oBAAC,kBAAD;IACE,WAAU;IACV,MAAM;IACN;GACK,EACL"}
1
+ {"version":3,"file":"InputPassword.mjs","names":[],"sources":["../../../../src/components/Input/InputPassword.tsx"],"sourcesContent":["'use client';\n\nimport { EyeIcon, EyeOffIcon } from 'lucide-react';\nimport { type FC, type MouseEventHandler, useState } from 'react';\nimport { Input, type InputProps } from './Input';\n\ntype InputPasswordProps = Omit<InputProps, 'type'>;\n\nexport const InputPassword: FC<InputPasswordProps> = (props) => {\n const [isPasswordRevealed, setIsPasswordRevealed] = useState(false);\n\n const handlePasswordReveal: MouseEventHandler<HTMLButtonElement> = (e) => {\n e.preventDefault();\n e.stopPropagation();\n setIsPasswordRevealed((isPasswordRevealed) => !isPasswordRevealed);\n };\n\n const EyeIconComponent = isPasswordRevealed ? EyeIcon : EyeOffIcon;\n\n return (\n <div className=\"relative\">\n <Input\n {...props}\n aria-label=\"password\"\n type={isPasswordRevealed ? 'text' : 'password'}\n />\n\n <button\n data-testid=\"eye-icon\"\n type=\"button\"\n className=\"absolute right-2 h-full flex-row items-center\"\n onClick={handlePasswordReveal}\n aria-label={isPasswordRevealed ? 'Hide password' : 'Show password'}\n >\n <EyeIconComponent\n className=\"mr-2 inline-block cursor-pointer text-neutral\"\n size={20}\n />\n </button>\n </div>\n );\n};\n"],"mappings":";;;;;;;;AAQA,MAAa,iBAAyC,UAAU;CAC9D,MAAM,CAAC,oBAAoB,yBAAyB,SAAS,KAAK;CAElE,MAAM,wBAA8D,MAAM;EACxE,EAAE,eAAe;EACjB,EAAE,gBAAgB;EAClB,uBAAuB,uBAAuB,CAAC,kBAAkB;CACnE;CAEA,MAAM,mBAAmB,qBAAqB,UAAU;CAExD,OACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,OAAD;GACE,GAAI;GACJ,cAAW;GACX,MAAM,qBAAqB,SAAS;EACrC,IAED,oBAAC,UAAD;GACE,eAAY;GACZ,MAAK;GACL,WAAU;GACV,SAAS;GACT,cAAY,qBAAqB,kBAAkB;aAEnD,oBAAC,kBAAD;IACE,WAAU;IACV,MAAM;GACP;EACK,EACL;;AAET"}
@@ -1 +1 @@
1
- {"version":3,"file":"OTPInput.mjs","names":[],"sources":["../../../../src/components/Input/OTPInput.tsx"],"sourcesContent":["'use client';\n\n/**\n * This component is a fork of https://github.com/guilhermerodz/input-otp\n */\n\nimport { cn } from '@utils/cn';\nimport { cva } from 'class-variance-authority';\nimport { MinusIcon } from 'lucide-react';\nimport {\n type ChangeEvent,\n type ClipboardEvent,\n type ComponentProps,\n type CSSProperties,\n createContext,\n type FC,\n type InputHTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n type RefObject,\n useContext,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { Button, type ButtonProps } from '../Button';\n\n// ---------------- Utilities ----------------\n\nconst syncTimeouts = (cb: (...args: any[]) => unknown): number[] => {\n const t1 = setTimeout(cb, 0); // For faster machines\n const t2 = setTimeout(cb, 1_0);\n const t3 = setTimeout(cb, 5_0);\n return [t1, t2, t3];\n};\n\nconst safeInsertRule = (sheet: CSSStyleSheet, rule: string) => {\n try {\n sheet.insertRule(rule);\n } catch {\n console.error('input-otp could not insert CSS rule:', rule);\n }\n};\n\n// Decided to go with <noscript>\n// instead of `scripting` CSS media query\n// because it's a fallback for initial page load\n// and the <script> tag won't be loaded\n// unless the user has JS disabled.\nconst NOSCRIPT_CSS_FALLBACK = `\n[data-input-otp] {\n --nojs-bg: white !important;\n --nojs-fg: black !important;\n\n background-color: var(--nojs-bg) !important;\n color: var(--nojs-fg) !important;\n caret-color: var(--nojs-fg) !important;\n letter-spacing: .25em !important;\n text-align: center !important;\n border: 1px solid var(--nojs-fg) !important;\n border-radius: 4px !important;\n width: 100% !important;\n}\n@media (prefers-color-scheme: dark) {\n [data-input-otp] {\n --nojs-bg: black !important;\n --nojs-fg: white !important;\n }\n}`;\n\n// ---------------- Constants ----------------\n\nconst PWM_BADGE_MARGIN_RIGHT = 18;\nconst PWM_BADGE_SPACE_WIDTH_PX = 40;\nconst PWM_BADGE_SPACE_WIDTH = `${PWM_BADGE_SPACE_WIDTH_PX}px` as const;\n\nconst PASSWORD_MANAGERS_SELECTORS = [\n '[data-lastpass-icon-root]', // LastPass\n 'com-1password-button', // 1Password\n '[data-dashlanecreated]', // Dashlane\n '[style$=\"2147483647 !important;\"]', // Bitwarden\n].join(',');\n\n// ---------------- Types ----------------\n\nexport type SlotProps = {\n isActive: boolean;\n char: string | null;\n placeholderChar: string | null;\n hasFakeCaret: boolean;\n};\n\nexport type RenderProps = {\n slots: SlotProps[];\n isFocused: boolean;\n isHovering: boolean;\n setSelection: (index: number) => void;\n};\n\ntype OverrideProps<T, R> = Omit<T, keyof R> & R;\n\ntype OTPInputBaseProps = OverrideProps<\n InputHTMLAttributes<HTMLInputElement>,\n {\n value?: string;\n onChange?: (newValue: string) => unknown;\n\n maxLength: number;\n\n onComplete?: (...args: any[]) => unknown;\n onActiveSlotChange?: (activeSlotIndex: number | null) => unknown;\n pushPasswordManagerStrategy?: 'increase-width' | 'none';\n pasteTransformer?: (pasted: string) => string;\n\n containerClassName?: string;\n\n noScriptCSSFallback?: string | null;\n }\n>;\n\ntype InputOTPRenderFn = (props: RenderProps) => ReactNode;\n\nexport type OTPInputProps = OTPInputBaseProps &\n (\n | {\n render: InputOTPRenderFn;\n children?: never;\n }\n | {\n render?: never;\n children: ReactNode;\n }\n );\n\n// ---------------- Hooks ----------------\n\nexport const usePasswordManagerBadge = ({\n containerRef,\n inputRef,\n pushPasswordManagerStrategy,\n isFocused,\n}: {\n containerRef: RefObject<HTMLDivElement | null>;\n inputRef: RefObject<HTMLInputElement | null>;\n pushPasswordManagerStrategy: OTPInputProps['pushPasswordManagerStrategy'];\n isFocused: boolean;\n}) => {\n /** Password managers have a badge\n * and I'll use this state to push them\n * outside the input */\n const [hasPWMBadge, setHasPWMBadge] = useState(false);\n const [hasPWMBadgeSpace, setHasPWMBadgeSpace] = useState(false);\n const [done, setDone] = useState(false);\n\n const willPushPWMBadge =\n pushPasswordManagerStrategy === 'none'\n ? false\n : (pushPasswordManagerStrategy === 'increase-width' ||\n // TODO: remove 'experimental-no-flickering' support in 2.0.0\n pushPasswordManagerStrategy === 'experimental-no-flickering') &&\n hasPWMBadge &&\n hasPWMBadgeSpace;\n\n const trackPWMBadge = () => {\n const container = containerRef.current;\n const input = inputRef.current;\n if (\n !container ||\n !input ||\n done ||\n pushPasswordManagerStrategy === 'none'\n ) {\n return;\n }\n\n const elementToCompare = container;\n\n // Get the top right-center point of the container.\n // That is usually where most password managers place their badge.\n const rightCornerX =\n elementToCompare.getBoundingClientRect().left +\n elementToCompare.offsetWidth;\n const centereredY =\n elementToCompare.getBoundingClientRect().top +\n elementToCompare.offsetHeight / 2;\n const x = rightCornerX - PWM_BADGE_MARGIN_RIGHT;\n const y = centereredY;\n\n // Do an extra search to check for famous password managers\n const pmws = document.querySelectorAll(PASSWORD_MANAGERS_SELECTORS);\n\n // If no password manager is automatically detect,\n // we'll try to dispatch document.elementFromPoint\n // to identify badges\n if (pmws.length === 0) {\n const maybeBadgeEl = document.elementFromPoint(x, y);\n\n // If the found element is the input itself,\n // then we assume it's not a password manager badge.\n // We are not sure. Most times that means there isn't a badge.\n if (maybeBadgeEl === container) {\n return;\n }\n }\n\n setHasPWMBadge(true);\n setDone(true);\n };\n\n useEffect(() => {\n const container = containerRef.current;\n if (!container || pushPasswordManagerStrategy === 'none') {\n return;\n }\n\n // Check if the PWM area is 100% visible\n const checkHasSpace = () => {\n const viewportWidth = window.innerWidth;\n const distanceToRightEdge =\n viewportWidth - container.getBoundingClientRect().right;\n setHasPWMBadgeSpace(distanceToRightEdge >= PWM_BADGE_SPACE_WIDTH_PX);\n };\n\n checkHasSpace();\n const interval = setInterval(checkHasSpace, 1000);\n\n return () => {\n clearInterval(interval);\n };\n }, [containerRef, pushPasswordManagerStrategy]);\n\n useEffect(() => {\n const _isFocused = isFocused || document.activeElement === inputRef.current;\n\n if (pushPasswordManagerStrategy === 'none' || !_isFocused) {\n return;\n }\n const t1 = setTimeout(trackPWMBadge, 0);\n const t2 = setTimeout(trackPWMBadge, 2000);\n const t3 = setTimeout(trackPWMBadge, 5000);\n const t4 = setTimeout(() => {\n setDone(true);\n }, 6000);\n return () => {\n clearTimeout(t1);\n clearTimeout(t2);\n clearTimeout(t3);\n clearTimeout(t4);\n };\n }, [inputRef, isFocused, pushPasswordManagerStrategy]);\n\n return { hasPWMBadge, willPushPWMBadge, PWM_BADGE_SPACE_WIDTH };\n};\n\nexport const usePrevious = <T,>(value: T): T | undefined => {\n const ref = useRef<T | undefined>(undefined);\n useEffect(() => {\n ref.current = value;\n });\n return ref.current;\n};\n\n// ---------------- Context ----------------\n\nexport const OTPInputContext = createContext<RenderProps>({} as RenderProps);\n\n// ---------------- Core Component ----------------\n\nexport const OTPInput: FC<OTPInputProps> = ({\n value: uncheckedValue,\n onChange: uncheckedOnChange,\n maxLength,\n pattern,\n placeholder,\n inputMode = 'numeric',\n onComplete,\n onActiveSlotChange,\n pushPasswordManagerStrategy = 'increase-width',\n pasteTransformer,\n containerClassName,\n noScriptCSSFallback = NOSCRIPT_CSS_FALLBACK,\n render,\n children,\n ...props\n}) => {\n // Only used when `value` state is not provided\n const [internalValue, setInternalValue] = useState(\n typeof props.defaultValue === 'string' ? props.defaultValue : ''\n );\n\n // Definitions\n const value = uncheckedValue ?? internalValue;\n const previousValue = usePrevious(value);\n const onChange = (newValue: string) => {\n uncheckedOnChange?.(newValue);\n setInternalValue(newValue);\n };\n const regexp =\n pattern !== undefined\n ? typeof pattern === 'string'\n ? new RegExp(pattern)\n : pattern\n : null;\n\n /** useRef */\n const inputRef = useRef<HTMLInputElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const initialLoadRef = useRef({\n value,\n onChange,\n isIOS:\n typeof window !== 'undefined' &&\n window?.CSS?.supports?.('-webkit-touch-callout', 'none'),\n });\n const inputMetadataRef = useRef<{\n prev: [number | null, number | null, 'none' | 'forward' | 'backward'];\n }>({\n prev: [\n inputRef.current?.selectionStart ?? null,\n inputRef.current?.selectionEnd ?? null,\n inputRef.current?.selectionDirection ?? 'none',\n ],\n });\n useEffect(() => {\n const input = inputRef.current;\n const container = containerRef.current;\n\n if (!input || !container) {\n return;\n }\n\n // Sync input value\n if (initialLoadRef.current.value !== input.value) {\n initialLoadRef.current.onChange(input.value);\n }\n\n // Previous selection\n inputMetadataRef.current.prev = [\n input.selectionStart,\n input.selectionEnd,\n input.selectionDirection ?? 'none',\n ];\n const onDocumentSelectionChange = () => {\n if (document.activeElement !== input) {\n setMirrorSelectionStart(null);\n setMirrorSelectionEnd(null);\n setActualCaretPosition(null);\n return;\n }\n\n const selectionStart = input.selectionStart;\n const selectionEnd = input.selectionEnd;\n const selectionDirection = input.selectionDirection;\n const maxLength = input.maxLength;\n const value = input.value;\n const previousSelection = inputMetadataRef.current.prev;\n\n let calculatedStart = -1;\n let calculatedEnd = -1;\n let calculatedDirection: 'forward' | 'backward' | 'none' =\n selectionDirection ?? 'none';\n\n if (\n value.length !== 0 &&\n selectionStart !== null &&\n selectionEnd !== null\n ) {\n const isSingleCaret = selectionStart === selectionEnd;\n const isInsertMode =\n selectionStart === value.length && value.length < maxLength;\n\n if (isSingleCaret && !isInsertMode) {\n const caretPosition = selectionStart;\n if (caretPosition === 0) {\n calculatedStart = 0;\n calculatedEnd = 1;\n calculatedDirection = 'forward';\n } else if (caretPosition === maxLength) {\n calculatedStart = caretPosition - 1;\n calculatedEnd = caretPosition;\n calculatedDirection = 'backward';\n } else if (maxLength > 1 && value.length > 1) {\n let offset = 0;\n if (\n previousSelection[0] !== null &&\n previousSelection[1] !== null\n ) {\n calculatedDirection =\n caretPosition < previousSelection[1] ? 'backward' : 'forward';\n const wasPreviouslyInserting =\n previousSelection[0] === previousSelection[1] &&\n previousSelection[0] < maxLength;\n if (\n calculatedDirection === 'backward' &&\n !wasPreviouslyInserting\n ) {\n offset = -1;\n }\n }\n\n calculatedStart = offset + caretPosition;\n calculatedEnd = offset + caretPosition + 1;\n }\n }\n\n if (\n calculatedStart !== -1 &&\n calculatedEnd !== -1 &&\n calculatedStart !== calculatedEnd\n ) {\n inputRef.current?.setSelectionRange(\n calculatedStart,\n calculatedEnd,\n calculatedDirection\n );\n }\n }\n\n const finalSelectionStart =\n calculatedStart !== -1 ? calculatedStart : selectionStart;\n const finalSelectionEnd =\n calculatedEnd !== -1 ? calculatedEnd : selectionEnd;\n const finalDirection = calculatedDirection;\n\n // Track actual caret position (before expansion) for active slot detection\n if (selectionStart !== null && selectionEnd !== null) {\n const isSingleCaret = selectionStart === selectionEnd;\n if (isSingleCaret) {\n setActualCaretPosition(selectionStart);\n } else {\n // When selection is expanded, use the start position as the caret\n setActualCaretPosition(finalSelectionStart);\n }\n } else {\n setActualCaretPosition(null);\n }\n\n setMirrorSelectionStart(finalSelectionStart);\n setMirrorSelectionEnd(finalSelectionEnd);\n inputMetadataRef.current.prev = [\n finalSelectionStart,\n finalSelectionEnd,\n finalDirection,\n ];\n };\n document.addEventListener('selectionchange', onDocumentSelectionChange, {\n capture: true,\n });\n\n // Set initial mirror state\n onDocumentSelectionChange();\n if (document.activeElement === input) {\n setIsFocused(true);\n }\n\n // Apply needed styles\n if (!document.getElementById('input-otp-style')) {\n const styleEl = document.createElement('style');\n styleEl.id = 'input-otp-style';\n document.head.appendChild(styleEl);\n\n if (styleEl.sheet) {\n const autofillStyles =\n 'background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;';\n\n safeInsertRule(\n styleEl.sheet,\n '[data-input-otp]::selection { background: transparent !important; color: transparent !important; }'\n );\n safeInsertRule(\n styleEl.sheet,\n `[data-input-otp]:autofill { ${autofillStyles} }`\n );\n safeInsertRule(\n styleEl.sheet,\n `[data-input-otp]:-webkit-autofill { ${autofillStyles} }`\n );\n // iOS\n safeInsertRule(\n styleEl.sheet,\n `@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }`\n );\n // PWM badges\n safeInsertRule(\n styleEl.sheet,\n `[data-input-otp] + * { pointer-events: all !important; }`\n );\n }\n }\n // Track root height\n const updateRootHeight = () => {\n if (container) {\n container.style.setProperty('--root-height', `${input.clientHeight}px`);\n }\n };\n updateRootHeight();\n const resizeObserver = new ResizeObserver(updateRootHeight);\n resizeObserver.observe(input);\n\n return () => {\n document.removeEventListener(\n 'selectionchange',\n onDocumentSelectionChange,\n { capture: true }\n );\n resizeObserver.disconnect();\n };\n }, []);\n\n /** Mirrors for UI rendering purpose only */\n const [isHoveringInput, setIsHoveringInput] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n const [mirrorSelectionStart, setMirrorSelectionStart] = useState<\n number | null\n >(null);\n const [mirrorSelectionEnd, setMirrorSelectionEnd] = useState<number | null>(\n null\n );\n const [actualCaretPosition, setActualCaretPosition] = useState<number | null>(\n null\n );\n\n /** Effects */\n useEffect(() => {\n syncTimeouts(() => {\n // Forcefully remove :autofill state\n inputRef.current?.dispatchEvent(new Event('input'));\n\n // Update the selection state\n const s = inputRef.current?.selectionStart ?? null;\n const e = inputRef.current?.selectionEnd ?? null;\n const dir = inputRef.current?.selectionDirection ?? 'none';\n if (s !== null && e !== null) {\n setMirrorSelectionStart(s);\n setMirrorSelectionEnd(e);\n // Track actual caret position (use start position as caret)\n setActualCaretPosition(s);\n inputMetadataRef.current.prev = [s, e, dir];\n }\n });\n }, [value, isFocused]);\n\n useEffect(() => {\n if (previousValue === undefined) {\n return;\n }\n\n if (\n value !== previousValue &&\n previousValue.length < maxLength &&\n value.length === maxLength\n ) {\n onComplete?.(value);\n }\n }, [maxLength, onComplete, previousValue, value]);\n\n // Track active slot changes\n const previousActiveSlot = useRef<number | null>(null);\n useEffect(() => {\n const activeSlotIndex =\n isFocused && actualCaretPosition !== null ? actualCaretPosition : null;\n\n if (activeSlotIndex !== previousActiveSlot.current) {\n previousActiveSlot.current = activeSlotIndex;\n onActiveSlotChange?.(activeSlotIndex);\n }\n }, [isFocused, actualCaretPosition, onActiveSlotChange]);\n\n const pwmb = usePasswordManagerBadge({\n containerRef,\n inputRef,\n pushPasswordManagerStrategy,\n isFocused,\n });\n\n /** Event handlers */\n const _changeListener = (e: ChangeEvent<HTMLInputElement>) => {\n const newValue = e.currentTarget.value.slice(0, maxLength);\n if (newValue.length > 0 && regexp && !regexp.test(newValue)) {\n e.preventDefault();\n return;\n }\n const maybeHasDeleted =\n typeof previousValue === 'string' &&\n newValue.length < previousValue.length;\n if (maybeHasDeleted) {\n // Since cutting/deleting text doesn't trigger\n // selectionchange event, we'll have to dispatch it manually.\n // NOTE: The following line also triggers when cmd+A then pasting\n // a value with smaller length, which is not ideal for performance.\n document.dispatchEvent(new Event('selectionchange'));\n }\n onChange(newValue);\n };\n const _focusListener = () => {\n if (inputRef.current) {\n const start = Math.min(inputRef.current.value.length, maxLength - 1);\n const end = inputRef.current.value.length;\n inputRef.current?.setSelectionRange(start, end);\n setMirrorSelectionStart(start);\n setMirrorSelectionEnd(end);\n }\n setIsFocused(true);\n };\n // Fix iOS pasting\n const _pasteListener = (e: ClipboardEvent<HTMLInputElement>) => {\n const input = inputRef.current;\n if (\n !pasteTransformer &&\n (!initialLoadRef.current.isIOS || !e.clipboardData || !input)\n ) {\n return;\n }\n\n const _content = e.clipboardData.getData('text/plain');\n const content = pasteTransformer ? pasteTransformer(_content) : _content;\n e.preventDefault();\n\n const start = inputRef.current?.selectionStart;\n const end = inputRef.current?.selectionEnd;\n\n const isReplacing = start !== end;\n\n const newValueUncapped = isReplacing\n ? value.slice(0, start ?? 0) + content + value.slice(end ?? 0) // Replacing\n : value.slice(0, start ?? 0) + content + value.slice(start ?? 0); // Inserting\n const newValue = newValueUncapped.slice(0, maxLength);\n\n if (newValue.length > 0 && regexp && !regexp.test(newValue)) {\n return;\n }\n\n if (input) {\n input.value = newValue;\n onChange(newValue);\n\n const _start = Math.min(newValue.length, maxLength - 1);\n const _end = newValue.length;\n\n input.setSelectionRange(_start, _end);\n setMirrorSelectionStart(_start);\n setMirrorSelectionEnd(_end);\n }\n };\n\n /** Styles - dynamic styles that can't be converted to Tailwind */\n const dynamicInputStyle: CSSProperties = {\n width: pwmb.willPushPWMBadge\n ? `calc(100% + ${pwmb.PWM_BADGE_SPACE_WIDTH})`\n : '100%',\n clipPath: pwmb.willPushPWMBadge\n ? `inset(0 ${pwmb.PWM_BADGE_SPACE_WIDTH} 0 0)`\n : undefined,\n fontSize: 'var(--root-height)',\n };\n\n /** Rendering */\n const renderedInput = (\n <input\n autoComplete={props.autoComplete || 'one-time-code'}\n {...props}\n data-input-otp\n data-input-otp-placeholder-shown={value.length === 0 || undefined}\n data-input-otp-mss={mirrorSelectionStart}\n data-input-otp-mse={mirrorSelectionEnd}\n inputMode={inputMode}\n pattern={regexp?.source}\n aria-placeholder={placeholder}\n className=\"pointer-events-auto absolute inset-0 -z-10 flex h-full border-0 border-transparent bg-transparent text-center font-mono text-transparent tabular-nums leading-none tracking-[-.5em] caret-transparent opacity-100 shadow-none outline-none\"\n style={dynamicInputStyle}\n maxLength={maxLength}\n value={value}\n ref={inputRef}\n onPaste={(e) => {\n _pasteListener(e);\n props.onPaste?.(e);\n }}\n onChange={_changeListener}\n onMouseOver={(e) => {\n setIsHoveringInput(true);\n props.onMouseOver?.(e);\n }}\n onMouseLeave={(e) => {\n setIsHoveringInput(false);\n props.onMouseLeave?.(e);\n }}\n onKeyDown={(e) => {\n // Track arrow key navigation to ensure active slot updates correctly\n if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') {\n // Use requestAnimationFrame to check selection after browser has processed the key\n requestAnimationFrame(() => {\n const input = inputRef.current;\n if (input && document.activeElement === input) {\n const s = input.selectionStart;\n const end = input.selectionEnd;\n if (s !== null && end !== null) {\n // Update actual caret position - use start position as caret\n setActualCaretPosition(s);\n }\n }\n });\n }\n props.onKeyDown?.(e);\n }}\n onFocus={(e) => {\n _focusListener();\n props.onFocus?.(e);\n }}\n onBlur={(e) => {\n setIsFocused(false);\n props.onBlur?.(e);\n }}\n />\n );\n\n const setSelection = (index: number) => {\n const input = inputRef.current;\n if (!input || props.disabled) {\n return;\n }\n\n // Clamp index to valid range\n const clampedIndex = Math.max(0, Math.min(index, maxLength - 1));\n\n // Focus the input if not already focused\n if (document.activeElement !== input) {\n input.focus();\n }\n\n // Set selection to the clicked slot\n // If there's a character at that position, select it; otherwise just position the caret\n const hasChar = value[clampedIndex] !== undefined;\n const start = clampedIndex;\n const end = hasChar ? clampedIndex + 1 : clampedIndex;\n\n input.setSelectionRange(start, end);\n setMirrorSelectionStart(start);\n setMirrorSelectionEnd(end);\n setIsFocused(true);\n };\n\n const contextValue: RenderProps = {\n slots: Array.from({ length: maxLength }).map((_, slotIdx) => {\n const isActive =\n isFocused &&\n mirrorSelectionStart !== null &&\n mirrorSelectionEnd !== null &&\n ((mirrorSelectionStart === mirrorSelectionEnd &&\n slotIdx === mirrorSelectionStart) ||\n (slotIdx >= mirrorSelectionStart && slotIdx < mirrorSelectionEnd));\n\n const char = value[slotIdx] !== undefined ? value[slotIdx] : null;\n const placeholderChar =\n value[0] !== undefined ? null : (placeholder?.[slotIdx] ?? null);\n\n return {\n char,\n placeholderChar,\n isActive,\n hasFakeCaret: isActive && char === null,\n };\n }),\n isFocused,\n isHovering: !props.disabled && isHoveringInput,\n setSelection,\n };\n\n const renderedChildren =\n render !== undefined ? (\n render(contextValue)\n ) : (\n <OTPInputContext.Provider value={contextValue}>\n {children}\n </OTPInputContext.Provider>\n );\n\n return (\n <>\n {noScriptCSSFallback !== null && (\n <noscript>\n <style>{noScriptCSSFallback}</style>\n </noscript>\n )}\n\n <div\n ref={containerRef}\n className={cn(\n 'relative',\n props.disabled ? 'cursor-default' : 'cursor-text',\n containerClassName\n )}\n >\n {renderedChildren}\n\n <div className=\"absolute inset-0\">{renderedInput}</div>\n </div>\n </>\n );\n};\n\n// ---------------- Root ----------------\n\ntype InputOTPProps = Omit<ComponentProps<typeof OTPInput>, 'children'>;\n\nexport const inputSlotVariants = cva('block text-center', {\n variants: {\n size: {\n sm: 'h-4 w-3 text-sm',\n md: 'h-5 w-4 text-base',\n lg: 'h-6 w-5 text-lg',\n xl: 'h-7 w-6 text-xl',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\nexport const InputOTP: FC<InputOTPProps> = ({\n className,\n render,\n ...props\n}) => (\n <OTPInput\n containerClassName=\"relative flex items-center gap-2 has-disabled:opacity-50\"\n className={cn('disabled:cursor-not-allowed', className)}\n render={render!}\n {...props}\n />\n);\n\n// ---------------- Group ----------------\n\nexport const InputOTPGroup = ({\n className,\n ...props\n}: ComponentProps<'div'>) => (\n <div className={cn('z-10 flex items-center gap-3', className)} {...props} />\n);\n\n// ---------------- Slot ----------------\n\ntype InputOTPSlotProps = Omit<ButtonProps, 'variant' | 'label'> & {\n index: number;\n};\n\nexport const InputOTPSlot: FC<InputOTPSlotProps> = ({\n index,\n className,\n onClick,\n onKeyDown,\n ...props\n}) => {\n const inputOTPContext = useContext(OTPInputContext);\n const { char, isActive } = inputOTPContext?.slots[index] ?? {};\n const { setSelection } = inputOTPContext ?? {};\n\n const handleClick = (e: MouseEvent<HTMLButtonElement>) => {\n setSelection?.(index);\n onClick?.(e);\n };\n\n const handleKeyDown = (e: KeyboardEvent<HTMLButtonElement>) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n setSelection?.(index);\n }\n onKeyDown?.(e);\n };\n\n return (\n <Button\n isSelected={isActive}\n variant=\"input\"\n color=\"custom\"\n tabIndex={-1}\n className={cn('relative z-10 px-2!', isActive && 'ring-4!', className)}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n label={null}\n {...props}\n >\n {/* value */}\n <span className=\"relative z-10 flex h-6 w-4 items-center justify-center\">\n {char}\n </span>\n </Button>\n );\n};\n\n// ---------------- Separator ----------------\n\nexport const InputOTPSeparator: FC<ComponentProps<'div'>> = (props) => (\n <div\n aria-hidden\n className=\"z-0 table h-0.5 w-3 rounded-full text-text/50\"\n {...props}\n >\n <MinusIcon />\n </div>\n);\n\nexport const InputIndicator: FC<ComponentProps<'div'>> = (props) => (\n <div\n data-indicator\n className=\"absolute top-0 z-0 h-full w-auto rounded-xl bg-text/20 ring-4 ring-text/20 transition-[left,width] duration-300 ease-in-out [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl motion-reduce:transition-none\"\n {...props}\n />\n);\n"],"mappings":";;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,EAC1C,WACA,QACA,GAAG,YAEH,oBAAC,UAAD;CACE,oBAAmB;CACnB,WAAW,GAAG,+BAA+B,UAAU;CAC/C;CACR,GAAI;CACJ;AAKJ,MAAa,iBAAiB,EAC5B,WACA,GAAG,YAEH,oBAAC,OAAD;CAAK,WAAW,GAAG,gCAAgC,UAAU;CAAE,GAAI;CAAS;AAS9E,MAAa,gBAAuC,EAClD,OACA,WACA,SACA,WACA,GAAG,YACC;CACJ,MAAM,kBAAkB,WAAW,gBAAgB;CACnD,MAAM,EAAE,MAAM,aAAa,iBAAiB,MAAM,UAAU,EAAE;CAC9D,MAAM,EAAE,iBAAiB,mBAAmB,EAAE;CAE9C,MAAM,eAAe,MAAqC;EACxD,eAAe,MAAM;EACrB,UAAU,EAAE;;CAGd,MAAM,iBAAiB,MAAwC;EAC7D,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,KAAK;GACtC,EAAE,gBAAgB;GAClB,eAAe,MAAM;;EAEvB,YAAY,EAAE;;CAGhB,OACE,oBAAC,QAAD;EACE,YAAY;EACZ,SAAQ;EACR,OAAM;EACN,UAAU;EACV,WAAW,GAAG,uBAAuB,YAAY,WAAW,UAAU;EACtE,SAAS;EACT,WAAW;EACX,OAAO;EACP,GAAI;YAGJ,oBAAC,QAAD;GAAM,WAAU;aACb;GACI;EACA;;AAMb,MAAa,qBAAgD,UAC3D,oBAAC,OAAD;CACE;CACA,WAAU;CACV,GAAI;WAEJ,oBAAC,WAAD,EAAa;CACT;AAGR,MAAa,kBAA6C,UACxD,oBAAC,OAAD;CACE;CACA,WAAU;CACV,GAAI;CACJ"}
1
+ {"version":3,"file":"OTPInput.mjs","names":[],"sources":["../../../../src/components/Input/OTPInput.tsx"],"sourcesContent":["'use client';\n\n/**\n * This component is a fork of https://github.com/guilhermerodz/input-otp\n */\n\nimport { cn } from '@utils/cn';\nimport { cva } from 'class-variance-authority';\nimport { MinusIcon } from 'lucide-react';\nimport {\n type ChangeEvent,\n type ClipboardEvent,\n type ComponentProps,\n type CSSProperties,\n createContext,\n type FC,\n type InputHTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n type RefObject,\n useContext,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { Button, type ButtonProps } from '../Button';\n\n// ---------------- Utilities ----------------\n\nconst syncTimeouts = (cb: (...args: any[]) => unknown): number[] => {\n const t1 = setTimeout(cb, 0); // For faster machines\n const t2 = setTimeout(cb, 1_0);\n const t3 = setTimeout(cb, 5_0);\n return [t1, t2, t3];\n};\n\nconst safeInsertRule = (sheet: CSSStyleSheet, rule: string) => {\n try {\n sheet.insertRule(rule);\n } catch {\n console.error('input-otp could not insert CSS rule:', rule);\n }\n};\n\n// Decided to go with <noscript>\n// instead of `scripting` CSS media query\n// because it's a fallback for initial page load\n// and the <script> tag won't be loaded\n// unless the user has JS disabled.\nconst NOSCRIPT_CSS_FALLBACK = `\n[data-input-otp] {\n --nojs-bg: white !important;\n --nojs-fg: black !important;\n\n background-color: var(--nojs-bg) !important;\n color: var(--nojs-fg) !important;\n caret-color: var(--nojs-fg) !important;\n letter-spacing: .25em !important;\n text-align: center !important;\n border: 1px solid var(--nojs-fg) !important;\n border-radius: 4px !important;\n width: 100% !important;\n}\n@media (prefers-color-scheme: dark) {\n [data-input-otp] {\n --nojs-bg: black !important;\n --nojs-fg: white !important;\n }\n}`;\n\n// ---------------- Constants ----------------\n\nconst PWM_BADGE_MARGIN_RIGHT = 18;\nconst PWM_BADGE_SPACE_WIDTH_PX = 40;\nconst PWM_BADGE_SPACE_WIDTH = `${PWM_BADGE_SPACE_WIDTH_PX}px` as const;\n\nconst PASSWORD_MANAGERS_SELECTORS = [\n '[data-lastpass-icon-root]', // LastPass\n 'com-1password-button', // 1Password\n '[data-dashlanecreated]', // Dashlane\n '[style$=\"2147483647 !important;\"]', // Bitwarden\n].join(',');\n\n// ---------------- Types ----------------\n\nexport type SlotProps = {\n isActive: boolean;\n char: string | null;\n placeholderChar: string | null;\n hasFakeCaret: boolean;\n};\n\nexport type RenderProps = {\n slots: SlotProps[];\n isFocused: boolean;\n isHovering: boolean;\n setSelection: (index: number) => void;\n};\n\ntype OverrideProps<T, R> = Omit<T, keyof R> & R;\n\ntype OTPInputBaseProps = OverrideProps<\n InputHTMLAttributes<HTMLInputElement>,\n {\n value?: string;\n onChange?: (newValue: string) => unknown;\n\n maxLength: number;\n\n onComplete?: (...args: any[]) => unknown;\n onActiveSlotChange?: (activeSlotIndex: number | null) => unknown;\n pushPasswordManagerStrategy?: 'increase-width' | 'none';\n pasteTransformer?: (pasted: string) => string;\n\n containerClassName?: string;\n\n noScriptCSSFallback?: string | null;\n }\n>;\n\ntype InputOTPRenderFn = (props: RenderProps) => ReactNode;\n\nexport type OTPInputProps = OTPInputBaseProps &\n (\n | {\n render: InputOTPRenderFn;\n children?: never;\n }\n | {\n render?: never;\n children: ReactNode;\n }\n );\n\n// ---------------- Hooks ----------------\n\nexport const usePasswordManagerBadge = ({\n containerRef,\n inputRef,\n pushPasswordManagerStrategy,\n isFocused,\n}: {\n containerRef: RefObject<HTMLDivElement | null>;\n inputRef: RefObject<HTMLInputElement | null>;\n pushPasswordManagerStrategy: OTPInputProps['pushPasswordManagerStrategy'];\n isFocused: boolean;\n}) => {\n /** Password managers have a badge\n * and I'll use this state to push them\n * outside the input */\n const [hasPWMBadge, setHasPWMBadge] = useState(false);\n const [hasPWMBadgeSpace, setHasPWMBadgeSpace] = useState(false);\n const [done, setDone] = useState(false);\n\n const willPushPWMBadge =\n pushPasswordManagerStrategy === 'none'\n ? false\n : (pushPasswordManagerStrategy === 'increase-width' ||\n // TODO: remove 'experimental-no-flickering' support in 2.0.0\n pushPasswordManagerStrategy === 'experimental-no-flickering') &&\n hasPWMBadge &&\n hasPWMBadgeSpace;\n\n const trackPWMBadge = () => {\n const container = containerRef.current;\n const input = inputRef.current;\n if (\n !container ||\n !input ||\n done ||\n pushPasswordManagerStrategy === 'none'\n ) {\n return;\n }\n\n const elementToCompare = container;\n\n // Get the top right-center point of the container.\n // That is usually where most password managers place their badge.\n const rightCornerX =\n elementToCompare.getBoundingClientRect().left +\n elementToCompare.offsetWidth;\n const centereredY =\n elementToCompare.getBoundingClientRect().top +\n elementToCompare.offsetHeight / 2;\n const x = rightCornerX - PWM_BADGE_MARGIN_RIGHT;\n const y = centereredY;\n\n // Do an extra search to check for famous password managers\n const pmws = document.querySelectorAll(PASSWORD_MANAGERS_SELECTORS);\n\n // If no password manager is automatically detect,\n // we'll try to dispatch document.elementFromPoint\n // to identify badges\n if (pmws.length === 0) {\n const maybeBadgeEl = document.elementFromPoint(x, y);\n\n // If the found element is the input itself,\n // then we assume it's not a password manager badge.\n // We are not sure. Most times that means there isn't a badge.\n if (maybeBadgeEl === container) {\n return;\n }\n }\n\n setHasPWMBadge(true);\n setDone(true);\n };\n\n useEffect(() => {\n const container = containerRef.current;\n if (!container || pushPasswordManagerStrategy === 'none') {\n return;\n }\n\n // Check if the PWM area is 100% visible\n const checkHasSpace = () => {\n const viewportWidth = window.innerWidth;\n const distanceToRightEdge =\n viewportWidth - container.getBoundingClientRect().right;\n setHasPWMBadgeSpace(distanceToRightEdge >= PWM_BADGE_SPACE_WIDTH_PX);\n };\n\n checkHasSpace();\n const interval = setInterval(checkHasSpace, 1000);\n\n return () => {\n clearInterval(interval);\n };\n }, [containerRef, pushPasswordManagerStrategy]);\n\n useEffect(() => {\n const _isFocused = isFocused || document.activeElement === inputRef.current;\n\n if (pushPasswordManagerStrategy === 'none' || !_isFocused) {\n return;\n }\n const t1 = setTimeout(trackPWMBadge, 0);\n const t2 = setTimeout(trackPWMBadge, 2000);\n const t3 = setTimeout(trackPWMBadge, 5000);\n const t4 = setTimeout(() => {\n setDone(true);\n }, 6000);\n return () => {\n clearTimeout(t1);\n clearTimeout(t2);\n clearTimeout(t3);\n clearTimeout(t4);\n };\n }, [inputRef, isFocused, pushPasswordManagerStrategy]);\n\n return { hasPWMBadge, willPushPWMBadge, PWM_BADGE_SPACE_WIDTH };\n};\n\nexport const usePrevious = <T,>(value: T): T | undefined => {\n const ref = useRef<T | undefined>(undefined);\n useEffect(() => {\n ref.current = value;\n });\n return ref.current;\n};\n\n// ---------------- Context ----------------\n\nexport const OTPInputContext = createContext<RenderProps>({} as RenderProps);\n\n// ---------------- Core Component ----------------\n\nexport const OTPInput: FC<OTPInputProps> = ({\n value: uncheckedValue,\n onChange: uncheckedOnChange,\n maxLength,\n pattern,\n placeholder,\n inputMode = 'numeric',\n onComplete,\n onActiveSlotChange,\n pushPasswordManagerStrategy = 'increase-width',\n pasteTransformer,\n containerClassName,\n noScriptCSSFallback = NOSCRIPT_CSS_FALLBACK,\n render,\n children,\n ...props\n}) => {\n // Only used when `value` state is not provided\n const [internalValue, setInternalValue] = useState(\n typeof props.defaultValue === 'string' ? props.defaultValue : ''\n );\n\n // Definitions\n const value = uncheckedValue ?? internalValue;\n const previousValue = usePrevious(value);\n const onChange = (newValue: string) => {\n uncheckedOnChange?.(newValue);\n setInternalValue(newValue);\n };\n const regexp =\n pattern !== undefined\n ? typeof pattern === 'string'\n ? new RegExp(pattern)\n : pattern\n : null;\n\n /** useRef */\n const inputRef = useRef<HTMLInputElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const initialLoadRef = useRef({\n value,\n onChange,\n isIOS:\n typeof window !== 'undefined' &&\n window?.CSS?.supports?.('-webkit-touch-callout', 'none'),\n });\n const inputMetadataRef = useRef<{\n prev: [number | null, number | null, 'none' | 'forward' | 'backward'];\n }>({\n prev: [\n inputRef.current?.selectionStart ?? null,\n inputRef.current?.selectionEnd ?? null,\n inputRef.current?.selectionDirection ?? 'none',\n ],\n });\n useEffect(() => {\n const input = inputRef.current;\n const container = containerRef.current;\n\n if (!input || !container) {\n return;\n }\n\n // Sync input value\n if (initialLoadRef.current.value !== input.value) {\n initialLoadRef.current.onChange(input.value);\n }\n\n // Previous selection\n inputMetadataRef.current.prev = [\n input.selectionStart,\n input.selectionEnd,\n input.selectionDirection ?? 'none',\n ];\n const onDocumentSelectionChange = () => {\n if (document.activeElement !== input) {\n setMirrorSelectionStart(null);\n setMirrorSelectionEnd(null);\n setActualCaretPosition(null);\n return;\n }\n\n const selectionStart = input.selectionStart;\n const selectionEnd = input.selectionEnd;\n const selectionDirection = input.selectionDirection;\n const maxLength = input.maxLength;\n const value = input.value;\n const previousSelection = inputMetadataRef.current.prev;\n\n let calculatedStart = -1;\n let calculatedEnd = -1;\n let calculatedDirection: 'forward' | 'backward' | 'none' =\n selectionDirection ?? 'none';\n\n if (\n value.length !== 0 &&\n selectionStart !== null &&\n selectionEnd !== null\n ) {\n const isSingleCaret = selectionStart === selectionEnd;\n const isInsertMode =\n selectionStart === value.length && value.length < maxLength;\n\n if (isSingleCaret && !isInsertMode) {\n const caretPosition = selectionStart;\n if (caretPosition === 0) {\n calculatedStart = 0;\n calculatedEnd = 1;\n calculatedDirection = 'forward';\n } else if (caretPosition === maxLength) {\n calculatedStart = caretPosition - 1;\n calculatedEnd = caretPosition;\n calculatedDirection = 'backward';\n } else if (maxLength > 1 && value.length > 1) {\n let offset = 0;\n if (\n previousSelection[0] !== null &&\n previousSelection[1] !== null\n ) {\n calculatedDirection =\n caretPosition < previousSelection[1] ? 'backward' : 'forward';\n const wasPreviouslyInserting =\n previousSelection[0] === previousSelection[1] &&\n previousSelection[0] < maxLength;\n if (\n calculatedDirection === 'backward' &&\n !wasPreviouslyInserting\n ) {\n offset = -1;\n }\n }\n\n calculatedStart = offset + caretPosition;\n calculatedEnd = offset + caretPosition + 1;\n }\n }\n\n if (\n calculatedStart !== -1 &&\n calculatedEnd !== -1 &&\n calculatedStart !== calculatedEnd\n ) {\n inputRef.current?.setSelectionRange(\n calculatedStart,\n calculatedEnd,\n calculatedDirection\n );\n }\n }\n\n const finalSelectionStart =\n calculatedStart !== -1 ? calculatedStart : selectionStart;\n const finalSelectionEnd =\n calculatedEnd !== -1 ? calculatedEnd : selectionEnd;\n const finalDirection = calculatedDirection;\n\n // Track actual caret position (before expansion) for active slot detection\n if (selectionStart !== null && selectionEnd !== null) {\n const isSingleCaret = selectionStart === selectionEnd;\n if (isSingleCaret) {\n setActualCaretPosition(selectionStart);\n } else {\n // When selection is expanded, use the start position as the caret\n setActualCaretPosition(finalSelectionStart);\n }\n } else {\n setActualCaretPosition(null);\n }\n\n setMirrorSelectionStart(finalSelectionStart);\n setMirrorSelectionEnd(finalSelectionEnd);\n inputMetadataRef.current.prev = [\n finalSelectionStart,\n finalSelectionEnd,\n finalDirection,\n ];\n };\n document.addEventListener('selectionchange', onDocumentSelectionChange, {\n capture: true,\n });\n\n // Set initial mirror state\n onDocumentSelectionChange();\n if (document.activeElement === input) {\n setIsFocused(true);\n }\n\n // Apply needed styles\n if (!document.getElementById('input-otp-style')) {\n const styleEl = document.createElement('style');\n styleEl.id = 'input-otp-style';\n document.head.appendChild(styleEl);\n\n if (styleEl.sheet) {\n const autofillStyles =\n 'background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;';\n\n safeInsertRule(\n styleEl.sheet,\n '[data-input-otp]::selection { background: transparent !important; color: transparent !important; }'\n );\n safeInsertRule(\n styleEl.sheet,\n `[data-input-otp]:autofill { ${autofillStyles} }`\n );\n safeInsertRule(\n styleEl.sheet,\n `[data-input-otp]:-webkit-autofill { ${autofillStyles} }`\n );\n // iOS\n safeInsertRule(\n styleEl.sheet,\n `@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }`\n );\n // PWM badges\n safeInsertRule(\n styleEl.sheet,\n `[data-input-otp] + * { pointer-events: all !important; }`\n );\n }\n }\n // Track root height\n const updateRootHeight = () => {\n if (container) {\n container.style.setProperty('--root-height', `${input.clientHeight}px`);\n }\n };\n updateRootHeight();\n const resizeObserver = new ResizeObserver(updateRootHeight);\n resizeObserver.observe(input);\n\n return () => {\n document.removeEventListener(\n 'selectionchange',\n onDocumentSelectionChange,\n { capture: true }\n );\n resizeObserver.disconnect();\n };\n }, []);\n\n /** Mirrors for UI rendering purpose only */\n const [isHoveringInput, setIsHoveringInput] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n const [mirrorSelectionStart, setMirrorSelectionStart] = useState<\n number | null\n >(null);\n const [mirrorSelectionEnd, setMirrorSelectionEnd] = useState<number | null>(\n null\n );\n const [actualCaretPosition, setActualCaretPosition] = useState<number | null>(\n null\n );\n\n /** Effects */\n useEffect(() => {\n syncTimeouts(() => {\n // Forcefully remove :autofill state\n inputRef.current?.dispatchEvent(new Event('input'));\n\n // Update the selection state\n const s = inputRef.current?.selectionStart ?? null;\n const e = inputRef.current?.selectionEnd ?? null;\n const dir = inputRef.current?.selectionDirection ?? 'none';\n if (s !== null && e !== null) {\n setMirrorSelectionStart(s);\n setMirrorSelectionEnd(e);\n // Track actual caret position (use start position as caret)\n setActualCaretPosition(s);\n inputMetadataRef.current.prev = [s, e, dir];\n }\n });\n }, [value, isFocused]);\n\n useEffect(() => {\n if (previousValue === undefined) {\n return;\n }\n\n if (\n value !== previousValue &&\n previousValue.length < maxLength &&\n value.length === maxLength\n ) {\n onComplete?.(value);\n }\n }, [maxLength, onComplete, previousValue, value]);\n\n // Track active slot changes\n const previousActiveSlot = useRef<number | null>(null);\n useEffect(() => {\n const activeSlotIndex =\n isFocused && actualCaretPosition !== null ? actualCaretPosition : null;\n\n if (activeSlotIndex !== previousActiveSlot.current) {\n previousActiveSlot.current = activeSlotIndex;\n onActiveSlotChange?.(activeSlotIndex);\n }\n }, [isFocused, actualCaretPosition, onActiveSlotChange]);\n\n const pwmb = usePasswordManagerBadge({\n containerRef,\n inputRef,\n pushPasswordManagerStrategy,\n isFocused,\n });\n\n /** Event handlers */\n const _changeListener = (e: ChangeEvent<HTMLInputElement>) => {\n const newValue = e.currentTarget.value.slice(0, maxLength);\n if (newValue.length > 0 && regexp && !regexp.test(newValue)) {\n e.preventDefault();\n return;\n }\n const maybeHasDeleted =\n typeof previousValue === 'string' &&\n newValue.length < previousValue.length;\n if (maybeHasDeleted) {\n // Since cutting/deleting text doesn't trigger\n // selectionchange event, we'll have to dispatch it manually.\n // NOTE: The following line also triggers when cmd+A then pasting\n // a value with smaller length, which is not ideal for performance.\n document.dispatchEvent(new Event('selectionchange'));\n }\n onChange(newValue);\n };\n const _focusListener = () => {\n if (inputRef.current) {\n const start = Math.min(inputRef.current.value.length, maxLength - 1);\n const end = inputRef.current.value.length;\n inputRef.current?.setSelectionRange(start, end);\n setMirrorSelectionStart(start);\n setMirrorSelectionEnd(end);\n }\n setIsFocused(true);\n };\n // Fix iOS pasting\n const _pasteListener = (e: ClipboardEvent<HTMLInputElement>) => {\n const input = inputRef.current;\n if (\n !pasteTransformer &&\n (!initialLoadRef.current.isIOS || !e.clipboardData || !input)\n ) {\n return;\n }\n\n const _content = e.clipboardData.getData('text/plain');\n const content = pasteTransformer ? pasteTransformer(_content) : _content;\n e.preventDefault();\n\n const start = inputRef.current?.selectionStart;\n const end = inputRef.current?.selectionEnd;\n\n const isReplacing = start !== end;\n\n const newValueUncapped = isReplacing\n ? value.slice(0, start ?? 0) + content + value.slice(end ?? 0) // Replacing\n : value.slice(0, start ?? 0) + content + value.slice(start ?? 0); // Inserting\n const newValue = newValueUncapped.slice(0, maxLength);\n\n if (newValue.length > 0 && regexp && !regexp.test(newValue)) {\n return;\n }\n\n if (input) {\n input.value = newValue;\n onChange(newValue);\n\n const _start = Math.min(newValue.length, maxLength - 1);\n const _end = newValue.length;\n\n input.setSelectionRange(_start, _end);\n setMirrorSelectionStart(_start);\n setMirrorSelectionEnd(_end);\n }\n };\n\n /** Styles - dynamic styles that can't be converted to Tailwind */\n const dynamicInputStyle: CSSProperties = {\n width: pwmb.willPushPWMBadge\n ? `calc(100% + ${pwmb.PWM_BADGE_SPACE_WIDTH})`\n : '100%',\n clipPath: pwmb.willPushPWMBadge\n ? `inset(0 ${pwmb.PWM_BADGE_SPACE_WIDTH} 0 0)`\n : undefined,\n fontSize: 'var(--root-height)',\n };\n\n /** Rendering */\n const renderedInput = (\n <input\n autoComplete={props.autoComplete || 'one-time-code'}\n {...props}\n data-input-otp\n data-input-otp-placeholder-shown={value.length === 0 || undefined}\n data-input-otp-mss={mirrorSelectionStart}\n data-input-otp-mse={mirrorSelectionEnd}\n inputMode={inputMode}\n pattern={regexp?.source}\n aria-placeholder={placeholder}\n className=\"pointer-events-auto absolute inset-0 -z-10 flex h-full border-0 border-transparent bg-transparent text-center font-mono text-transparent tabular-nums leading-none tracking-[-.5em] caret-transparent opacity-100 shadow-none outline-none\"\n style={dynamicInputStyle}\n maxLength={maxLength}\n value={value}\n ref={inputRef}\n onPaste={(e) => {\n _pasteListener(e);\n props.onPaste?.(e);\n }}\n onChange={_changeListener}\n onMouseOver={(e) => {\n setIsHoveringInput(true);\n props.onMouseOver?.(e);\n }}\n onMouseLeave={(e) => {\n setIsHoveringInput(false);\n props.onMouseLeave?.(e);\n }}\n onKeyDown={(e) => {\n // Track arrow key navigation to ensure active slot updates correctly\n if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') {\n // Use requestAnimationFrame to check selection after browser has processed the key\n requestAnimationFrame(() => {\n const input = inputRef.current;\n if (input && document.activeElement === input) {\n const s = input.selectionStart;\n const end = input.selectionEnd;\n if (s !== null && end !== null) {\n // Update actual caret position - use start position as caret\n setActualCaretPosition(s);\n }\n }\n });\n }\n props.onKeyDown?.(e);\n }}\n onFocus={(e) => {\n _focusListener();\n props.onFocus?.(e);\n }}\n onBlur={(e) => {\n setIsFocused(false);\n props.onBlur?.(e);\n }}\n />\n );\n\n const setSelection = (index: number) => {\n const input = inputRef.current;\n if (!input || props.disabled) {\n return;\n }\n\n // Clamp index to valid range\n const clampedIndex = Math.max(0, Math.min(index, maxLength - 1));\n\n // Focus the input if not already focused\n if (document.activeElement !== input) {\n input.focus();\n }\n\n // Set selection to the clicked slot\n // If there's a character at that position, select it; otherwise just position the caret\n const hasChar = value[clampedIndex] !== undefined;\n const start = clampedIndex;\n const end = hasChar ? clampedIndex + 1 : clampedIndex;\n\n input.setSelectionRange(start, end);\n setMirrorSelectionStart(start);\n setMirrorSelectionEnd(end);\n setIsFocused(true);\n };\n\n const contextValue: RenderProps = {\n slots: Array.from({ length: maxLength }).map((_, slotIdx) => {\n const isActive =\n isFocused &&\n mirrorSelectionStart !== null &&\n mirrorSelectionEnd !== null &&\n ((mirrorSelectionStart === mirrorSelectionEnd &&\n slotIdx === mirrorSelectionStart) ||\n (slotIdx >= mirrorSelectionStart && slotIdx < mirrorSelectionEnd));\n\n const char = value[slotIdx] !== undefined ? value[slotIdx] : null;\n const placeholderChar =\n value[0] !== undefined ? null : (placeholder?.[slotIdx] ?? null);\n\n return {\n char,\n placeholderChar,\n isActive,\n hasFakeCaret: isActive && char === null,\n };\n }),\n isFocused,\n isHovering: !props.disabled && isHoveringInput,\n setSelection,\n };\n\n const renderedChildren =\n render !== undefined ? (\n render(contextValue)\n ) : (\n <OTPInputContext.Provider value={contextValue}>\n {children}\n </OTPInputContext.Provider>\n );\n\n return (\n <>\n {noScriptCSSFallback !== null && (\n <noscript>\n <style>{noScriptCSSFallback}</style>\n </noscript>\n )}\n\n <div\n ref={containerRef}\n className={cn(\n 'relative',\n props.disabled ? 'cursor-default' : 'cursor-text',\n containerClassName\n )}\n >\n {renderedChildren}\n\n <div className=\"absolute inset-0\">{renderedInput}</div>\n </div>\n </>\n );\n};\n\n// ---------------- Root ----------------\n\ntype InputOTPProps = Omit<ComponentProps<typeof OTPInput>, 'children'>;\n\nexport const inputSlotVariants = cva('block text-center', {\n variants: {\n size: {\n sm: 'h-4 w-3 text-sm',\n md: 'h-5 w-4 text-base',\n lg: 'h-6 w-5 text-lg',\n xl: 'h-7 w-6 text-xl',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\nexport const InputOTP: FC<InputOTPProps> = ({\n className,\n render,\n ...props\n}) => (\n <OTPInput\n containerClassName=\"relative flex items-center gap-2 has-disabled:opacity-50\"\n className={cn('disabled:cursor-not-allowed', className)}\n render={render!}\n {...props}\n />\n);\n\n// ---------------- Group ----------------\n\nexport const InputOTPGroup = ({\n className,\n ...props\n}: ComponentProps<'div'>) => (\n <div className={cn('z-10 flex items-center gap-3', className)} {...props} />\n);\n\n// ---------------- Slot ----------------\n\ntype InputOTPSlotProps = Omit<ButtonProps, 'variant' | 'label'> & {\n index: number;\n};\n\nexport const InputOTPSlot: FC<InputOTPSlotProps> = ({\n index,\n className,\n onClick,\n onKeyDown,\n ...props\n}) => {\n const inputOTPContext = useContext(OTPInputContext);\n const { char, isActive } = inputOTPContext?.slots[index] ?? {};\n const { setSelection } = inputOTPContext ?? {};\n\n const handleClick = (e: MouseEvent<HTMLButtonElement>) => {\n setSelection?.(index);\n onClick?.(e);\n };\n\n const handleKeyDown = (e: KeyboardEvent<HTMLButtonElement>) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n setSelection?.(index);\n }\n onKeyDown?.(e);\n };\n\n return (\n <Button\n isSelected={isActive}\n variant=\"input\"\n color=\"custom\"\n tabIndex={-1}\n className={cn('relative z-10 px-2!', isActive && 'ring-4!', className)}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n label={null}\n {...props}\n >\n {/* value */}\n <span className=\"relative z-10 flex h-6 w-4 items-center justify-center\">\n {char}\n </span>\n </Button>\n );\n};\n\n// ---------------- Separator ----------------\n\nexport const InputOTPSeparator: FC<ComponentProps<'div'>> = (props) => (\n <div\n aria-hidden\n className=\"z-0 table h-0.5 w-3 rounded-full text-text/50\"\n {...props}\n >\n <MinusIcon />\n </div>\n);\n\nexport const InputIndicator: FC<ComponentProps<'div'>> = (props) => (\n <div\n data-indicator\n className=\"absolute top-0 z-0 h-full w-auto rounded-xl bg-text/20 ring-4 ring-text/20 transition-[left,width] duration-300 ease-in-out [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl motion-reduce:transition-none\"\n {...props}\n />\n);\n"],"mappings":";;;;;;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"file":"SearchInput.mjs","names":[],"sources":["../../../../src/components/Input/SearchInput.tsx"],"sourcesContent":["import { cn } from '@utils/cn';\nimport { Search } from 'lucide-react';\nimport { Input, type InputProps } from './Input';\n\nexport const SearchInput = ({ className, ...props }: InputProps) => (\n <div className=\"relative flex w-full items-center gap-1\">\n <Search className=\"absolute left-2 size-4\" />\n <Input {...props} type=\"search\" className={cn('pl-8', className)} />\n </div>\n);\n"],"mappings":";;;;;;AAIA,MAAa,eAAe,EAAE,WAAW,GAAG,YAC1C,qBAAC,OAAD;CAAK,WAAU;WAAf,CACE,oBAAC,QAAD,EAAQ,WAAU,0BAA2B,GAC7C,oBAAC,OAAD;EAAO,GAAI;EAAO,MAAK;EAAS,WAAW,GAAG,QAAQ,UAAU;EAAI,EAChE"}
1
+ {"version":3,"file":"SearchInput.mjs","names":[],"sources":["../../../../src/components/Input/SearchInput.tsx"],"sourcesContent":["import { cn } from '@utils/cn';\nimport { Search } from 'lucide-react';\nimport { Input, type InputProps } from './Input';\n\nexport const SearchInput = ({ className, ...props }: InputProps) => (\n <div className=\"relative flex w-full items-center gap-1\">\n <Search className=\"absolute left-2 size-4\" />\n <Input {...props} type=\"search\" className={cn('pl-8', className)} />\n </div>\n);\n"],"mappings":";;;;;;AAIA,MAAa,eAAe,EAAE,WAAW,GAAG,YAC1C,qBAAC,OAAD;CAAK,WAAU;WAAf,CACE,oBAAC,QAAD,EAAQ,WAAU,yBAA0B,IAC5C,oBAAC,OAAD;EAAO,GAAI;EAAO,MAAK;EAAS,WAAW,GAAG,QAAQ,SAAS;CAAI,EAChE"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/KeyboardScreenAdapter/index.tsx"],"sourcesContent":["'use client';\n\nimport { useKeyboardDetector } from '@hooks/useKeyboardDetector';\nimport { cn } from '@utils/cn';\nimport type { FC, HTMLAttributes, PropsWithChildren } from 'react';\n\n/**\n * KeyboardScreenAdapter Component\n *\n * A smart wrapper component that automatically adapts the viewport height\n * when virtual keyboards appear on mobile devices. This prevents content\n * from being hidden behind the keyboard and ensures optimal user experience\n * across all devices and orientations.\n *\n * @component\n * @example\n * Basic usage:\n * ```tsx\n * <KeyboardScreenAdapter>\n * <div>Your app content here</div>\n * </KeyboardScreenAdapter>\n * ```\n *\n * @example\n * With custom styling:\n * ```tsx\n * <KeyboardScreenAdapter className=\"bg-gray-100 p-4\">\n * <form>\n * <input type=\"text\" placeholder=\"Enter your name\" />\n * <input type=\"email\" placeholder=\"Enter your email\" />\n * <button type=\"submit\">Submit</button>\n * </form>\n * </KeyboardScreenAdapter>\n * ```\n *\n * @example\n * Mobile-first responsive design:\n * ```tsx\n * <KeyboardScreenAdapter className=\"md:min-h-screen\">\n * <div className=\"flex flex-col h-full\">\n * <header>Navigation</header>\n * <main className=\"flex-1 overflow-auto\">\n * <input type=\"search\" placeholder=\"Search...\" />\n * Content that needs keyboard adaptation\n * </main>\n * </div>\n * </KeyboardScreenAdapter>\n * ```\n *\n * Features:\n * - Automatic viewport height detection and adjustment\n * - Smooth transitions when keyboard shows/hides\n * - Works with both iOS and Android virtual keyboards\n * - Responsive design that adapts to device orientation changes\n * - Maintains scroll behavior and overflow handling\n * - Lightweight with minimal performance impact\n * - Client-side only (Next.js compatible with 'use client')\n *\n * How it works:\n * 1. Uses the useKeyboardDetector hook to monitor window height changes\n * 2. Detects when virtual keyboard appears (window height decreases)\n * 3. Automatically adjusts the container's max-height to fit visible area\n * 4. Provides smooth transitions for better user experience\n * 5. Restores original height when keyboard disappears\n *\n * Use cases:\n * - Mobile web applications with forms\n * - Chat interfaces and messaging apps\n * - Search interfaces and input-heavy UIs\n * - Progressive Web Apps (PWAs)\n * - Any mobile-first application requiring keyboard interaction\n *\n * Browser compatibility:\n * - iOS Safari (all versions)\n * - Chrome Mobile (Android)\n * - Samsung Internet\n * - Firefox Mobile\n * - Other mobile browsers with virtual keyboards\n *\n * Performance considerations:\n * - Uses ResizeObserver for efficient window monitoring\n * - Minimal re-renders through optimized state management\n * - CSS transitions handled by GPU acceleration\n * - No layout thrashing during keyboard transitions\n *\n * Accessibility:\n * - Maintains focus management during transitions\n * - Preserves scroll position and user context\n * - Compatible with screen readers and assistive technologies\n * - Supports keyboard navigation patterns\n *\n * @param props - Component props extending standard div attributes\n * @param props.children - Content to render within the adaptive container\n * @param props.className - Additional CSS classes for the container\n * @param props.style - Inline styles (note: maxHeight may be overridden)\n * @param props.id - Unique identifier for the container\n * @param props.role - ARIA role for accessibility\n * @param props.tabIndex - Tab index for focus management\n * @param props.onScroll - Scroll event handler\n * @param props.onTouchStart - Touch start event handler\n * @param props.onTouchMove - Touch move event handler\n * @param props.onTouchEnd - Touch end event handler\n * @param props...rest - All other standard HTML div attributes\n *\n * @returns A responsive container that adapts to keyboard visibility\n */\nexport const KeyboardScreenAdapter: FC<\n PropsWithChildren<HTMLAttributes<HTMLDivElement>>\n> = ({ children, className, ...props }) => {\n const { windowHeight } = useKeyboardDetector();\n\n return (\n <div\n className={cn(\n 'h-screen w-screen overflow-auto scroll-smooth transition',\n className\n )}\n style={{\n maxHeight: windowHeight ? `${windowHeight}px` : undefined,\n }}\n {...props}\n >\n {children}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0GA,MAAa,yBAER,EAAE,UAAU,WAAW,GAAG,YAAY;CACzC,MAAM,EAAE,iBAAiB,qBAAqB;CAE9C,OACE,oBAAC,OAAD;EACE,WAAW,GACT,4DACA,UACD;EACD,OAAO,EACL,WAAW,eAAe,GAAG,aAAa,MAAM,QACjD;EACD,GAAI;EAEH;EACG"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/KeyboardScreenAdapter/index.tsx"],"sourcesContent":["'use client';\n\nimport { useKeyboardDetector } from '@hooks/useKeyboardDetector';\nimport { cn } from '@utils/cn';\nimport type { FC, HTMLAttributes, PropsWithChildren } from 'react';\n\n/**\n * KeyboardScreenAdapter Component\n *\n * A smart wrapper component that automatically adapts the viewport height\n * when virtual keyboards appear on mobile devices. This prevents content\n * from being hidden behind the keyboard and ensures optimal user experience\n * across all devices and orientations.\n *\n * @component\n * @example\n * Basic usage:\n * ```tsx\n * <KeyboardScreenAdapter>\n * <div>Your app content here</div>\n * </KeyboardScreenAdapter>\n * ```\n *\n * @example\n * With custom styling:\n * ```tsx\n * <KeyboardScreenAdapter className=\"bg-gray-100 p-4\">\n * <form>\n * <input type=\"text\" placeholder=\"Enter your name\" />\n * <input type=\"email\" placeholder=\"Enter your email\" />\n * <button type=\"submit\">Submit</button>\n * </form>\n * </KeyboardScreenAdapter>\n * ```\n *\n * @example\n * Mobile-first responsive design:\n * ```tsx\n * <KeyboardScreenAdapter className=\"md:min-h-screen\">\n * <div className=\"flex flex-col h-full\">\n * <header>Navigation</header>\n * <main className=\"flex-1 overflow-auto\">\n * <input type=\"search\" placeholder=\"Search...\" />\n * Content that needs keyboard adaptation\n * </main>\n * </div>\n * </KeyboardScreenAdapter>\n * ```\n *\n * Features:\n * - Automatic viewport height detection and adjustment\n * - Smooth transitions when keyboard shows/hides\n * - Works with both iOS and Android virtual keyboards\n * - Responsive design that adapts to device orientation changes\n * - Maintains scroll behavior and overflow handling\n * - Lightweight with minimal performance impact\n * - Client-side only (Next.js compatible with 'use client')\n *\n * How it works:\n * 1. Uses the useKeyboardDetector hook to monitor window height changes\n * 2. Detects when virtual keyboard appears (window height decreases)\n * 3. Automatically adjusts the container's max-height to fit visible area\n * 4. Provides smooth transitions for better user experience\n * 5. Restores original height when keyboard disappears\n *\n * Use cases:\n * - Mobile web applications with forms\n * - Chat interfaces and messaging apps\n * - Search interfaces and input-heavy UIs\n * - Progressive Web Apps (PWAs)\n * - Any mobile-first application requiring keyboard interaction\n *\n * Browser compatibility:\n * - iOS Safari (all versions)\n * - Chrome Mobile (Android)\n * - Samsung Internet\n * - Firefox Mobile\n * - Other mobile browsers with virtual keyboards\n *\n * Performance considerations:\n * - Uses ResizeObserver for efficient window monitoring\n * - Minimal re-renders through optimized state management\n * - CSS transitions handled by GPU acceleration\n * - No layout thrashing during keyboard transitions\n *\n * Accessibility:\n * - Maintains focus management during transitions\n * - Preserves scroll position and user context\n * - Compatible with screen readers and assistive technologies\n * - Supports keyboard navigation patterns\n *\n * @param props - Component props extending standard div attributes\n * @param props.children - Content to render within the adaptive container\n * @param props.className - Additional CSS classes for the container\n * @param props.style - Inline styles (note: maxHeight may be overridden)\n * @param props.id - Unique identifier for the container\n * @param props.role - ARIA role for accessibility\n * @param props.tabIndex - Tab index for focus management\n * @param props.onScroll - Scroll event handler\n * @param props.onTouchStart - Touch start event handler\n * @param props.onTouchMove - Touch move event handler\n * @param props.onTouchEnd - Touch end event handler\n * @param props...rest - All other standard HTML div attributes\n *\n * @returns A responsive container that adapts to keyboard visibility\n */\nexport const KeyboardScreenAdapter: FC<\n PropsWithChildren<HTMLAttributes<HTMLDivElement>>\n> = ({ children, className, ...props }) => {\n const { windowHeight } = useKeyboardDetector();\n\n return (\n <div\n className={cn(\n 'h-screen w-screen overflow-auto scroll-smooth transition',\n className\n )}\n style={{\n maxHeight: windowHeight ? `${windowHeight}px` : undefined,\n }}\n {...props}\n >\n {children}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0GA,MAAa,yBAER,EAAE,UAAU,WAAW,GAAG,YAAY;CACzC,MAAM,EAAE,iBAAiB,oBAAoB;CAE7C,OACE,oBAAC,OAAD;EACE,WAAW,GACT,4DACA,SACF;EACA,OAAO,EACL,WAAW,eAAe,GAAG,aAAa,MAAM,OAClD;EACA,GAAI;EAEH;CACE;AAET"}