@intlayer/design-system 6.1.4 → 6.1.6-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 (320) hide show
  1. package/dist/.vite/manifest.json +19 -14
  2. package/dist/Form-CriPBaZk.js.map +1 -1
  3. package/dist/Form-DJrUK3mm.cjs.map +1 -1
  4. package/dist/components/Accordion/Accordion.cjs +51 -15
  5. package/dist/components/Accordion/Accordion.cjs.map +1 -1
  6. package/dist/components/Accordion/Accordion.d.ts +44 -5
  7. package/dist/components/Accordion/Accordion.d.ts.map +1 -1
  8. package/dist/components/Accordion/Accordion.mjs +52 -16
  9. package/dist/components/Accordion/Accordion.mjs.map +1 -1
  10. package/dist/components/Avatar/index.cjs +114 -31
  11. package/dist/components/Avatar/index.cjs.map +1 -1
  12. package/dist/components/Avatar/index.d.ts +46 -2
  13. package/dist/components/Avatar/index.d.ts.map +1 -1
  14. package/dist/components/Avatar/index.mjs +115 -32
  15. package/dist/components/Avatar/index.mjs.map +1 -1
  16. package/dist/components/Badge/index.cjs +88 -9
  17. package/dist/components/Badge/index.cjs.map +1 -1
  18. package/dist/components/Badge/index.d.ts +80 -2
  19. package/dist/components/Badge/index.d.ts.map +1 -1
  20. package/dist/components/Badge/index.mjs +89 -10
  21. package/dist/components/Badge/index.mjs.map +1 -1
  22. package/dist/components/Breadcrumb/index.cjs +124 -59
  23. package/dist/components/Breadcrumb/index.cjs.map +1 -1
  24. package/dist/components/Breadcrumb/index.d.ts +89 -5
  25. package/dist/components/Breadcrumb/index.d.ts.map +1 -1
  26. package/dist/components/Breadcrumb/index.mjs +124 -59
  27. package/dist/components/Breadcrumb/index.mjs.map +1 -1
  28. package/dist/components/Button/Button.cjs +44 -25
  29. package/dist/components/Button/Button.cjs.map +1 -1
  30. package/dist/components/Button/Button.d.ts +95 -1
  31. package/dist/components/Button/Button.d.ts.map +1 -1
  32. package/dist/components/Button/Button.mjs +44 -25
  33. package/dist/components/Button/Button.mjs.map +1 -1
  34. package/dist/components/ClickOutsideDiv/index.cjs +38 -7
  35. package/dist/components/ClickOutsideDiv/index.cjs.map +1 -1
  36. package/dist/components/ClickOutsideDiv/index.d.ts +13 -0
  37. package/dist/components/ClickOutsideDiv/index.d.ts.map +1 -1
  38. package/dist/components/ClickOutsideDiv/index.mjs +39 -8
  39. package/dist/components/ClickOutsideDiv/index.mjs.map +1 -1
  40. package/dist/components/Container/index.cjs +2 -0
  41. package/dist/components/Container/index.cjs.map +1 -1
  42. package/dist/components/Container/index.d.ts +42 -0
  43. package/dist/components/Container/index.d.ts.map +1 -1
  44. package/dist/components/Container/index.mjs +2 -0
  45. package/dist/components/Container/index.mjs.map +1 -1
  46. package/dist/components/ContentEditor/ContentEditor.cjs +80 -33
  47. package/dist/components/ContentEditor/ContentEditor.cjs.map +1 -1
  48. package/dist/components/ContentEditor/ContentEditor.d.ts +29 -0
  49. package/dist/components/ContentEditor/ContentEditor.d.ts.map +1 -1
  50. package/dist/components/ContentEditor/ContentEditor.mjs +80 -33
  51. package/dist/components/ContentEditor/ContentEditor.mjs.map +1 -1
  52. package/dist/components/ContentEditor/ContentEditorInput.cjs +58 -31
  53. package/dist/components/ContentEditor/ContentEditorInput.cjs.map +1 -1
  54. package/dist/components/ContentEditor/ContentEditorInput.d.ts +33 -0
  55. package/dist/components/ContentEditor/ContentEditorInput.d.ts.map +1 -1
  56. package/dist/components/ContentEditor/ContentEditorInput.mjs +58 -31
  57. package/dist/components/ContentEditor/ContentEditorInput.mjs.map +1 -1
  58. package/dist/components/ContentEditor/ContentEditorTextArea.cjs +58 -30
  59. package/dist/components/ContentEditor/ContentEditorTextArea.cjs.map +1 -1
  60. package/dist/components/ContentEditor/ContentEditorTextArea.d.ts +35 -0
  61. package/dist/components/ContentEditor/ContentEditorTextArea.d.ts.map +1 -1
  62. package/dist/components/ContentEditor/ContentEditorTextArea.mjs +59 -31
  63. package/dist/components/ContentEditor/ContentEditorTextArea.mjs.map +1 -1
  64. package/dist/components/ContentEditor/index.cjs +4 -0
  65. package/dist/components/ContentEditor/index.cjs.map +1 -1
  66. package/dist/components/ContentEditor/index.d.ts +2 -0
  67. package/dist/components/ContentEditor/index.d.ts.map +1 -1
  68. package/dist/components/ContentEditor/index.mjs +5 -1
  69. package/dist/components/ContentEditor/index.mjs.map +1 -1
  70. package/dist/components/ContentSelector/ContentSelector.cjs +9 -1
  71. package/dist/components/ContentSelector/ContentSelector.cjs.map +1 -1
  72. package/dist/components/ContentSelector/ContentSelector.d.ts +167 -0
  73. package/dist/components/ContentSelector/ContentSelector.d.ts.map +1 -1
  74. package/dist/components/ContentSelector/ContentSelector.mjs +9 -1
  75. package/dist/components/ContentSelector/ContentSelector.mjs.map +1 -1
  76. package/dist/components/CopyButton/index.cjs +23 -8
  77. package/dist/components/CopyButton/index.cjs.map +1 -1
  78. package/dist/components/CopyButton/index.d.ts +78 -0
  79. package/dist/components/CopyButton/index.d.ts.map +1 -1
  80. package/dist/components/CopyButton/index.mjs +23 -8
  81. package/dist/components/CopyButton/index.mjs.map +1 -1
  82. package/dist/components/CopyToClipboard/index.cjs +58 -22
  83. package/dist/components/CopyToClipboard/index.cjs.map +1 -1
  84. package/dist/components/CopyToClipboard/index.d.ts +68 -2
  85. package/dist/components/CopyToClipboard/index.d.ts.map +1 -1
  86. package/dist/components/CopyToClipboard/index.mjs +59 -23
  87. package/dist/components/CopyToClipboard/index.mjs.map +1 -1
  88. package/dist/components/DropDown/index.cjs +6 -4
  89. package/dist/components/DropDown/index.cjs.map +1 -1
  90. package/dist/components/DropDown/index.d.ts +92 -15
  91. package/dist/components/DropDown/index.d.ts.map +1 -1
  92. package/dist/components/DropDown/index.mjs +6 -4
  93. package/dist/components/DropDown/index.mjs.map +1 -1
  94. package/dist/components/EditableField/EditableFieldInput.cjs.map +1 -1
  95. package/dist/components/EditableField/EditableFieldInput.d.ts +38 -0
  96. package/dist/components/EditableField/EditableFieldInput.d.ts.map +1 -1
  97. package/dist/components/EditableField/EditableFieldInput.mjs.map +1 -1
  98. package/dist/components/EditableField/EditableFieldLayout.cjs +10 -2
  99. package/dist/components/EditableField/EditableFieldLayout.cjs.map +1 -1
  100. package/dist/components/EditableField/EditableFieldLayout.d.ts.map +1 -1
  101. package/dist/components/EditableField/EditableFieldLayout.mjs +10 -2
  102. package/dist/components/EditableField/EditableFieldLayout.mjs.map +1 -1
  103. package/dist/components/EditableField/EditableFieldTextArea.cjs.map +1 -1
  104. package/dist/components/EditableField/EditableFieldTextArea.d.ts +42 -0
  105. package/dist/components/EditableField/EditableFieldTextArea.d.ts.map +1 -1
  106. package/dist/components/EditableField/EditableFieldTextArea.mjs.map +1 -1
  107. package/dist/components/ExpandCollapse/ExpandCollapse.cjs.map +1 -1
  108. package/dist/components/ExpandCollapse/ExpandCollapse.d.ts +58 -0
  109. package/dist/components/ExpandCollapse/ExpandCollapse.d.ts.map +1 -1
  110. package/dist/components/ExpandCollapse/ExpandCollapse.mjs.map +1 -1
  111. package/dist/components/Footer/index.cjs.map +1 -1
  112. package/dist/components/Footer/index.d.ts +101 -0
  113. package/dist/components/Footer/index.d.ts.map +1 -1
  114. package/dist/components/Footer/index.mjs.map +1 -1
  115. package/dist/components/Form/elements/MultiselectElement.d.ts.map +1 -1
  116. package/dist/components/Form/elements/SelectElement.d.ts.map +1 -1
  117. package/dist/components/Form/elements/SwitchSelectorElement.d.ts.map +1 -1
  118. package/dist/components/Headers/index.cjs.map +1 -1
  119. package/dist/components/Headers/index.d.ts +69 -2
  120. package/dist/components/Headers/index.d.ts.map +1 -1
  121. package/dist/components/Headers/index.mjs.map +1 -1
  122. package/dist/components/HeightResizer/index.cjs +10 -7
  123. package/dist/components/HeightResizer/index.cjs.map +1 -1
  124. package/dist/components/HeightResizer/index.d.ts +89 -0
  125. package/dist/components/HeightResizer/index.d.ts.map +1 -1
  126. package/dist/components/HeightResizer/index.mjs +10 -7
  127. package/dist/components/HeightResizer/index.mjs.map +1 -1
  128. package/dist/components/IDE/MarkDownRender.cjs +2 -2
  129. package/dist/components/IDE/MarkDownRender.cjs.map +1 -1
  130. package/dist/components/IDE/MarkDownRender.d.ts.map +1 -1
  131. package/dist/components/IDE/MarkDownRender.mjs +2 -2
  132. package/dist/components/IDE/MarkDownRender.mjs.map +1 -1
  133. package/dist/components/InformationTag/index.cjs.map +1 -1
  134. package/dist/components/InformationTag/index.d.ts +72 -0
  135. package/dist/components/InformationTag/index.d.ts.map +1 -1
  136. package/dist/components/InformationTag/index.mjs.map +1 -1
  137. package/dist/components/KeyboardScreenAdapter/index.cjs.map +1 -1
  138. package/dist/components/KeyboardScreenAdapter/index.d.ts +100 -0
  139. package/dist/components/KeyboardScreenAdapter/index.d.ts.map +1 -1
  140. package/dist/components/KeyboardScreenAdapter/index.mjs.map +1 -1
  141. package/dist/components/Label/index.cjs +25 -3
  142. package/dist/components/Label/index.cjs.map +1 -1
  143. package/dist/components/Label/index.d.ts +65 -1
  144. package/dist/components/Label/index.d.ts.map +1 -1
  145. package/dist/components/Label/index.mjs +26 -4
  146. package/dist/components/Label/index.mjs.map +1 -1
  147. package/dist/components/Link/Link.cjs.map +1 -1
  148. package/dist/components/Link/Link.d.ts +169 -0
  149. package/dist/components/Link/Link.d.ts.map +1 -1
  150. package/dist/components/Link/Link.mjs.map +1 -1
  151. package/dist/components/Loader/index.cjs.map +1 -1
  152. package/dist/components/Loader/index.d.ts +82 -11
  153. package/dist/components/Loader/index.d.ts.map +1 -1
  154. package/dist/components/Loader/index.mjs.map +1 -1
  155. package/dist/components/Loader/spinner.cjs.map +1 -1
  156. package/dist/components/Loader/spinner.d.ts +56 -0
  157. package/dist/components/Loader/spinner.d.ts.map +1 -1
  158. package/dist/components/Loader/spinner.mjs.map +1 -1
  159. package/dist/components/MarkDownRender/MarkDownRender.cjs +3 -3
  160. package/dist/components/MarkDownRender/MarkDownRender.cjs.map +1 -1
  161. package/dist/components/MarkDownRender/MarkDownRender.d.ts +148 -1
  162. package/dist/components/MarkDownRender/MarkDownRender.d.ts.map +1 -1
  163. package/dist/components/MarkDownRender/MarkDownRender.mjs +2 -2
  164. package/dist/components/MarkDownRender/MarkDownRender.mjs.map +1 -1
  165. package/dist/components/MarkDownRender/{processer.cjs → processor.cjs} +307 -107
  166. package/dist/components/MarkDownRender/processor.cjs.map +1 -0
  167. package/dist/components/MarkDownRender/{processer.d.ts → processor.d.ts} +1 -1
  168. package/dist/components/MarkDownRender/processor.d.ts.map +1 -0
  169. package/dist/components/MarkDownRender/{processer.mjs → processor.mjs} +307 -107
  170. package/dist/components/MarkDownRender/processor.mjs.map +1 -0
  171. package/dist/components/MaxHeightSmoother/index.cjs.map +1 -1
  172. package/dist/components/MaxHeightSmoother/index.d.ts +152 -0
  173. package/dist/components/MaxHeightSmoother/index.d.ts.map +1 -1
  174. package/dist/components/MaxHeightSmoother/index.mjs.map +1 -1
  175. package/dist/components/Modal/Modal.cjs +5 -0
  176. package/dist/components/Modal/Modal.cjs.map +1 -1
  177. package/dist/components/Modal/Modal.d.ts +81 -3
  178. package/dist/components/Modal/Modal.d.ts.map +1 -1
  179. package/dist/components/Modal/Modal.mjs +5 -0
  180. package/dist/components/Modal/Modal.mjs.map +1 -1
  181. package/dist/components/Navbar/Burger.cjs.map +1 -1
  182. package/dist/components/Navbar/Burger.d.ts +54 -0
  183. package/dist/components/Navbar/Burger.d.ts.map +1 -1
  184. package/dist/components/Navbar/Burger.mjs.map +1 -1
  185. package/dist/components/Navbar/DesktopNavbar.cjs.map +1 -1
  186. package/dist/components/Navbar/DesktopNavbar.d.ts +78 -0
  187. package/dist/components/Navbar/DesktopNavbar.d.ts.map +1 -1
  188. package/dist/components/Navbar/DesktopNavbar.mjs.map +1 -1
  189. package/dist/components/Navbar/MobileNavbar.cjs.map +1 -1
  190. package/dist/components/Navbar/MobileNavbar.d.ts +88 -0
  191. package/dist/components/Navbar/MobileNavbar.d.ts.map +1 -1
  192. package/dist/components/Navbar/MobileNavbar.mjs.map +1 -1
  193. package/dist/components/Navbar/index.cjs.map +1 -1
  194. package/dist/components/Navbar/index.d.ts +69 -0
  195. package/dist/components/Navbar/index.d.ts.map +1 -1
  196. package/dist/components/Navbar/index.mjs.map +1 -1
  197. package/dist/components/Navbar/useNavigation.cjs +8 -1
  198. package/dist/components/Navbar/useNavigation.cjs.map +1 -1
  199. package/dist/components/Navbar/useNavigation.d.ts +83 -0
  200. package/dist/components/Navbar/useNavigation.d.ts.map +1 -1
  201. package/dist/components/Navbar/useNavigation.mjs +8 -1
  202. package/dist/components/Navbar/useNavigation.mjs.map +1 -1
  203. package/dist/components/Pattern/DotPattern.cjs.map +1 -1
  204. package/dist/components/Pattern/DotPattern.d.ts +101 -0
  205. package/dist/components/Pattern/DotPattern.d.ts.map +1 -1
  206. package/dist/components/Pattern/DotPattern.mjs.map +1 -1
  207. package/dist/components/Pattern/GridPattern.cjs.map +1 -1
  208. package/dist/components/Pattern/GridPattern.d.ts +114 -0
  209. package/dist/components/Pattern/GridPattern.d.ts.map +1 -1
  210. package/dist/components/Pattern/GridPattern.mjs.map +1 -1
  211. package/dist/components/Pattern/SpotLight.cjs.map +1 -1
  212. package/dist/components/Pattern/SpotLight.d.ts +125 -0
  213. package/dist/components/Pattern/SpotLight.d.ts.map +1 -1
  214. package/dist/components/Pattern/SpotLight.mjs.map +1 -1
  215. package/dist/components/Popover/index.cjs +10 -10
  216. package/dist/components/Popover/index.cjs.map +1 -1
  217. package/dist/components/Popover/index.d.ts +110 -15
  218. package/dist/components/Popover/index.d.ts.map +1 -1
  219. package/dist/components/Popover/index.mjs +10 -10
  220. package/dist/components/Popover/index.mjs.map +1 -1
  221. package/dist/components/PressableSpan/PressableSpan.cjs +22 -5
  222. package/dist/components/PressableSpan/PressableSpan.cjs.map +1 -1
  223. package/dist/components/PressableSpan/PressableSpan.d.ts +105 -3
  224. package/dist/components/PressableSpan/PressableSpan.d.ts.map +1 -1
  225. package/dist/components/PressableSpan/PressableSpan.mjs +22 -5
  226. package/dist/components/PressableSpan/PressableSpan.mjs.map +1 -1
  227. package/dist/components/RightDrawer/RightDrawer.cjs.map +1 -1
  228. package/dist/components/RightDrawer/RightDrawer.d.ts +182 -0
  229. package/dist/components/RightDrawer/RightDrawer.d.ts.map +1 -1
  230. package/dist/components/RightDrawer/RightDrawer.mjs.map +1 -1
  231. package/dist/components/RightDrawer/isElementAtTopAndNotCovered.cjs.map +1 -1
  232. package/dist/components/RightDrawer/isElementAtTopAndNotCovered.d.ts +44 -0
  233. package/dist/components/RightDrawer/isElementAtTopAndNotCovered.d.ts.map +1 -1
  234. package/dist/components/RightDrawer/isElementAtTopAndNotCovered.mjs.map +1 -1
  235. package/dist/components/RightDrawer/useRightDrawerStore.cjs.map +1 -1
  236. package/dist/components/RightDrawer/useRightDrawerStore.d.ts +102 -0
  237. package/dist/components/RightDrawer/useRightDrawerStore.d.ts.map +1 -1
  238. package/dist/components/RightDrawer/useRightDrawerStore.mjs.map +1 -1
  239. package/dist/components/Select/Multiselect.cjs.map +1 -1
  240. package/dist/components/Select/Multiselect.d.ts +125 -18
  241. package/dist/components/Select/Multiselect.d.ts.map +1 -1
  242. package/dist/components/Select/Multiselect.mjs.map +1 -1
  243. package/dist/components/Select/Select.cjs.map +1 -1
  244. package/dist/components/Select/Select.d.ts +214 -7
  245. package/dist/components/Select/Select.d.ts.map +1 -1
  246. package/dist/components/Select/Select.mjs.map +1 -1
  247. package/dist/components/SwitchSelector/index.cjs.map +1 -1
  248. package/dist/components/SwitchSelector/index.d.ts +157 -8
  249. package/dist/components/SwitchSelector/index.d.ts.map +1 -1
  250. package/dist/components/SwitchSelector/index.mjs.map +1 -1
  251. package/dist/components/Table/Table.cjs.map +1 -1
  252. package/dist/components/Table/Table.d.ts +184 -0
  253. package/dist/components/Table/Table.d.ts.map +1 -1
  254. package/dist/components/Table/Table.mjs.map +1 -1
  255. package/dist/components/Tag/index.cjs.map +1 -1
  256. package/dist/components/Tag/index.d.ts +223 -0
  257. package/dist/components/Tag/index.d.ts.map +1 -1
  258. package/dist/components/Tag/index.mjs.map +1 -1
  259. package/dist/components/TextArea/AutoSizeTextArea.cjs.map +1 -1
  260. package/dist/components/TextArea/AutoSizeTextArea.d.ts +91 -0
  261. package/dist/components/TextArea/AutoSizeTextArea.d.ts.map +1 -1
  262. package/dist/components/TextArea/AutoSizeTextArea.mjs.map +1 -1
  263. package/dist/components/TextArea/AutocompleteTextArea.cjs.map +1 -1
  264. package/dist/components/TextArea/AutocompleteTextArea.d.ts +145 -0
  265. package/dist/components/TextArea/AutocompleteTextArea.d.ts.map +1 -1
  266. package/dist/components/TextArea/AutocompleteTextArea.mjs.map +1 -1
  267. package/dist/components/TextArea/TextArea.cjs.map +1 -1
  268. package/dist/components/TextArea/TextArea.d.ts +74 -0
  269. package/dist/components/TextArea/TextArea.d.ts.map +1 -1
  270. package/dist/components/TextArea/TextArea.mjs.map +1 -1
  271. package/dist/components/Toaster/Toast.cjs +4 -0
  272. package/dist/components/Toaster/Toast.cjs.map +1 -1
  273. package/dist/components/Toaster/Toast.d.ts +148 -2
  274. package/dist/components/Toaster/Toast.d.ts.map +1 -1
  275. package/dist/components/Toaster/Toast.mjs +4 -0
  276. package/dist/components/Toaster/Toast.mjs.map +1 -1
  277. package/dist/components/Toaster/Toaster.cjs.map +1 -1
  278. package/dist/components/Toaster/Toaster.d.ts +42 -0
  279. package/dist/components/Toaster/Toaster.d.ts.map +1 -1
  280. package/dist/components/Toaster/Toaster.mjs.map +1 -1
  281. package/dist/components/Toaster/useToast.cjs.map +1 -1
  282. package/dist/components/Toaster/useToast.d.ts +199 -2
  283. package/dist/components/Toaster/useToast.d.ts.map +1 -1
  284. package/dist/components/Toaster/useToast.mjs.map +1 -1
  285. package/dist/components/WithResizer/index.cjs.map +1 -1
  286. package/dist/components/WithResizer/index.d.ts +143 -0
  287. package/dist/components/WithResizer/index.d.ts.map +1 -1
  288. package/dist/components/WithResizer/index.mjs.map +1 -1
  289. package/dist/components/index.cjs +2 -2
  290. package/dist/components/index.d.ts +0 -1
  291. package/dist/components/index.d.ts.map +1 -1
  292. package/dist/components/index.mjs +4 -4
  293. package/dist/components/index.mjs.map +1 -1
  294. package/dist/hooks/reactQuery.cjs +2 -1
  295. package/dist/hooks/reactQuery.cjs.map +1 -1
  296. package/dist/hooks/reactQuery.d.ts +1 -1
  297. package/dist/hooks/reactQuery.d.ts.map +1 -1
  298. package/dist/hooks/reactQuery.mjs +2 -1
  299. package/dist/hooks/reactQuery.mjs.map +1 -1
  300. package/dist/hooks/useHorizontalSwipe.cjs +4 -4
  301. package/dist/hooks/useHorizontalSwipe.cjs.map +1 -1
  302. package/dist/hooks/useHorizontalSwipe.d.ts.map +1 -1
  303. package/dist/hooks/useHorizontalSwipe.mjs +4 -4
  304. package/dist/hooks/useHorizontalSwipe.mjs.map +1 -1
  305. package/dist/utils/image.cjs +30 -0
  306. package/dist/utils/image.cjs.map +1 -0
  307. package/dist/utils/image.d.ts +37 -0
  308. package/dist/utils/image.d.ts.map +1 -0
  309. package/dist/utils/image.mjs +30 -0
  310. package/dist/utils/image.mjs.map +1 -0
  311. package/package.json +20 -19
  312. package/dist/components/MarkDownRender/processer.cjs.map +0 -1
  313. package/dist/components/MarkDownRender/processer.d.ts.map +0 -1
  314. package/dist/components/MarkDownRender/processer.mjs.map +0 -1
  315. package/dist/utils/capitalize.cjs +0 -10
  316. package/dist/utils/capitalize.cjs.map +0 -1
  317. package/dist/utils/capitalize.d.ts +0 -2
  318. package/dist/utils/capitalize.d.ts.map +0 -1
  319. package/dist/utils/capitalize.mjs +0 -10
  320. package/dist/utils/capitalize.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/components/Headers/index.tsx"],"sourcesContent":["import type { FC, HTMLAttributes, JSX, MouseEvent } from 'react';\nimport { cn } from '../../utils/cn';\n\nconst styledHeading = `relative scroll-mb-8 scroll-mt-[30vh] scroll-p-8`;\nconst styledAfter = `after:content-['#'] after:scale-75 after:px-6 after:text-neutral after:absolute after:top-0 after:h-full after:-left-12 after:hover:cursor-pointer after:absolute after:to-neutral after:md:opacity-0 after:transition-opacity hover:after:opacity-80 after:duration-200 after:delay-100`;\n\nconst StyledH1: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => <h1 className={cn('mt-5 text-2xl font-bold', className)} {...props} />;\n\nconst StyledH2: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => (\n <h2\n className={cn('mt-16 mb-2 text-2xl font-bold', styledHeading, className)}\n {...props}\n />\n);\n\nconst StyledH3: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => (\n <h3\n className={cn('mt-5 mb-2 text-xl font-bold', styledHeading, className)}\n {...props}\n />\n);\n\nconst StyledH4: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => (\n <h4\n className={cn('mt-3 text-lg font-bold', styledHeading, className)}\n {...props}\n />\n);\n\nconst StyledH5: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => (\n <h5\n className={cn('mt-3 text-base font-bold', styledHeading, className)}\n {...props}\n />\n);\n\nconst StyledH6: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => (\n <h6\n className={cn('mt-3 ml-3 text-base font-bold', styledHeading, className)}\n {...props}\n />\n);\n\ntype HeadingProps = HTMLAttributes<HTMLHeadingElement> & {\n isClickable?: boolean;\n};\ntype HeadingGlobalProps = HeadingProps & {\n H: FC<HTMLAttributes<HTMLHeadingElement>>;\n};\ntype HeadingType = (props: HeadingGlobalProps) => JSX.Element;\n\nconst getId = (children: string) =>\n String(children)\n // replace accents\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '')\n // replace spaces\n .replace(/\\s+/g, '-')\n .toLowerCase();\n\nconst scrollToHash = (id: string) => {\n const element = document.getElementById(id);\n const offset = 150;\n const y =\n (element?.getBoundingClientRect()?.top ?? 0) + window.scrollY - offset;\n\n window.scrollTo({ top: y, behavior: 'smooth' });\n};\n\nconst afterClick = (parentElem: Element, e: MouseEvent<HTMLHeadingElement>) => {\n const parentLeft = parentElem.getBoundingClientRect().left,\n parentTop = parentElem.getBoundingClientRect().top;\n\n const after = window.getComputedStyle(parentElem, ':after');\n\n const afterStart = parentLeft + parseInt(after.getPropertyValue('left'), 10),\n afterEnd = afterStart + parseInt(after.width, 10);\n\n const afterYStart = parentTop + parseInt(after.getPropertyValue('top'), 10),\n afterYEnd = afterYStart + parseInt(after.height, 10);\n\n const mouseX = e.clientX,\n mouseY = e.clientY;\n\n const isAfterClicked: boolean =\n mouseX >= afterStart &&\n mouseX <= afterEnd &&\n mouseY >= afterYStart &&\n mouseY <= afterYEnd;\n\n return isAfterClicked;\n};\n\nconst HeadingWrapper: HeadingType = ({\n H,\n children,\n className,\n isClickable,\n ...props\n}) => {\n const id = typeof children === 'string' ? getId(children) : undefined;\n\n const onClick = (e: MouseEvent<HTMLHeadingElement>) => {\n const { id } = e.currentTarget;\n\n const isAfterClicker = afterClick(e.currentTarget, e);\n\n if (isAfterClicker && typeof id === 'string') {\n const urlWithoutHash = window.location.href.split('#')[0];\n const url = `${urlWithoutHash}#${id}`;\n\n // copy the url to the clipboard\n navigator.clipboard.writeText(url);\n\n scrollToHash(id);\n }\n };\n\n return (\n <H\n id={id}\n onClick={isClickable ? onClick : undefined}\n aria-label={\n isClickable\n ? `Click to scroll to section ${id} and copy the link to the clipboard`\n : undefined\n }\n className={cn(isClickable && styledAfter, className)}\n {...props}\n >\n {children}\n </H>\n );\n};\n\nexport const H1: FC<HeadingProps> = ({ isClickable: _, ...props }) => (\n <StyledH1 {...props} />\n);\n\nexport const H2: FC<HeadingProps> = ({ isClickable = false, ...props }) => (\n <HeadingWrapper H={StyledH2} isClickable={isClickable} {...props} />\n);\nexport const H3: FC<HeadingProps> = ({ isClickable = false, ...props }) => (\n <HeadingWrapper H={StyledH3} isClickable={isClickable} {...props} />\n);\nexport const H4: FC<HeadingProps> = ({ isClickable = false, ...props }) => (\n <HeadingWrapper H={StyledH4} isClickable={isClickable} {...props} />\n);\nexport const H5: FC<HeadingProps> = ({ isClickable = false, ...props }) => (\n <HeadingWrapper H={StyledH5} isClickable={isClickable} {...props} />\n);\n\nexport const H6: FC<HeadingProps> = ({ isClickable = false, ...props }) => (\n <HeadingWrapper H={StyledH6} isClickable={isClickable} {...props} />\n);\n"],"names":["jsx","cn","id"],"mappings":";;;;AAGA,MAAM,gBAAgB;AACtB,MAAM,cAAc;AAEpB,MAAM,WAAmD,CAAC;AAAA,EACxD;AAAA,EACA,GAAG;AACL,MAAMA,2BAAAA,IAAC,QAAG,WAAWC,SAAAA,GAAG,2BAA2B,SAAS,GAAI,GAAG,OAAO;AAE1E,MAAM,WAAmD,CAAC;AAAA,EACxD;AAAA,EACA,GAAG;AACL,MACED,2BAAAA;AAAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC,SAAAA,GAAG,iCAAiC,eAAe,SAAS;AAAA,IACtE,GAAG;AAAA,EAAA;AACN;AAGF,MAAM,WAAmD,CAAC;AAAA,EACxD;AAAA,EACA,GAAG;AACL,MACED,2BAAAA;AAAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC,SAAAA,GAAG,+BAA+B,eAAe,SAAS;AAAA,IACpE,GAAG;AAAA,EAAA;AACN;AAGF,MAAM,WAAmD,CAAC;AAAA,EACxD;AAAA,EACA,GAAG;AACL,MACED,2BAAAA;AAAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC,SAAAA,GAAG,0BAA0B,eAAe,SAAS;AAAA,IAC/D,GAAG;AAAA,EAAA;AACN;AAGF,MAAM,WAAmD,CAAC;AAAA,EACxD;AAAA,EACA,GAAG;AACL,MACED,2BAAAA;AAAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC,SAAAA,GAAG,4BAA4B,eAAe,SAAS;AAAA,IACjE,GAAG;AAAA,EAAA;AACN;AAGF,MAAM,WAAmD,CAAC;AAAA,EACxD;AAAA,EACA,GAAG;AACL,MACED,2BAAAA;AAAAA,EAAC;AAAA,E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iBAAiB,OAAO,SAAS,KAAK,MAAM,GAAG,EAAE,CAAC;AACxD,YAAM,MAAM,GAAG,cAAc,IAAIA,GAAE;AAGnC,gBAAU,UAAU,UAAU,GAAG;AAEjC,mBAAaA,GAAE;AAAA,IACjB;AAAA,EACF;AAEA,SACEF,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,SAAS,cAAc,UAAU;AAAA,MACjC,cACE,cACI,8BAA8B,EAAE,wCAChC;AAAA,MAEN,WAAWC,SAAAA,GAAG,eAAe,aAAa,SAAS;AAAA,MAClD,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EAAA;AAGP;AAEO,MAAM,KAAuB,CAAC,EAAE,aAAa,GAAG,GAAG,MAAA,MACxDD,+BAAC,UAAA,EAAU,GAAG,MAAA,CAAO;AAGhB,MAAM,KAAuB,CAAC,EAAE,cAAc,OAAO,GAAG,MAAA,MAC7DA,+BAAC,gBAAA,EAAe,GAAG,UAAU,aAA2B,GAAG,MAAA,CAAO;AAE7D,MAAM,KAAuB,CAAC,EAAE,cAAc,OAAO,GAAG,MAAA,MAC7DA,+BAAC,gBAAA,EAAe,GAAG,UAAU,aAA2B,GAAG,MAAA,CAAO;AAE7D,MAAM,KAAuB,CAAC,EAAE,cAAc,OAAO,GAAG,MAAA,MAC7DA,+BAAC,gBAAA,EAAe,GAAG,UAAU,aAA2B,GAAG,MAAA,CAAO;AAE7D,MAAM,KAAuB,CAAC,EAAE,cAAc,OAAO,GAAG,MAAA,MAC7DA,+BAAC,gBAAA,EAAe,GAAG,UAAU,aAA2B,GAAG,MAAA,CAAO;AAG7D,MAAM,KAAuB,CAAC,EAAE,cAAc,OAAO,GAAG,MAAA,MAC7DA,+BAAC,gBAAA,EAAe,GAAG,UAAU,aAA2B,GAAG,MAAA,CAAO;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/Headers/index.tsx"],"sourcesContent":["import type { FC, HTMLAttributes, JSX, MouseEvent } from 'react';\nimport { cn } from '../../utils/cn';\n\nconst styledHeading = `relative scroll-mb-8 scroll-mt-[30vh] scroll-p-8`;\nconst styledAfter = `after:content-['#'] after:scale-75 after:px-6 after:text-neutral after:absolute after:top-0 after:h-full after:-left-12 after:hover:cursor-pointer after:absolute after:to-neutral after:md:opacity-0 after:transition-opacity hover:after:opacity-80 after:duration-200 after:delay-100`;\n\n/**\n * Styled H1 Component\n *\n * Primary heading component for page titles and main content headers.\n * Does not include clickable anchor functionality.\n */\nconst StyledH1: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => <h1 className={cn('mt-5 text-2xl font-bold', className)} {...props} />;\n\n/**\n * Styled H2 Component\n *\n * Secondary heading component with anchor link functionality when wrapped.\n * Used for major section headers in content.\n */\nconst StyledH2: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => (\n <h2\n className={cn('mt-16 mb-2 text-2xl font-bold', styledHeading, className)}\n {...props}\n />\n);\n\n/**\n * Styled H3 Component\n *\n * Tertiary heading component with anchor link functionality when wrapped.\n * Used for subsection headers in content.\n */\nconst StyledH3: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => (\n <h3\n className={cn('mt-5 mb-2 text-xl font-bold', styledHeading, className)}\n {...props}\n />\n);\n\n/**\n * Styled H4 Component\n *\n * Quaternary heading component with anchor link functionality when wrapped.\n * Used for minor section headers in content.\n */\nconst StyledH4: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => (\n <h4\n className={cn('mt-3 text-lg font-bold', styledHeading, className)}\n {...props}\n />\n);\n\n/**\n * Styled H5 Component\n *\n * Fifth-level heading component with anchor link functionality when wrapped.\n * Used for detailed subsection headers in content.\n */\nconst StyledH5: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => (\n <h5\n className={cn('mt-3 text-base font-bold', styledHeading, className)}\n {...props}\n />\n);\n\nconst StyledH6: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => (\n <h6\n className={cn('mt-3 ml-3 text-base font-bold', styledHeading, className)}\n {...props}\n />\n);\n\n/**\n * Props for heading components\n */\nexport type HeadingProps = HTMLAttributes<HTMLHeadingElement> & {\n /**\n * Whether the heading should be clickable with anchor link functionality.\n * Enables copy-to-clipboard URL behavior and smooth scrolling.\n * @default false (for H1), true (for H2-H5)\n */\n isClickable?: boolean;\n};\n\n/**\n * Internal props for the HeadingWrapper component\n */\ninterface HeadingGlobalProps extends HeadingProps {\n /** The styled heading component to render */\n H: FC<HTMLAttributes<HTMLHeadingElement>>;\n}\n\ntype HeadingType = (props: HeadingGlobalProps) => JSX.Element;\n\n/**\n * Utility function to generate URL-friendly ID from heading text\n * @param children - The heading text content\n * @returns URL-friendly string for use as element ID\n */\nconst getId = (children: string) =>\n String(children)\n // replace accents\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '')\n // replace spaces\n .replace(/\\s+/g, '-')\n .toLowerCase();\n\n/**\n * Utility function to smoothly scroll to an element by ID\n * @param id - The element ID to scroll to\n */\nconst scrollToHash = (id: string) => {\n const element = document.getElementById(id);\n const offset = 150;\n const y =\n (element?.getBoundingClientRect()?.top ?? 0) + window.scrollY - offset;\n\n window.scrollTo({ top: y, behavior: 'smooth' });\n};\n\n/**\n * Utility function to detect if the pseudo-element (#) after the heading was clicked\n * @param parentElem - The heading element\n * @param e - Mouse event\n * @returns Whether the after pseudo-element was clicked\n */\nconst afterClick = (parentElem: Element, e: MouseEvent<HTMLHeadingElement>) => {\n const parentLeft = parentElem.getBoundingClientRect().left,\n parentTop = parentElem.getBoundingClientRect().top;\n\n const after = window.getComputedStyle(parentElem, ':after');\n\n const afterStart = parentLeft + parseInt(after.getPropertyValue('left'), 10),\n afterEnd = afterStart + parseInt(after.width, 10);\n\n const afterYStart = parentTop + parseInt(after.getPropertyValue('top'), 10),\n afterYEnd = afterYStart + parseInt(after.height, 10);\n\n const mouseX = e.clientX,\n mouseY = e.clientY;\n\n const isAfterClicked: boolean =\n mouseX >= afterStart &&\n mouseX <= afterEnd &&\n mouseY >= afterYStart &&\n mouseY <= afterYEnd;\n\n return isAfterClicked;\n};\n\n/**\n * HeadingWrapper Component\n *\n * Internal wrapper component that adds anchor link functionality to headings.\n * Handles ID generation, click-to-copy URL behavior, and smooth scrolling.\n *\n * @component\n * @accessibility\n * - Generates URL-friendly IDs for deep linking\n * - Provides accessible labels for anchor link functionality\n * - Maintains proper heading hierarchy and semantics\n * - Supports keyboard navigation and screen readers\n */\nconst HeadingWrapper: HeadingType = ({\n H,\n children,\n className,\n isClickable,\n ...props\n}) => {\n const id = typeof children === 'string' ? getId(children) : undefined;\n\n const onClick = (e: MouseEvent<HTMLHeadingElement>) => {\n const { id } = e.currentTarget;\n\n const isAfterClicker = afterClick(e.currentTarget, e);\n\n if (isAfterClicker && typeof id === 'string') {\n const urlWithoutHash = window.location.href.split('#')[0];\n const url = `${urlWithoutHash}#${id}`;\n\n // copy the url to the clipboard\n navigator.clipboard.writeText(url);\n\n scrollToHash(id);\n }\n };\n\n return (\n <H\n id={id}\n onClick={isClickable ? onClick : undefined}\n aria-label={\n isClickable\n ? `Click to scroll to section ${id} and copy the link to the clipboard`\n : undefined\n }\n className={cn(isClickable && styledAfter, className)}\n {...props}\n >\n {children}\n </H>\n );\n};\n\n/**\n * H1 Component\n *\n * Primary page heading component. Does not include clickable anchor functionality\n * as it's typically used for main page titles rather than content sections.\n *\n * @example\n * ```tsx\n * <H1>Welcome to Our Website</H1>\n * <H1 className=\"text-blue-600\">Custom Styled Title</H1>\n * ```\n */\nexport const H1: FC<HeadingProps> = ({ isClickable: _, ...props }) => (\n <StyledH1 {...props} />\n);\n\n/**\n * H2 Component\n *\n * Secondary heading component with optional anchor link functionality.\n * Perfect for major section headers with deep-linking capabilities.\n *\n * @example\n * ```tsx\n * <H2>Getting Started</H2>\n * <H2 isClickable>API Reference</H2>\n * ```\n */\nexport const H2: FC<HeadingProps> = ({ isClickable = false, ...props }) => (\n <HeadingWrapper H={StyledH2} isClickable={isClickable} {...props} />\n);\n\n/**\n * H3 Component\n *\n * Tertiary heading component with optional anchor link functionality.\n * Used for subsection headers within major sections.\n *\n * @example\n * ```tsx\n * <H3>Configuration Options</H3>\n * <H3 isClickable>Advanced Settings</H3>\n * ```\n */\nexport const H3: FC<HeadingProps> = ({ isClickable = false, ...props }) => (\n <HeadingWrapper H={StyledH3} isClickable={isClickable} {...props} />\n);\n\n/**\n * H4 Component\n *\n * Fourth-level heading component with optional anchor link functionality.\n * Used for detailed section organization.\n *\n * @example\n * ```tsx\n * <H4>Implementation Details</H4>\n * <H4 isClickable>Code Examples</H4>\n * ```\n */\nexport const H4: FC<HeadingProps> = ({ isClickable = false, ...props }) => (\n <HeadingWrapper H={StyledH4} isClickable={isClickable} {...props} />\n);\n\n/**\n * H5 Component\n *\n * Fifth-level heading component with optional anchor link functionality.\n * Used for fine-grained content organization.\n *\n * @example\n * ```tsx\n * <H5>Technical Notes</H5>\n * <H5 isClickable>Best Practices</H5>\n * ```\n */\nexport const H5: FC<HeadingProps> = ({ isClickable = false, ...props }) => (\n <HeadingWrapper H={StyledH5} isClickable={isClickable} {...props} />\n);\n\nexport const H6: FC<HeadingProps> = ({ isClickable = false, ...props }) => (\n <HeadingWrapper H={StyledH6} isClickable={isClickable} {...props} />\n);\n"],"names":["jsx","cn","id"],"mappings":";;;;AAGA,MAAM,gBAAgB;AACtB,MAAM,cAAc;AAQpB,MAAM,WAAmD,CAAC;AAAA,EACxD;AAAA,EACA,GAAG;AACL,MAAMA,2BAAAA,IAAC,QAAG,WAAWC,SAAAA,GAAG,2BAA2B,SAAS,GAAI,GAAG,OAAO;AAQ1E,MAAM,WAAmD,CAAC;AAAA,EACxD;AAAA,EACA,GAAG;AACL,MACED,2BAAAA;AAAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC,SAAAA,GAAG,iCAAiC,eAAe,SAAS;AAAA,IACtE,GAAG;AAAA,EAAA;AACN;AASF,MAA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G,UAAU,aAA2B,GAAG,MAAA,CAAO;AAe7D,MAAM,KAAuB,CAAC,EAAE,cAAc,OAAO,GAAG,MAAA,MAC7DA,+BAAC,gBAAA,EAAe,GAAG,UAAU,aAA2B,GAAG,MAAA,CAAO;AAe7D,MAAM,KAAuB,CAAC,EAAE,cAAc,OAAO,GAAG,MAAA,MAC7DA,+BAAC,gBAAA,EAAe,GAAG,UAAU,aAA2B,GAAG,MAAA,CAAO;AAe7D,MAAM,KAAuB,CAAC,EAAE,cAAc,OAAO,GAAG,MAAA,MAC7DA,+BAAC,gBAAA,EAAe,GAAG,UAAU,aAA2B,GAAG,MAAA,CAAO;AAG7D,MAAM,KAAuB,CAAC,EAAE,cAAc,OAAO,GAAG,MAAA,MAC7DA,+BAAC,gBAAA,EAAe,GAAG,UAAU,aAA2B,GAAG,MAAA,CAAO;;;;;;;"}
@@ -1,12 +1,79 @@
1
1
  import { FC, HTMLAttributes } from 'react';
2
- type HeadingProps = HTMLAttributes<HTMLHeadingElement> & {
2
+ /**
3
+ * Props for heading components
4
+ */
5
+ export type HeadingProps = HTMLAttributes<HTMLHeadingElement> & {
6
+ /**
7
+ * Whether the heading should be clickable with anchor link functionality.
8
+ * Enables copy-to-clipboard URL behavior and smooth scrolling.
9
+ * @default false (for H1), true (for H2-H5)
10
+ */
3
11
  isClickable?: boolean;
4
12
  };
13
+ /**
14
+ * H1 Component
15
+ *
16
+ * Primary page heading component. Does not include clickable anchor functionality
17
+ * as it's typically used for main page titles rather than content sections.
18
+ *
19
+ * @example
20
+ * ```tsx
21
+ * <H1>Welcome to Our Website</H1>
22
+ * <H1 className="text-blue-600">Custom Styled Title</H1>
23
+ * ```
24
+ */
5
25
  export declare const H1: FC<HeadingProps>;
26
+ /**
27
+ * H2 Component
28
+ *
29
+ * Secondary heading component with optional anchor link functionality.
30
+ * Perfect for major section headers with deep-linking capabilities.
31
+ *
32
+ * @example
33
+ * ```tsx
34
+ * <H2>Getting Started</H2>
35
+ * <H2 isClickable>API Reference</H2>
36
+ * ```
37
+ */
6
38
  export declare const H2: FC<HeadingProps>;
39
+ /**
40
+ * H3 Component
41
+ *
42
+ * Tertiary heading component with optional anchor link functionality.
43
+ * Used for subsection headers within major sections.
44
+ *
45
+ * @example
46
+ * ```tsx
47
+ * <H3>Configuration Options</H3>
48
+ * <H3 isClickable>Advanced Settings</H3>
49
+ * ```
50
+ */
7
51
  export declare const H3: FC<HeadingProps>;
52
+ /**
53
+ * H4 Component
54
+ *
55
+ * Fourth-level heading component with optional anchor link functionality.
56
+ * Used for detailed section organization.
57
+ *
58
+ * @example
59
+ * ```tsx
60
+ * <H4>Implementation Details</H4>
61
+ * <H4 isClickable>Code Examples</H4>
62
+ * ```
63
+ */
8
64
  export declare const H4: FC<HeadingProps>;
65
+ /**
66
+ * H5 Component
67
+ *
68
+ * Fifth-level heading component with optional anchor link functionality.
69
+ * Used for fine-grained content organization.
70
+ *
71
+ * @example
72
+ * ```tsx
73
+ * <H5>Technical Notes</H5>
74
+ * <H5 isClickable>Best Practices</H5>
75
+ * ```
76
+ */
9
77
  export declare const H5: FC<HeadingProps>;
10
78
  export declare const H6: FC<HeadingProps>;
11
- export {};
12
79
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Headers/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,cAAc,EAAmB,MAAM,OAAO,CAAC;AA6DjE,KAAK,YAAY,GAAG,cAAc,CAAC,kBAAkB,CAAC,GAAG;IACvD,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AA0FF,eAAO,MAAM,EAAE,EAAE,EAAE,CAAC,YAAY,CAE/B,CAAC;AAEF,eAAO,MAAM,EAAE,EAAE,EAAE,CAAC,YAAY,CAE/B,CAAC;AACF,eAAO,MAAM,EAAE,EAAE,EAAE,CAAC,YAAY,CAE/B,CAAC;AACF,eAAO,MAAM,EAAE,EAAE,EAAE,CAAC,YAAY,CAE/B,CAAC;AACF,eAAO,MAAM,EAAE,EAAE,EAAE,CAAC,YAAY,CAE/B,CAAC;AAEF,eAAO,MAAM,EAAE,EAAE,EAAE,CAAC,YAAY,CAE/B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Headers/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,cAAc,EAAmB,MAAM,OAAO,CAAC;AA2FjE;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,kBAAkB,CAAC,GAAG;IAC9D;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AA4HF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,EAAE,EAAE,EAAE,CAAC,YAAY,CAE/B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,EAAE,EAAE,EAAE,CAAC,YAAY,CAE/B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,EAAE,EAAE,EAAE,CAAC,YAAY,CAE/B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,EAAE,EAAE,EAAE,CAAC,YAAY,CAE/B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,EAAE,EAAE,EAAE,CAAC,YAAY,CAE/B,CAAC;AAEF,eAAO,MAAM,EAAE,EAAE,EAAE,CAAC,YAAY,CAE/B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../src/components/Headers/index.tsx"],"sourcesContent":["import type { FC, HTMLAttributes, JSX, MouseEvent } from 'react';\nimport { cn } from '../../utils/cn';\n\nconst styledHeading = `relative scroll-mb-8 scroll-mt-[30vh] scroll-p-8`;\nconst styledAfter = `after:content-['#'] after:scale-75 after:px-6 after:text-neutral after:absolute after:top-0 after:h-full after:-left-12 after:hover:cursor-pointer after:absolute after:to-neutral after:md:opacity-0 after:transition-opacity hover:after:opacity-80 after:duration-200 after:delay-100`;\n\nconst StyledH1: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => <h1 className={cn('mt-5 text-2xl font-bold', className)} {...props} />;\n\nconst StyledH2: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => (\n <h2\n className={cn('mt-16 mb-2 text-2xl font-bold', styledHeading, className)}\n {...props}\n />\n);\n\nconst StyledH3: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => (\n <h3\n className={cn('mt-5 mb-2 text-xl font-bold', styledHeading, className)}\n {...props}\n />\n);\n\nconst StyledH4: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => (\n <h4\n className={cn('mt-3 text-lg font-bold', styledHeading, className)}\n {...props}\n />\n);\n\nconst StyledH5: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => (\n <h5\n className={cn('mt-3 text-base font-bold', styledHeading, className)}\n {...props}\n />\n);\n\nconst StyledH6: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => (\n <h6\n className={cn('mt-3 ml-3 text-base font-bold', styledHeading, className)}\n {...props}\n />\n);\n\ntype HeadingProps = HTMLAttributes<HTMLHeadingElement> & {\n isClickable?: boolean;\n};\ntype HeadingGlobalProps = HeadingProps & {\n H: FC<HTMLAttributes<HTMLHeadingElement>>;\n};\ntype HeadingType = (props: HeadingGlobalProps) => JSX.Element;\n\nconst getId = (children: string) =>\n String(children)\n // replace accents\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '')\n // replace spaces\n .replace(/\\s+/g, '-')\n .toLowerCase();\n\nconst scrollToHash = (id: string) => {\n const element = document.getElementById(id);\n const offset = 150;\n const y =\n (element?.getBoundingClientRect()?.top ?? 0) + window.scrollY - offset;\n\n window.scrollTo({ top: y, behavior: 'smooth' });\n};\n\nconst afterClick = (parentElem: Element, e: MouseEvent<HTMLHeadingElement>) => {\n const parentLeft = parentElem.getBoundingClientRect().left,\n parentTop = parentElem.getBoundingClientRect().top;\n\n const after = window.getComputedStyle(parentElem, ':after');\n\n const afterStart = parentLeft + parseInt(after.getPropertyValue('left'), 10),\n afterEnd = afterStart + parseInt(after.width, 10);\n\n const afterYStart = parentTop + parseInt(after.getPropertyValue('top'), 10),\n afterYEnd = afterYStart + parseInt(after.height, 10);\n\n const mouseX = e.clientX,\n mouseY = e.clientY;\n\n const isAfterClicked: boolean =\n mouseX >= afterStart &&\n mouseX <= afterEnd &&\n mouseY >= afterYStart &&\n mouseY <= afterYEnd;\n\n return isAfterClicked;\n};\n\nconst HeadingWrapper: HeadingType = ({\n H,\n children,\n className,\n isClickable,\n ...props\n}) => {\n const id = typeof children === 'string' ? getId(children) : undefined;\n\n const onClick = (e: MouseEvent<HTMLHeadingElement>) => {\n const { id } = e.currentTarget;\n\n const isAfterClicker = afterClick(e.currentTarget, e);\n\n if (isAfterClicker && typeof id === 'string') {\n const urlWithoutHash = window.location.href.split('#')[0];\n const url = `${urlWithoutHash}#${id}`;\n\n // copy the url to the clipboard\n navigator.clipboard.writeText(url);\n\n scrollToHash(id);\n }\n };\n\n return (\n <H\n id={id}\n onClick={isClickable ? onClick : undefined}\n aria-label={\n isClickable\n ? `Click to scroll to section ${id} and copy the link to the clipboard`\n : undefined\n }\n className={cn(isClickable && styledAfter, className)}\n {...props}\n >\n {children}\n </H>\n );\n};\n\nexport const H1: FC<HeadingProps> = ({ isClickable: _, ...props }) => (\n <StyledH1 {...props} />\n);\n\nexport const H2: FC<HeadingProps> = ({ isClickable = false, ...props }) => (\n <HeadingWrapper H={StyledH2} isClickable={isClickable} {...props} />\n);\nexport const H3: FC<HeadingProps> = ({ isClickable = false, ...props }) => (\n <HeadingWrapper H={StyledH3} isClickable={isClickable} {...props} />\n);\nexport const H4: FC<HeadingProps> = ({ isClickable = false, ...props }) => (\n <HeadingWrapper H={StyledH4} isClickable={isClickable} {...props} />\n);\nexport const H5: FC<HeadingProps> = ({ isClickable = false, ...props }) => (\n <HeadingWrapper H={StyledH5} isClickable={isClickable} {...props} />\n);\n\nexport const H6: FC<HeadingProps> = ({ isClickable = false, ...props }) => (\n <HeadingWrapper H={StyledH6} isClickable={isClickable} {...props} />\n);\n"],"names":["id"],"mappings":";;AAGA,MAAM,gBAAgB;AACtB,MAAM,cAAc;AAEpB,MAAM,WAAmD,CAAC;AAAA,EACxD;AAAA,EACA,GAAG;AACL,MAAM,oBAAC,QAAG,WAAW,GAAG,2BAA2B,SAAS,GAAI,GAAG,OAAO;AAE1E,MAAM,WAAmD,CAAC;AAAA,EACxD;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAW,GAAG,iCAAiC,eAAe,SAAS;AAAA,IACtE,GAAG;AAAA,EAAA;AACN;AAGF,MAAM,WAAmD,CAAC;AAAA,EACxD;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAW,GAAG,+BAA+B,eAAe,SAAS;AAAA,IACpE,GAAG;AAAA,EAAA;AACN;AAGF,MAAM,WAAmD,CAAC;AAAA,EACxD;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAW,GAAG,0BAA0B,eAAe,SAAS;AAAA,IAC/D,GAAG;AAAA,EAAA;AACN;AAGF,MAAM,WAAmD,CAAC;AAAA,EACxD;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAW,GAAG,4BAA4B,eAAe,SAAS;AAAA,IACjE,GAAG;AAAA,EAAA;AACN;AAGF,MAAM,WAAmD,CAAC;AAAA,EACxD;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAW,GAAG,iCAAiC,eAAe,SAAS;AAAA,IACtE,GAAG;AAAA,EAAA;AACN;AAWF,MAAM,QAAQ,CAAC,aACb,OAAO,QAAQ,EAEZ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,GAAE;AAAA,IACjB;AAAA,EACF;AAEA,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,SAAS,cAAc,UAAU;AAAA,MACjC,cACE,cACI,8BAA8B,EAAE,wCAChC;AAAA,MAEN,WAAW,GAAG,eAAe,aAAa,SAAS;AAAA,MAClD,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EAAA;AAGP;AAEO,MAAM,KAAuB,CAAC,EAAE,aAAa,GAAG,GAAG,MAAA,MACxD,oBAAC,UAAA,EAAU,GAAG,MAAA,CAAO;AAGhB,MAAM,KAAuB,CAAC,EAAE,cAAc,OAAO,GAAG,MAAA,MAC7D,oBAAC,gBAAA,EAAe,GAAG,UAAU,aAA2B,GAAG,MAAA,CAAO;AAE7D,MAAM,KAAuB,CAAC,EAAE,cAAc,OAAO,GAAG,MAAA,MAC7D,oBAAC,gBAAA,EAAe,GAAG,UAAU,aAA2B,GAAG,MAAA,CAAO;AAE7D,MAAM,KAAuB,CAAC,EAAE,cAAc,OAAO,GAAG,MAAA,MAC7D,oBAAC,gBAAA,EAAe,GAAG,UAAU,aAA2B,GAAG,MAAA,CAAO;AAE7D,MAAM,KAAuB,CAAC,EAAE,cAAc,OAAO,GAAG,MAAA,MAC7D,oBAAC,gBAAA,EAAe,GAAG,UAAU,aAA2B,GAAG,MAAA,CAAO;AAG7D,MAAM,KAAuB,CAAC,EAAE,cAAc,OAAO,GAAG,MAAA,MAC7D,oBAAC,gBAAA,EAAe,GAAG,UAAU,aAA2B,GAAG,MAAA,CAAO;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../src/components/Headers/index.tsx"],"sourcesContent":["import type { FC, HTMLAttributes, JSX, MouseEvent } from 'react';\nimport { cn } from '../../utils/cn';\n\nconst styledHeading = `relative scroll-mb-8 scroll-mt-[30vh] scroll-p-8`;\nconst styledAfter = `after:content-['#'] after:scale-75 after:px-6 after:text-neutral after:absolute after:top-0 after:h-full after:-left-12 after:hover:cursor-pointer after:absolute after:to-neutral after:md:opacity-0 after:transition-opacity hover:after:opacity-80 after:duration-200 after:delay-100`;\n\n/**\n * Styled H1 Component\n *\n * Primary heading component for page titles and main content headers.\n * Does not include clickable anchor functionality.\n */\nconst StyledH1: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => <h1 className={cn('mt-5 text-2xl font-bold', className)} {...props} />;\n\n/**\n * Styled H2 Component\n *\n * Secondary heading component with anchor link functionality when wrapped.\n * Used for major section headers in content.\n */\nconst StyledH2: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => (\n <h2\n className={cn('mt-16 mb-2 text-2xl font-bold', styledHeading, className)}\n {...props}\n />\n);\n\n/**\n * Styled H3 Component\n *\n * Tertiary heading component with anchor link functionality when wrapped.\n * Used for subsection headers in content.\n */\nconst StyledH3: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => (\n <h3\n className={cn('mt-5 mb-2 text-xl font-bold', styledHeading, className)}\n {...props}\n />\n);\n\n/**\n * Styled H4 Component\n *\n * Quaternary heading component with anchor link functionality when wrapped.\n * Used for minor section headers in content.\n */\nconst StyledH4: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => (\n <h4\n className={cn('mt-3 text-lg font-bold', styledHeading, className)}\n {...props}\n />\n);\n\n/**\n * Styled H5 Component\n *\n * Fifth-level heading component with anchor link functionality when wrapped.\n * Used for detailed subsection headers in content.\n */\nconst StyledH5: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => (\n <h5\n className={cn('mt-3 text-base font-bold', styledHeading, className)}\n {...props}\n />\n);\n\nconst StyledH6: FC<HTMLAttributes<HTMLHeadingElement>> = ({\n className,\n ...props\n}) => (\n <h6\n className={cn('mt-3 ml-3 text-base font-bold', styledHeading, className)}\n {...props}\n />\n);\n\n/**\n * Props for heading components\n */\nexport type HeadingProps = HTMLAttributes<HTMLHeadingElement> & {\n /**\n * Whether the heading should be clickable with anchor link functionality.\n * Enables copy-to-clipboard URL behavior and smooth scrolling.\n * @default false (for H1), true (for H2-H5)\n */\n isClickable?: boolean;\n};\n\n/**\n * Internal props for the HeadingWrapper component\n */\ninterface HeadingGlobalProps extends HeadingProps {\n /** The styled heading component to render */\n H: FC<HTMLAttributes<HTMLHeadingElement>>;\n}\n\ntype HeadingType = (props: HeadingGlobalProps) => JSX.Element;\n\n/**\n * Utility function to generate URL-friendly ID from heading text\n * @param children - The heading text content\n * @returns URL-friendly string for use as element ID\n */\nconst getId = (children: string) =>\n String(children)\n // replace accents\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '')\n // replace spaces\n .replace(/\\s+/g, '-')\n .toLowerCase();\n\n/**\n * Utility function to smoothly scroll to an element by ID\n * @param id - The element ID to scroll to\n */\nconst scrollToHash = (id: string) => {\n const element = document.getElementById(id);\n const offset = 150;\n const y =\n (element?.getBoundingClientRect()?.top ?? 0) + window.scrollY - offset;\n\n window.scrollTo({ top: y, behavior: 'smooth' });\n};\n\n/**\n * Utility function to detect if the pseudo-element (#) after the heading was clicked\n * @param parentElem - The heading element\n * @param e - Mouse event\n * @returns Whether the after pseudo-element was clicked\n */\nconst afterClick = (parentElem: Element, e: MouseEvent<HTMLHeadingElement>) => {\n const parentLeft = parentElem.getBoundingClientRect().left,\n parentTop = parentElem.getBoundingClientRect().top;\n\n const after = window.getComputedStyle(parentElem, ':after');\n\n const afterStart = parentLeft + parseInt(after.getPropertyValue('left'), 10),\n afterEnd = afterStart + parseInt(after.width, 10);\n\n const afterYStart = parentTop + parseInt(after.getPropertyValue('top'), 10),\n afterYEnd = afterYStart + parseInt(after.height, 10);\n\n const mouseX = e.clientX,\n mouseY = e.clientY;\n\n const isAfterClicked: boolean =\n mouseX >= afterStart &&\n mouseX <= afterEnd &&\n mouseY >= afterYStart &&\n mouseY <= afterYEnd;\n\n return isAfterClicked;\n};\n\n/**\n * HeadingWrapper Component\n *\n * Internal wrapper component that adds anchor link functionality to headings.\n * Handles ID generation, click-to-copy URL behavior, and smooth scrolling.\n *\n * @component\n * @accessibility\n * - Generates URL-friendly IDs for deep linking\n * - Provides accessible labels for anchor link functionality\n * - Maintains proper heading hierarchy and semantics\n * - Supports keyboard navigation and screen readers\n */\nconst HeadingWrapper: HeadingType = ({\n H,\n children,\n className,\n isClickable,\n ...props\n}) => {\n const id = typeof children === 'string' ? getId(children) : undefined;\n\n const onClick = (e: MouseEvent<HTMLHeadingElement>) => {\n const { id } = e.currentTarget;\n\n const isAfterClicker = afterClick(e.currentTarget, e);\n\n if (isAfterClicker && typeof id === 'string') {\n const urlWithoutHash = window.location.href.split('#')[0];\n const url = `${urlWithoutHash}#${id}`;\n\n // copy the url to the clipboard\n navigator.clipboard.writeText(url);\n\n scrollToHash(id);\n }\n };\n\n return (\n <H\n id={id}\n onClick={isClickable ? onClick : undefined}\n aria-label={\n isClickable\n ? `Click to scroll to section ${id} and copy the link to the clipboard`\n : undefined\n }\n className={cn(isClickable && styledAfter, className)}\n {...props}\n >\n {children}\n </H>\n );\n};\n\n/**\n * H1 Component\n *\n * Primary page heading component. Does not include clickable anchor functionality\n * as it's typically used for main page titles rather than content sections.\n *\n * @example\n * ```tsx\n * <H1>Welcome to Our Website</H1>\n * <H1 className=\"text-blue-600\">Custom Styled Title</H1>\n * ```\n */\nexport const H1: FC<HeadingProps> = ({ isClickable: _, ...props }) => (\n <StyledH1 {...props} />\n);\n\n/**\n * H2 Component\n *\n * Secondary heading component with optional anchor link functionality.\n * Perfect for major section headers with deep-linking capabilities.\n *\n * @example\n * ```tsx\n * <H2>Getting Started</H2>\n * <H2 isClickable>API Reference</H2>\n * ```\n */\nexport const H2: FC<HeadingProps> = ({ isClickable = false, ...props }) => (\n <HeadingWrapper H={StyledH2} isClickable={isClickable} {...props} />\n);\n\n/**\n * H3 Component\n *\n * Tertiary heading component with optional anchor link functionality.\n * Used for subsection headers within major sections.\n *\n * @example\n * ```tsx\n * <H3>Configuration Options</H3>\n * <H3 isClickable>Advanced Settings</H3>\n * ```\n */\nexport const H3: FC<HeadingProps> = ({ isClickable = false, ...props }) => (\n <HeadingWrapper H={StyledH3} isClickable={isClickable} {...props} />\n);\n\n/**\n * H4 Component\n *\n * Fourth-level heading component with optional anchor link functionality.\n * Used for detailed section organization.\n *\n * @example\n * ```tsx\n * <H4>Implementation Details</H4>\n * <H4 isClickable>Code Examples</H4>\n * ```\n */\nexport const H4: FC<HeadingProps> = ({ isClickable = false, ...props }) => (\n <HeadingWrapper H={StyledH4} isClickable={isClickable} {...props} />\n);\n\n/**\n * H5 Component\n *\n * Fifth-level heading component with optional anchor link functionality.\n * Used for fine-grained content organization.\n *\n * @example\n * ```tsx\n * <H5>Technical Notes</H5>\n * <H5 isClickable>Best Practices</H5>\n * ```\n */\nexport const H5: FC<HeadingProps> = ({ isClickable = false, ...props }) => (\n <HeadingWrapper H={StyledH5} isClickable={isClickable} {...props} />\n);\n\nexport const H6: FC<HeadingProps> = ({ isClickable = false, ...props }) => (\n <HeadingWrapper H={StyledH6} isClickable={isClickable} {...props} />\n);\n"],"names":["id"],"mappings":";;AAGA,MAAM,gBAAgB;AACtB,MAAM,cAAc;AAQpB,MAAM,WAAmD,CAAC;AAAA,EACxD;AAAA,EACA,GAAG;AACL,MAAM,oBAAC,QAAG,WAAW,GAAG,2BAA2B,SAAS,GAAI,GAAG,OAAO;AAQ1E,MAAM,WAAmD,CAAC;AAAA,EACxD;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAW,GAAG,iCAAiC,eAAe,SAAS;AAAA,IACtE,GAAG;AAAA,EAAA;AACN;AASF,MAAM,WAAmD,CAAC;AAAA,EACxD;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAW,GAAG,+BAA+B,eAAe,SAAS;AAAA,IACpE,GAAG;AAAA,EAAA;AACN;AASF,MAAM,WAAmD,CAAC;AAAA,EACxD;AAAA,EACA,GAAG;AACL,MACE;A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,OAAO,GAAG,MAAA,MAC7D,oBAAC,gBAAA,EAAe,GAAG,UAAU,aAA2B,GAAG,MAAA,CAAO;AAG7D,MAAM,KAAuB,CAAC,EAAE,cAAc,OAAO,GAAG,MAAA,MAC7D,oBAAC,gBAAA,EAAe,GAAG,UAAU,aAA2B,GAAG,MAAA,CAAO;"}
@@ -28,7 +28,7 @@ const HeightResizer = ({
28
28
  const resize = ReactExports.useCallback(
29
29
  (mouseMoveEvent) => {
30
30
  const container = containerRef.current;
31
- if (isResizing && container && parent) {
31
+ if (isResizing && container) {
32
32
  const { height: containerHeight, top: containerTop } = container.getBoundingClientRect();
33
33
  let clientY = 0;
34
34
  if (mouseMoveEvent instanceof MouseEvent) {
@@ -38,11 +38,14 @@ const HeightResizer = ({
38
38
  }
39
39
  const resizeDifference = clientY - containerTop;
40
40
  const newHeight = containerHeight - resizeDifference;
41
- const correctedHeight = Math.max(newHeight, 0);
41
+ let correctedHeight = Math.max(newHeight, minHeight);
42
+ if (maxHeight !== void 0) {
43
+ correctedHeight = Math.min(correctedHeight, maxHeight);
44
+ }
42
45
  setHeight(correctedHeight);
43
46
  }
44
47
  },
45
- [isResizing]
48
+ [isResizing, minHeight, maxHeight]
46
49
  );
47
50
  ReactExports.useEffect(() => {
48
51
  window.addEventListener("mousemove", resize, { passive: true });
@@ -60,15 +63,15 @@ const HeightResizer = ({
60
63
  "div",
61
64
  {
62
65
  className: utils_cn.cn(
63
- minHeight && `max-w-[${maxHeight}px]`,
64
- maxHeight && `min-w-[${minHeight}px]`,
65
66
  "relative h-full w-full max-h-[80%] cursor-ns-resize border-t-[2px] border-neutral-200 transition dark:border-neutral-950",
66
67
  'before:absolute before:top-0 before:z-10 before:left-1/2 before:block before:w-10 before:h-2 before:-translate-y-1/2 before:-translate-x-1/2 before:transform before:cursor-ns-resize before:rounded-full before:bg-neutral-200 before:transition before:content-[""] dark:before:bg-neutral-950',
67
68
  "active:border-neutral-400 active:before:bg-neutral-400 dark:active:border-neutral-600 active:dark:before:bg-neutral-600",
68
69
  className
69
70
  ),
70
71
  style: {
71
- height: `${height}px`
72
+ height: `${height}px`,
73
+ maxHeight: maxHeight ? `${maxHeight}px` : void 0,
74
+ minHeight: `${minHeight}px`
72
75
  },
73
76
  ref: containerRef,
74
77
  onMouseDown: startResizing,
@@ -76,7 +79,7 @@ const HeightResizer = ({
76
79
  "aria-valuemin": minHeight,
77
80
  "aria-valuemax": maxHeight,
78
81
  "aria-valuenow": height,
79
- "aria-label": "Resizable component",
82
+ "aria-label": "Resizable component - drag the handle to adjust height",
80
83
  role: "slider",
81
84
  tabIndex: 0,
82
85
  ...props,
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/components/HeightResizer/index.tsx"],"sourcesContent":["'use client';\n\nimport React, {\n DetailedHTMLProps,\n HTMLAttributes,\n useCallback,\n useEffect,\n useRef,\n useState,\n type FC,\n type PropsWithChildren,\n} from 'react';\nimport { cn } from '../../utils/cn';\n\ntype HeightResizerProps = {\n initialHeight: number;\n maxHeight?: number;\n minHeight?: number;\n} & DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;\n\nexport const HeightResizer: FC<PropsWithChildren<HeightResizerProps>> = ({\n initialHeight,\n maxHeight,\n minHeight = 0,\n children,\n className,\n ...props\n}) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const [height, setHeight] = useState(initialHeight);\n const [isResizing, setIsResizing] = useState(false);\n\n // Handler to start resizing\n const startResizing = useCallback(\n (\n mouseDownEvent:\n | React.MouseEvent<HTMLDivElement>\n | React.TouchEvent<HTMLDivElement>\n ) => {\n setIsResizing(true);\n mouseDownEvent.preventDefault();\n },\n []\n );\n\n // Handler to stop resizing\n const stopResizing = useCallback(() => {\n setIsResizing(false);\n }, []);\n\n // Handler to resize the div\n const resize = useCallback(\n (mouseMoveEvent: MouseEvent | TouchEvent) => {\n const container = containerRef.current;\n if (isResizing && container && parent) {\n const { height: containerHeight, top: containerTop } =\n container.getBoundingClientRect();\n\n let clientY = 0;\n if (mouseMoveEvent instanceof MouseEvent) {\n clientY = mouseMoveEvent.clientY;\n } else if (mouseMoveEvent instanceof TouchEvent) {\n clientY = mouseMoveEvent.touches[0].clientY;\n }\n\n const resizeDifference = clientY - containerTop;\n const newHeight = containerHeight - resizeDifference;\n const correctedHeight = Math.max(newHeight, 0);\n\n setHeight(correctedHeight);\n }\n },\n [isResizing]\n );\n\n // Add event listeners for mouse move and mouse up\n useEffect(() => {\n window.addEventListener('mousemove', resize, { passive: true });\n window.addEventListener('mouseup', stopResizing);\n window.addEventListener('touchmove', resize, { passive: true });\n window.addEventListener('touchend', stopResizing);\n\n return () => {\n window.removeEventListener('mousemove', resize);\n window.removeEventListener('mouseup', stopResizing);\n window.removeEventListener('touchmove', resize);\n window.removeEventListener('touchend', stopResizing);\n };\n }, [resize, stopResizing]);\n\n return (\n <div\n className={cn(\n minHeight && `max-w-[${maxHeight}px]`,\n maxHeight && `min-w-[${minHeight}px]`,\n 'relative h-full w-full max-h-[80%] cursor-ns-resize border-t-[2px] border-neutral-200 transition dark:border-neutral-950',\n 'before:absolute before:top-0 before:z-10 before:left-1/2 before:block before:w-10 before:h-2 before:-translate-y-1/2 before:-translate-x-1/2 before:transform before:cursor-ns-resize before:rounded-full before:bg-neutral-200 before:transition before:content-[\"\"] dark:before:bg-neutral-950',\n 'active:border-neutral-400 active:before:bg-neutral-400 dark:active:border-neutral-600 active:dark:before:bg-neutral-600',\n className\n )}\n style={{\n height: `${height}px`,\n }}\n ref={containerRef}\n onMouseDown={startResizing}\n onTouchStart={startResizing}\n aria-valuemin={minHeight}\n aria-valuemax={maxHeight}\n aria-valuenow={height}\n aria-label=\"Resizable component\"\n role=\"slider\"\n tabIndex={0}\n {...props}\n >\n <div\n className=\"absolute left-0 top-0 size-full cursor-default overflow-hidden\"\n onMouseDown={(e) => e.stopPropagation()}\n onTouchStart={(e) => e.stopPropagation()}\n >\n {children}\n </div>\n </div>\n );\n};\n"],"names":["useRef","useState","useCallback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O,MAAM;AACX,aAAO,oBAAoB,aAAa,MAAM;AAC9C,aAAO,oBAAoB,WAAW,YAAY;AAClD,aAAO,oBAAoB,aAAa,MAAM;AAC9C,aAAO,oBAAoB,YAAY,YAAY;AAAA,IACrD;AAAA,EACF,GAAG,CAAC,QAAQ,YAAY,CAAC;AAEzB,SACEC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,SAAAA;AAAAA,QACT,aAAa,UAAU,SAAS;AAAA,QAChC,aAAa,UAAU,SAAS;AAAA,QAChC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,MAEF,OAAO;AAAA,QACL,QAAQ,GAAG,MAAM;AAAA,MAAA;AAAA,MAEnB,KAAK;AAAA,MACL,aAAa;AAAA,MACb,cAAc;AAAA,MACd,iBAAe;AAAA,MACf,iBAAe;AAAA,MACf,iBAAe;AAAA,MACf,cAAW;AAAA,MACX,MAAK;AAAA,MACL,UAAU;AAAA,MACT,GAAG;AAAA,MAEJ,UAAAD,2BAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,aAAa,CAAC,MAAM,EAAE,gBAAA;AAAA,UACtB,cAAc,CAAC,MAAM,EAAE,gBAAA;AAAA,UAEtB;AAAA,QAAA;AAAA,MAAA;AAAA,IACH;AAAA,EAAA;AAGN;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/HeightResizer/index.tsx"],"sourcesContent":["'use client';\n\nimport React, {\n DetailedHTMLProps,\n HTMLAttributes,\n useCallback,\n useEffect,\n useRef,\n useState,\n type FC,\n type PropsWithChildren,\n} from 'react';\nimport { cn } from '../../utils/cn';\n\n/**\n * Props for the HeightResizer component\n *\n * @interface HeightResizerProps\n */\ntype HeightResizerProps = {\n /**\n * Initial height in pixels for the resizable container\n * Sets the default size when the component first loads\n * @example 200\n */\n initialHeight: number;\n\n /**\n * Maximum height in pixels that the user can resize to (optional)\n * When undefined, no maximum limit is enforced\n * @example 500\n */\n maxHeight?: number;\n\n /**\n * Minimum height in pixels that the user can resize to (optional)\n * Prevents the container from being resized below this threshold\n * @default 0\n * @example 50\n */\n minHeight?: number;\n} & DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;\n\n/**\n * HeightResizer Component\n *\n * A resizable container component that allows users to dynamically adjust the height\n * by dragging a visual handle at the top. Provides smooth resizing with optional\n * minimum and maximum height constraints.\n *\n * ## Key Features\n * - **Interactive Resizing**: Drag handle to resize container vertically\n * - **Touch Support**: Full support for touch devices and mobile interactions\n * - **Height Constraints**: Optional minimum and maximum height limits\n * - **Visual Feedback**: Handle with hover and active states for clear interaction\n * - **Accessibility**: ARIA slider role with value announcements for screen readers\n * - **Smooth Animation**: CSS transitions for polished user experience\n *\n * ## Use Cases\n * - Code editors with resizable panels\n * - Chat interfaces with adjustable message areas\n * - Dashboard widgets with user-customizable sizes\n * - Documentation viewers with resizable content panes\n * - Settings panels with expandable sections\n *\n * ## Interaction Model\n * The component uses a drag interaction model where users click and drag the visual\n * handle (rounded bar) at the top of the container. The resize calculation is based\n * on the difference between the current cursor position and the container's top edge.\n *\n * ## Accessibility Features\n * - **ARIA Slider**: Proper slider role for assistive technologies\n * - **Value Announcements**: Current, min, and max values announced to screen readers\n * - **Keyboard Navigation**: Focusable with standard slider keyboard support\n * - **Visual Indicators**: Clear visual handle for drag interaction\n *\n * @component\n * @example\n * ```tsx\n * // Basic usage\n * <HeightResizer initialHeight={200}>\n * <div>Your resizable content here</div>\n * </HeightResizer>\n *\n * // With height constraints\n * <HeightResizer\n * initialHeight={300}\n * minHeight={100}\n * maxHeight={600}\n * >\n * <div>Content with size limits</div>\n * </HeightResizer>\n *\n * // In a code editor context\n * <HeightResizer\n * initialHeight={400}\n * minHeight={150}\n * className=\"border rounded-lg\"\n * >\n * <CodeEditor />\n * </HeightResizer>\n * ```\n *\n * @param props - HeightResizer component props\n * @param props.initialHeight - Starting height in pixels\n * @param props.minHeight - Optional minimum height constraint\n * @param props.maxHeight - Optional maximum height constraint\n * @param props.children - Content to display in the resizable container\n * @param props.className - Additional CSS classes for styling\n * @returns Interactive resizable container component\n */\nexport const HeightResizer: FC<PropsWithChildren<HeightResizerProps>> = ({\n initialHeight,\n maxHeight,\n minHeight = 0,\n children,\n className,\n ...props\n}) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const [height, setHeight] = useState(initialHeight);\n const [isResizing, setIsResizing] = useState(false);\n\n /**\n * Handler to initiate the resizing process\n * Prevents default browser behavior and sets the resizing state\n *\n * @param mouseDownEvent - Mouse or touch event from the drag handle\n */\n const startResizing = useCallback(\n (\n mouseDownEvent:\n | React.MouseEvent<HTMLDivElement>\n | React.TouchEvent<HTMLDivElement>\n ) => {\n setIsResizing(true);\n mouseDownEvent.preventDefault();\n },\n []\n );\n\n /**\n * Handler to stop the resizing process\n * Resets the resizing state when user releases the drag handle\n */\n const stopResizing = useCallback(() => {\n setIsResizing(false);\n }, []);\n\n /**\n * Core resize logic that calculates new height based on cursor position\n * Handles both mouse and touch events with boundary checking\n *\n * @param mouseMoveEvent - Mouse or touch move event during drag\n */\n const resize = useCallback(\n (mouseMoveEvent: MouseEvent | TouchEvent) => {\n const container = containerRef.current;\n if (isResizing && container) {\n const { height: containerHeight, top: containerTop } =\n container.getBoundingClientRect();\n\n let clientY = 0;\n if (mouseMoveEvent instanceof MouseEvent) {\n clientY = mouseMoveEvent.clientY;\n } else if (mouseMoveEvent instanceof TouchEvent) {\n clientY = mouseMoveEvent.touches[0].clientY;\n }\n\n const resizeDifference = clientY - containerTop;\n const newHeight = containerHeight - resizeDifference;\n\n // Apply height constraints\n let correctedHeight = Math.max(newHeight, minHeight);\n if (maxHeight !== undefined) {\n correctedHeight = Math.min(correctedHeight, maxHeight);\n }\n\n setHeight(correctedHeight);\n }\n },\n [isResizing, minHeight, maxHeight]\n );\n\n /**\n * Effect to manage global event listeners for resize interactions\n * Handles both mouse and touch events with proper cleanup\n */\n useEffect(() => {\n window.addEventListener('mousemove', resize, { passive: true });\n window.addEventListener('mouseup', stopResizing);\n window.addEventListener('touchmove', resize, { passive: true });\n window.addEventListener('touchend', stopResizing);\n\n return () => {\n window.removeEventListener('mousemove', resize);\n window.removeEventListener('mouseup', stopResizing);\n window.removeEventListener('touchmove', resize);\n window.removeEventListener('touchend', stopResizing);\n };\n }, [resize, stopResizing]);\n\n return (\n <div\n className={cn(\n 'relative h-full w-full max-h-[80%] cursor-ns-resize border-t-[2px] border-neutral-200 transition dark:border-neutral-950',\n 'before:absolute before:top-0 before:z-10 before:left-1/2 before:block before:w-10 before:h-2 before:-translate-y-1/2 before:-translate-x-1/2 before:transform before:cursor-ns-resize before:rounded-full before:bg-neutral-200 before:transition before:content-[\"\"] dark:before:bg-neutral-950',\n 'active:border-neutral-400 active:before:bg-neutral-400 dark:active:border-neutral-600 active:dark:before:bg-neutral-600',\n className\n )}\n style={{\n height: `${height}px`,\n maxHeight: maxHeight ? `${maxHeight}px` : undefined,\n minHeight: `${minHeight}px`,\n }}\n ref={containerRef}\n onMouseDown={startResizing}\n onTouchStart={startResizing}\n aria-valuemin={minHeight}\n aria-valuemax={maxHeight}\n aria-valuenow={height}\n aria-label=\"Resizable component - drag the handle to adjust height\"\n role=\"slider\"\n tabIndex={0}\n {...props}\n >\n <div\n className=\"absolute left-0 top-0 size-full cursor-default overflow-hidden\"\n onMouseDown={(e) => e.stopPropagation()}\n onTouchStart={(e) => e.stopPropagation()}\n >\n {children}\n </div>\n </div>\n );\n};\n"],"names":["useRef","useState","useCallback","useEffect","jsx","cn"],"mappings":";;;;;;AA+GO,MAAM,gBAA2D,CAAC;AAAA,EACvE;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,eAAeA,aAAAA,OAAuB,IAAI;AAChD,QAAM,CAAC,QAAQ,SAAS,IAAIC,aAAAA,SAAS,aAAa;AAClD,QAAM,CAAC,YAAY,aAAa,IAAIA,aAAAA,SAA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BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,SAAAA;AAAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,MAEF,OAAO;AAAA,QACL,QAAQ,GAAG,MAAM;AAAA,QACjB,WAAW,YAAY,GAAG,SAAS,OAAO;AAAA,QAC1C,WAAW,GAAG,SAAS;AAAA,MAAA;AAAA,MAEzB,KAAK;AAAA,MACL,aAAa;AAAA,MACb,cAAc;AAAA,MACd,iBAAe;AAAA,MACf,iBAAe;AAAA,MACf,iBAAe;AAAA,MACf,cAAW;AAAA,MACX,MAAK;AAAA,MACL,UAAU;AAAA,MACT,GAAG;AAAA,MAEJ,UAAAD,2BAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,aAAa,CAAC,MAAM,EAAE,gBAAA;AAAA,UACtB,cAAc,CAAC,MAAM,EAAE,gBAAA;AAAA,UAEtB;AAAA,QAAA;AAAA,MAAA;AAAA,IACH;AAAA,EAAA;AAGN;;"}
@@ -1,9 +1,98 @@
1
1
  import { DetailedHTMLProps, HTMLAttributes, FC, PropsWithChildren } from 'react';
2
+ /**
3
+ * Props for the HeightResizer component
4
+ *
5
+ * @interface HeightResizerProps
6
+ */
2
7
  type HeightResizerProps = {
8
+ /**
9
+ * Initial height in pixels for the resizable container
10
+ * Sets the default size when the component first loads
11
+ * @example 200
12
+ */
3
13
  initialHeight: number;
14
+ /**
15
+ * Maximum height in pixels that the user can resize to (optional)
16
+ * When undefined, no maximum limit is enforced
17
+ * @example 500
18
+ */
4
19
  maxHeight?: number;
20
+ /**
21
+ * Minimum height in pixels that the user can resize to (optional)
22
+ * Prevents the container from being resized below this threshold
23
+ * @default 0
24
+ * @example 50
25
+ */
5
26
  minHeight?: number;
6
27
  } & DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
28
+ /**
29
+ * HeightResizer Component
30
+ *
31
+ * A resizable container component that allows users to dynamically adjust the height
32
+ * by dragging a visual handle at the top. Provides smooth resizing with optional
33
+ * minimum and maximum height constraints.
34
+ *
35
+ * ## Key Features
36
+ * - **Interactive Resizing**: Drag handle to resize container vertically
37
+ * - **Touch Support**: Full support for touch devices and mobile interactions
38
+ * - **Height Constraints**: Optional minimum and maximum height limits
39
+ * - **Visual Feedback**: Handle with hover and active states for clear interaction
40
+ * - **Accessibility**: ARIA slider role with value announcements for screen readers
41
+ * - **Smooth Animation**: CSS transitions for polished user experience
42
+ *
43
+ * ## Use Cases
44
+ * - Code editors with resizable panels
45
+ * - Chat interfaces with adjustable message areas
46
+ * - Dashboard widgets with user-customizable sizes
47
+ * - Documentation viewers with resizable content panes
48
+ * - Settings panels with expandable sections
49
+ *
50
+ * ## Interaction Model
51
+ * The component uses a drag interaction model where users click and drag the visual
52
+ * handle (rounded bar) at the top of the container. The resize calculation is based
53
+ * on the difference between the current cursor position and the container's top edge.
54
+ *
55
+ * ## Accessibility Features
56
+ * - **ARIA Slider**: Proper slider role for assistive technologies
57
+ * - **Value Announcements**: Current, min, and max values announced to screen readers
58
+ * - **Keyboard Navigation**: Focusable with standard slider keyboard support
59
+ * - **Visual Indicators**: Clear visual handle for drag interaction
60
+ *
61
+ * @component
62
+ * @example
63
+ * ```tsx
64
+ * // Basic usage
65
+ * <HeightResizer initialHeight={200}>
66
+ * <div>Your resizable content here</div>
67
+ * </HeightResizer>
68
+ *
69
+ * // With height constraints
70
+ * <HeightResizer
71
+ * initialHeight={300}
72
+ * minHeight={100}
73
+ * maxHeight={600}
74
+ * >
75
+ * <div>Content with size limits</div>
76
+ * </HeightResizer>
77
+ *
78
+ * // In a code editor context
79
+ * <HeightResizer
80
+ * initialHeight={400}
81
+ * minHeight={150}
82
+ * className="border rounded-lg"
83
+ * >
84
+ * <CodeEditor />
85
+ * </HeightResizer>
86
+ * ```
87
+ *
88
+ * @param props - HeightResizer component props
89
+ * @param props.initialHeight - Starting height in pixels
90
+ * @param props.minHeight - Optional minimum height constraint
91
+ * @param props.maxHeight - Optional maximum height constraint
92
+ * @param props.children - Content to display in the resizable container
93
+ * @param props.className - Additional CSS classes for styling
94
+ * @returns Interactive resizable container component
95
+ */
7
96
  export declare const HeightResizer: FC<PropsWithChildren<HeightResizerProps>>;
8
97
  export {};
9
98
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/HeightResizer/index.tsx"],"names":[],"mappings":"AAEA,OAAc,EACZ,iBAAiB,EACjB,cAAc,EAKd,KAAK,EAAE,EACP,KAAK,iBAAiB,EACvB,MAAM,OAAO,CAAC;AAGf,KAAK,kBAAkB,GAAG;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,iBAAiB,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,CAAC;AAEtE,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAuGnE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/HeightResizer/index.tsx"],"names":[],"mappings":"AAEA,OAAc,EACZ,iBAAiB,EACjB,cAAc,EAKd,KAAK,EAAE,EACP,KAAK,iBAAiB,EACvB,MAAM,OAAO,CAAC;AAGf;;;;GAIG;AACH,KAAK,kBAAkB,GAAG;IACxB;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,iBAAiB,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AACH,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CA4HnE,CAAC"}
@@ -26,7 +26,7 @@ const HeightResizer = ({
26
26
  const resize = useCallback(
27
27
  (mouseMoveEvent) => {
28
28
  const container = containerRef.current;
29
- if (isResizing && container && parent) {
29
+ if (isResizing && container) {
30
30
  const { height: containerHeight, top: containerTop } = container.getBoundingClientRect();
31
31
  let clientY = 0;
32
32
  if (mouseMoveEvent instanceof MouseEvent) {
@@ -36,11 +36,14 @@ const HeightResizer = ({
36
36
  }
37
37
  const resizeDifference = clientY - containerTop;
38
38
  const newHeight = containerHeight - resizeDifference;
39
- const correctedHeight = Math.max(newHeight, 0);
39
+ let correctedHeight = Math.max(newHeight, minHeight);
40
+ if (maxHeight !== void 0) {
41
+ correctedHeight = Math.min(correctedHeight, maxHeight);
42
+ }
40
43
  setHeight(correctedHeight);
41
44
  }
42
45
  },
43
- [isResizing]
46
+ [isResizing, minHeight, maxHeight]
44
47
  );
45
48
  useEffect(() => {
46
49
  window.addEventListener("mousemove", resize, { passive: true });
@@ -58,15 +61,15 @@ const HeightResizer = ({
58
61
  "div",
59
62
  {
60
63
  className: cn(
61
- minHeight && `max-w-[${maxHeight}px]`,
62
- maxHeight && `min-w-[${minHeight}px]`,
63
64
  "relative h-full w-full max-h-[80%] cursor-ns-resize border-t-[2px] border-neutral-200 transition dark:border-neutral-950",
64
65
  'before:absolute before:top-0 before:z-10 before:left-1/2 before:block before:w-10 before:h-2 before:-translate-y-1/2 before:-translate-x-1/2 before:transform before:cursor-ns-resize before:rounded-full before:bg-neutral-200 before:transition before:content-[""] dark:before:bg-neutral-950',
65
66
  "active:border-neutral-400 active:before:bg-neutral-400 dark:active:border-neutral-600 active:dark:before:bg-neutral-600",
66
67
  className
67
68
  ),
68
69
  style: {
69
- height: `${height}px`
70
+ height: `${height}px`,
71
+ maxHeight: maxHeight ? `${maxHeight}px` : void 0,
72
+ minHeight: `${minHeight}px`
70
73
  },
71
74
  ref: containerRef,
72
75
  onMouseDown: startResizing,
@@ -74,7 +77,7 @@ const HeightResizer = ({
74
77
  "aria-valuemin": minHeight,
75
78
  "aria-valuemax": maxHeight,
76
79
  "aria-valuenow": height,
77
- "aria-label": "Resizable component",
80
+ "aria-label": "Resizable component - drag the handle to adjust height",
78
81
  role: "slider",
79
82
  tabIndex: 0,
80
83
  ...props,
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../src/components/HeightResizer/index.tsx"],"sourcesContent":["'use client';\n\nimport React, {\n DetailedHTMLProps,\n HTMLAttributes,\n useCallback,\n useEffect,\n useRef,\n useState,\n type FC,\n type PropsWithChildren,\n} from 'react';\nimport { cn } from '../../utils/cn';\n\ntype HeightResizerProps = {\n initialHeight: number;\n maxHeight?: number;\n minHeight?: number;\n} & DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;\n\nexport const HeightResizer: FC<PropsWithChildren<HeightResizerProps>> = ({\n initialHeight,\n maxHeight,\n minHeight = 0,\n children,\n className,\n ...props\n}) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const [height, setHeight] = useState(initialHeight);\n const [isResizing, setIsResizing] = useState(false);\n\n // Handler to start resizing\n const startResizing = useCallback(\n (\n mouseDownEvent:\n | React.MouseEvent<HTMLDivElement>\n | React.TouchEvent<HTMLDivElement>\n ) => {\n setIsResizing(true);\n mouseDownEvent.preventDefault();\n },\n []\n );\n\n // Handler to stop resizing\n const stopResizing = useCallback(() => {\n setIsResizing(false);\n }, []);\n\n // Handler to resize the div\n const resize = useCallback(\n (mouseMoveEvent: MouseEvent | TouchEvent) => {\n const container = containerRef.current;\n if (isResizing && container && parent) {\n const { height: containerHeight, top: containerTop } =\n container.getBoundingClientRect();\n\n let clientY = 0;\n if (mouseMoveEvent instanceof MouseEvent) {\n clientY = mouseMoveEvent.clientY;\n } else if (mouseMoveEvent instanceof TouchEvent) {\n clientY = mouseMoveEvent.touches[0].clientY;\n }\n\n const resizeDifference = clientY - containerTop;\n const newHeight = containerHeight - resizeDifference;\n const correctedHeight = Math.max(newHeight, 0);\n\n setHeight(correctedHeight);\n }\n },\n [isResizing]\n );\n\n // Add event listeners for mouse move and mouse up\n useEffect(() => {\n window.addEventListener('mousemove', resize, { passive: true });\n window.addEventListener('mouseup', stopResizing);\n window.addEventListener('touchmove', resize, { passive: true });\n window.addEventListener('touchend', stopResizing);\n\n return () => {\n window.removeEventListener('mousemove', resize);\n window.removeEventListener('mouseup', stopResizing);\n window.removeEventListener('touchmove', resize);\n window.removeEventListener('touchend', stopResizing);\n };\n }, [resize, stopResizing]);\n\n return (\n <div\n className={cn(\n minHeight && `max-w-[${maxHeight}px]`,\n maxHeight && `min-w-[${minHeight}px]`,\n 'relative h-full w-full max-h-[80%] cursor-ns-resize border-t-[2px] border-neutral-200 transition dark:border-neutral-950',\n 'before:absolute before:top-0 before:z-10 before:left-1/2 before:block before:w-10 before:h-2 before:-translate-y-1/2 before:-translate-x-1/2 before:transform before:cursor-ns-resize before:rounded-full before:bg-neutral-200 before:transition before:content-[\"\"] dark:before:bg-neutral-950',\n 'active:border-neutral-400 active:before:bg-neutral-400 dark:active:border-neutral-600 active:dark:before:bg-neutral-600',\n className\n )}\n style={{\n height: `${height}px`,\n }}\n ref={containerRef}\n onMouseDown={startResizing}\n onTouchStart={startResizing}\n aria-valuemin={minHeight}\n aria-valuemax={maxHeight}\n aria-valuenow={height}\n aria-label=\"Resizable component\"\n role=\"slider\"\n tabIndex={0}\n {...props}\n >\n <div\n className=\"absolute left-0 top-0 size-full cursor-default overflow-hidden\"\n onMouseDown={(e) => e.stopPropagation()}\n onTouchStart={(e) => e.stopPropagation()}\n >\n {children}\n </div>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;AAoBO,MAAM,gBAA2D,CAAC;AAAA,EACvE;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,eAAe,OAAuB,IAAI;AAChD,Q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AAAA,QACT,aAAa,UAAU,SAAS;AAAA,QAChC,aAAa,UAAU,SAAS;AAAA,QAChC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,MAEF,OAAO;AAAA,QACL,QAAQ,GAAG,MAAM;AAAA,MAAA;AAAA,MAEnB,KAAK;AAAA,MACL,aAAa;AAAA,MACb,cAAc;AAAA,MACd,iBAAe;AAAA,MACf,iBAAe;AAAA,MACf,iBAAe;AAAA,MACf,cAAW;AAAA,MACX,MAAK;AAAA,MACL,UAAU;AAAA,MACT,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,aAAa,CAAC,MAAM,EAAE,gBAAA;AAAA,UACtB,cAAc,CAAC,MAAM,EAAE,gBAAA;AAAA,UAEtB;AAAA,QAAA;AAAA,MAAA;AAAA,IACH;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../src/components/HeightResizer/index.tsx"],"sourcesContent":["'use client';\n\nimport React, {\n DetailedHTMLProps,\n HTMLAttributes,\n useCallback,\n useEffect,\n useRef,\n useState,\n type FC,\n type PropsWithChildren,\n} from 'react';\nimport { cn } from '../../utils/cn';\n\n/**\n * Props for the HeightResizer component\n *\n * @interface HeightResizerProps\n */\ntype HeightResizerProps = {\n /**\n * Initial height in pixels for the resizable container\n * Sets the default size when the component first loads\n * @example 200\n */\n initialHeight: number;\n\n /**\n * Maximum height in pixels that the user can resize to (optional)\n * When undefined, no maximum limit is enforced\n * @example 500\n */\n maxHeight?: number;\n\n /**\n * Minimum height in pixels that the user can resize to (optional)\n * Prevents the container from being resized below this threshold\n * @default 0\n * @example 50\n */\n minHeight?: number;\n} & DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;\n\n/**\n * HeightResizer Component\n *\n * A resizable container component that allows users to dynamically adjust the height\n * by dragging a visual handle at the top. Provides smooth resizing with optional\n * minimum and maximum height constraints.\n *\n * ## Key Features\n * - **Interactive Resizing**: Drag handle to resize container vertically\n * - **Touch Support**: Full support for touch devices and mobile interactions\n * - **Height Constraints**: Optional minimum and maximum height limits\n * - **Visual Feedback**: Handle with hover and active states for clear interaction\n * - **Accessibility**: ARIA slider role with value announcements for screen readers\n * - **Smooth Animation**: CSS transitions for polished user experience\n *\n * ## Use Cases\n * - Code editors with resizable panels\n * - Chat interfaces with adjustable message areas\n * - Dashboard widgets with user-customizable sizes\n * - Documentation viewers with resizable content panes\n * - Settings panels with expandable sections\n *\n * ## Interaction Model\n * The component uses a drag interaction model where users click and drag the visual\n * handle (rounded bar) at the top of the container. The resize calculation is based\n * on the difference between the current cursor position and the container's top edge.\n *\n * ## Accessibility Features\n * - **ARIA Slider**: Proper slider role for assistive technologies\n * - **Value Announcements**: Current, min, and max values announced to screen readers\n * - **Keyboard Navigation**: Focusable with standard slider keyboard support\n * - **Visual Indicators**: Clear visual handle for drag interaction\n *\n * @component\n * @example\n * ```tsx\n * // Basic usage\n * <HeightResizer initialHeight={200}>\n * <div>Your resizable content here</div>\n * </HeightResizer>\n *\n * // With height constraints\n * <HeightResizer\n * initialHeight={300}\n * minHeight={100}\n * maxHeight={600}\n * >\n * <div>Content with size limits</div>\n * </HeightResizer>\n *\n * // In a code editor context\n * <HeightResizer\n * initialHeight={400}\n * minHeight={150}\n * className=\"border rounded-lg\"\n * >\n * <CodeEditor />\n * </HeightResizer>\n * ```\n *\n * @param props - HeightResizer component props\n * @param props.initialHeight - Starting height in pixels\n * @param props.minHeight - Optional minimum height constraint\n * @param props.maxHeight - Optional maximum height constraint\n * @param props.children - Content to display in the resizable container\n * @param props.className - Additional CSS classes for styling\n * @returns Interactive resizable container component\n */\nexport const HeightResizer: FC<PropsWithChildren<HeightResizerProps>> = ({\n initialHeight,\n maxHeight,\n minHeight = 0,\n children,\n className,\n ...props\n}) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const [height, setHeight] = useState(initialHeight);\n const [isResizing, setIsResizing] = useState(false);\n\n /**\n * Handler to initiate the resizing process\n * Prevents default browser behavior and sets the resizing state\n *\n * @param mouseDownEvent - Mouse or touch event from the drag handle\n */\n const startResizing = useCallback(\n (\n mouseDownEvent:\n | React.MouseEvent<HTMLDivElement>\n | React.TouchEvent<HTMLDivElement>\n ) => {\n setIsResizing(true);\n mouseDownEvent.preventDefault();\n },\n []\n );\n\n /**\n * Handler to stop the resizing process\n * Resets the resizing state when user releases the drag handle\n */\n const stopResizing = useCallback(() => {\n setIsResizing(false);\n }, []);\n\n /**\n * Core resize logic that calculates new height based on cursor position\n * Handles both mouse and touch events with boundary checking\n *\n * @param mouseMoveEvent - Mouse or touch move event during drag\n */\n const resize = useCallback(\n (mouseMoveEvent: MouseEvent | TouchEvent) => {\n const container = containerRef.current;\n if (isResizing && container) {\n const { height: containerHeight, top: containerTop } =\n container.getBoundingClientRect();\n\n let clientY = 0;\n if (mouseMoveEvent instanceof MouseEvent) {\n clientY = mouseMoveEvent.clientY;\n } else if (mouseMoveEvent instanceof TouchEvent) {\n clientY = mouseMoveEvent.touches[0].clientY;\n }\n\n const resizeDifference = clientY - containerTop;\n const newHeight = containerHeight - resizeDifference;\n\n // Apply height constraints\n let correctedHeight = Math.max(newHeight, minHeight);\n if (maxHeight !== undefined) {\n correctedHeight = Math.min(correctedHeight, maxHeight);\n }\n\n setHeight(correctedHeight);\n }\n },\n [isResizing, minHeight, maxHeight]\n );\n\n /**\n * Effect to manage global event listeners for resize interactions\n * Handles both mouse and touch events with proper cleanup\n */\n useEffect(() => {\n window.addEventListener('mousemove', resize, { passive: true });\n window.addEventListener('mouseup', stopResizing);\n window.addEventListener('touchmove', resize, { passive: true });\n window.addEventListener('touchend', stopResizing);\n\n return () => {\n window.removeEventListener('mousemove', resize);\n window.removeEventListener('mouseup', stopResizing);\n window.removeEventListener('touchmove', resize);\n window.removeEventListener('touchend', stopResizing);\n };\n }, [resize, stopResizing]);\n\n return (\n <div\n className={cn(\n 'relative h-full w-full max-h-[80%] cursor-ns-resize border-t-[2px] border-neutral-200 transition dark:border-neutral-950',\n 'before:absolute before:top-0 before:z-10 before:left-1/2 before:block before:w-10 before:h-2 before:-translate-y-1/2 before:-translate-x-1/2 before:transform before:cursor-ns-resize before:rounded-full before:bg-neutral-200 before:transition before:content-[\"\"] dark:before:bg-neutral-950',\n 'active:border-neutral-400 active:before:bg-neutral-400 dark:active:border-neutral-600 active:dark:before:bg-neutral-600',\n className\n )}\n style={{\n height: `${height}px`,\n maxHeight: maxHeight ? `${maxHeight}px` : undefined,\n minHeight: `${minHeight}px`,\n }}\n ref={containerRef}\n onMouseDown={startResizing}\n onTouchStart={startResizing}\n aria-valuemin={minHeight}\n aria-valuemax={maxHeight}\n aria-valuenow={height}\n aria-label=\"Resizable component - drag the handle to adjust height\"\n role=\"slider\"\n tabIndex={0}\n {...props}\n >\n <div\n className=\"absolute left-0 top-0 size-full cursor-default overflow-hidden\"\n onMouseDown={(e) => e.stopPropagation()}\n onTouchStart={(e) => e.stopPropagation()}\n >\n {children}\n </div>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;AA+GO,MAAM,gBAA2D,CAAC;AAAA,EACvE;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,eAAe,OAAuB,IAAI;AAChD,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,aAAa;AAClD,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,KAAK;AAQlD,QAAM,gBAAgB;AAAA,IACpB,CACE,mBAGG;AACH,oBAAc,IAAI;AAClB,qBAAe,eAAA;AAAA,IACjB;AAAA,IACA,CAAA;AAAA,EAAC;AAOH,QAAM,eAAe,YAAY,MAAM;AACrC,kBAAc,KAAK;AAAA,EACrB,GAAG,CAAA,CAAE;AAQL,QAAM,SAAS;AAAA,IACb,CAAC,mBAA4C;AAC3C,YAAM,YAAY,aAAa;AAC/B,UAAI,cAAc,WAAW;AAC3B,cAAM,EAAE,QAAQ,iBA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AA,MACL,UAAU;AAAA,MACT,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,aAAa,CAAC,MAAM,EAAE,gBAAA;AAAA,UACtB,cAAc,CAAC,MAAM,EAAE,gBAAA;AAAA,UAEtB;AAAA,QAAA;AAAA,MAAA;AAAA,IACH;AAAA,EAAA;AAGN;"}
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
- const Markdown = require("markdown-to-jsx");
4
+ const components_MarkDownRender_processor = require("../MarkDownRender/processor.cjs");
5
5
  const components_IDE_Code = require("./Code.cjs");
6
6
  const MarkdownRenderer = ({
7
7
  children,
8
8
  isDarkMode
9
9
  }) => /* @__PURE__ */ jsxRuntime.jsx(
10
- Markdown,
10
+ components_MarkDownRender_processor.MarkdownProcessor,
11
11
  {
12
12
  options: {
13
13
  overrides: {
@@ -1 +1 @@
1
- {"version":3,"file":"MarkDownRender.cjs","sources":["../../../src/components/IDE/MarkDownRender.tsx"],"sourcesContent":["import Markdown from 'markdown-to-jsx';\nimport type { FC } from 'react';\nimport { Code } from './Code';\n\ntype MarkdownRendererProps = {\n isDarkMode?: boolean;\n children: string;\n};\n\nexport const MarkdownRenderer: FC<MarkdownRendererProps> = ({\n children,\n isDarkMode,\n}) => (\n <Markdown\n options={{\n overrides: {\n code: {\n component: (props) => (\n <Code\n {...props}\n isDarkMode={isDarkMode}\n language={props.className?.replace('lang-', '')}\n showHeader={false}\n className=\"text-xs leading-5\"\n />\n ),\n },\n pre: (props) => props.children,\n },\n }}\n >\n {children ?? ''}\n </Markdown>\n);\n"],"names":["jsx","Code"],"mappings":";;;;;AASO,MAAM,mBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA;AACF,MACEA,2BAAAA;AAAAA,EAAC;AAAA,EAAA;AAAA,IACC,SAAS;AAAA,MACP,WAAW;AAAA,QACT,MAAM;AAAA,UACJ,WAAW,CAAC,UACVA,2BAAAA;AAAAA,YAACC,oBAAAA;AAAAA,YAAA;AAAA,cACE,GAAG;AAAA,cACJ;AAAA,cACA,UAAU,MAAM,WAAW,QAAQ,SAAS,EAAE;AAAA,cAC9C,YAAY;AAAA,cACZ,WAAU;AAAA,YAAA;AAAA,UAAA;AAAA,QACZ;AAAA,QAGJ,KAAK,CAAC,UAAU,MAAM;AAAA,MAAA;AAAA,IACxB;AAAA,IAGD,UAAA,YAAY;AAAA,EAAA;AACf;;"}
1
+ {"version":3,"file":"MarkDownRender.cjs","sources":["../../../src/components/IDE/MarkDownRender.tsx"],"sourcesContent":["import type { ComponentProps, ComponentPropsWithoutRef, FC } from 'react';\nimport { BundledLanguage } from 'shiki';\nimport { MarkdownProcessor } from '../MarkDownRender/processor';\nimport { Code } from './Code';\n\ntype MarkdownRendererProps = {\n isDarkMode?: boolean;\n children: string;\n};\n\nexport const MarkdownRenderer: FC<MarkdownRendererProps> = ({\n children,\n isDarkMode,\n}) => (\n <MarkdownProcessor\n options={{\n overrides: {\n code: {\n component: (props: ComponentProps<typeof Code>) => (\n <Code\n {...props}\n isDarkMode={isDarkMode}\n language={\n props.className?.replace('lang-', '') as BundledLanguage\n }\n showHeader={false}\n className=\"text-xs leading-5\"\n />\n ),\n },\n pre: (props: ComponentPropsWithoutRef<'pre'>) => props.children,\n },\n }}\n >\n {children ?? ''}\n </MarkdownProcessor>\n);\n"],"names":["jsx","MarkdownProcessor","Code"],"mappings":";;;;;AAUO,MAAM,mBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA;AACF,MACEA,2BAAAA;AAAAA,EAACC,oCAAAA;AAAAA,EAAA;AAAA,IACC,SAAS;AAAA,MACP,WAAW;AAAA,QACT,MAAM;AAAA,UACJ,WAAW,CAAC,UACVD,2BAAAA;AAAAA,YAACE,oBAAAA;AAAAA,YAAA;AAAA,cACE,GAAG;AAAA,cACJ;AAAA,cACA,UACE,MAAM,WAAW,QAAQ,SAAS,EAAE;AAAA,cAEtC,YAAY;AAAA,cACZ,WAAU;AAAA,YAAA;AAAA,UAAA;AAAA,QACZ;AAAA,QAGJ,KAAK,CAAC,UAA2C,MAAM;AAAA,MAAA;AAAA,IACzD;AAAA,IAGD,UAAA,YAAY;AAAA,EAAA;AACf;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MarkDownRender.d.ts","sourceRoot":"","sources":["../../../src/components/IDE/MarkDownRender.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,KAAK,qBAAqB,GAAG;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAwBtD,CAAC"}
1
+ {"version":3,"file":"MarkDownRender.d.ts","sourceRoot":"","sources":["../../../src/components/IDE/MarkDownRender.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA4C,EAAE,EAAE,MAAM,OAAO,CAAC;AAK1E,KAAK,qBAAqB,GAAG;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CA0BtD,CAAC"}
@@ -1,11 +1,11 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import Markdown from "markdown-to-jsx";
2
+ import { MarkdownProcessor } from "../MarkDownRender/processor.mjs";
3
3
  import { Code } from "./Code.mjs";
4
4
  const MarkdownRenderer = ({
5
5
  children,
6
6
  isDarkMode
7
7
  }) => /* @__PURE__ */ jsx(
8
- Markdown,
8
+ MarkdownProcessor,
9
9
  {
10
10
  options: {
11
11
  overrides: {
@@ -1 +1 @@
1
- {"version":3,"file":"MarkDownRender.mjs","sources":["../../../src/components/IDE/MarkDownRender.tsx"],"sourcesContent":["import Markdown from 'markdown-to-jsx';\nimport type { FC } from 'react';\nimport { Code } from './Code';\n\ntype MarkdownRendererProps = {\n isDarkMode?: boolean;\n children: string;\n};\n\nexport const MarkdownRenderer: FC<MarkdownRendererProps> = ({\n children,\n isDarkMode,\n}) => (\n <Markdown\n options={{\n overrides: {\n code: {\n component: (props) => (\n <Code\n {...props}\n isDarkMode={isDarkMode}\n language={props.className?.replace('lang-', '')}\n showHeader={false}\n className=\"text-xs leading-5\"\n />\n ),\n },\n pre: (props) => props.children,\n },\n }}\n >\n {children ?? ''}\n </Markdown>\n);\n"],"names":[],"mappings":";;;AASO,MAAM,mBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA;AACF,MACE;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,SAAS;AAAA,MACP,WAAW;AAAA,QACT,MAAM;AAAA,UACJ,WAAW,CAAC,UACV;AAAA,YAAC;AAAA,YAAA;AAAA,cACE,GAAG;AAAA,cACJ;AAAA,cACA,UAAU,MAAM,WAAW,QAAQ,SAAS,EAAE;AAAA,cAC9C,YAAY;AAAA,cACZ,WAAU;AAAA,YAAA;AAAA,UAAA;AAAA,QACZ;AAAA,QAGJ,KAAK,CAAC,UAAU,MAAM;AAAA,MAAA;AAAA,IACxB;AAAA,IAGD,UAAA,YAAY;AAAA,EAAA;AACf;"}
1
+ {"version":3,"file":"MarkDownRender.mjs","sources":["../../../src/components/IDE/MarkDownRender.tsx"],"sourcesContent":["import type { ComponentProps, ComponentPropsWithoutRef, FC } from 'react';\nimport { BundledLanguage } from 'shiki';\nimport { MarkdownProcessor } from '../MarkDownRender/processor';\nimport { Code } from './Code';\n\ntype MarkdownRendererProps = {\n isDarkMode?: boolean;\n children: string;\n};\n\nexport const MarkdownRenderer: FC<MarkdownRendererProps> = ({\n children,\n isDarkMode,\n}) => (\n <MarkdownProcessor\n options={{\n overrides: {\n code: {\n component: (props: ComponentProps<typeof Code>) => (\n <Code\n {...props}\n isDarkMode={isDarkMode}\n language={\n props.className?.replace('lang-', '') as BundledLanguage\n }\n showHeader={false}\n className=\"text-xs leading-5\"\n />\n ),\n },\n pre: (props: ComponentPropsWithoutRef<'pre'>) => props.children,\n },\n }}\n >\n {children ?? ''}\n </MarkdownProcessor>\n);\n"],"names":[],"mappings":";;;AAUO,MAAM,mBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA;AACF,MACE;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,SAAS;AAAA,MACP,WAAW;AAAA,QACT,MAAM;AAAA,UACJ,WAAW,CAAC,UACV;AAAA,YAAC;AAAA,YAAA;AAAA,cACE,GAAG;AAAA,cACJ;AAAA,cACA,UACE,MAAM,WAAW,QAAQ,SAAS,EAAE;AAAA,cAEtC,YAAY;AAAA,cACZ,WAAU;AAAA,YAAA;AAAA,UAAA;AAAA,QACZ;AAAA,QAGJ,KAAK,CAAC,UAA2C,MAAM;AAAA,MAAA;AAAA,IACzD;AAAA,IAGD,UAAA,YAAY;AAAA,EAAA;AACf;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/components/InformationTag/index.tsx"],"sourcesContent":["import type { DetailedHTMLProps, FC } from 'react';\nimport { cn } from '../../utils/cn';\n\ntype CopiedTextInformationProps = DetailedHTMLProps<\n React.HTMLAttributes<HTMLElement>,\n HTMLElement\n>;\n\nexport const InformationTag: FC<CopiedTextInformationProps> = ({\n className,\n children,\n ...props\n}) => (\n <i className={cn('text-xs text-neutral-400', className)} {...props}>\n ⓘ {children}\n </i>\n);\n"],"names":["jsxs","cn"],"mappings":";;;;AAQO,MAAM,iBAAiD,CAAC;AAAA,EAC7D;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACEA,2BAAAA,KAAC,OAAE,WAAWC,SAAAA,GAAG,4BAA4B,SAAS,GAAI,GAAG,OAAO,UAAA;AAAA,EAAA;AAAA,EAC/D;AAAA,EAAA,CACL;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/InformationTag/index.tsx"],"sourcesContent":["import type { DetailedHTMLProps, FC } from 'react';\nimport { cn } from '../../utils/cn';\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-xs text-neutral-400', className)} {...props}>\n ⓘ {children}\n </i>\n);\n"],"names":["jsxs","cn"],"mappings":";;;;AAgFO,MAAM,iBAAiD,CAAC;AAAA,EAC7D;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACEA,2BAAAA,KAAC,OAAE,WAAWC,SAAAA,GAAG,4BAA4B,SAAS,GAAI,GAAG,OAAO,UAAA;AAAA,EAAA;AAAA,EAC/D;AAAA,EAAA,CACL;;"}