@mks2508/mks-ui 0.3.1 → 0.4.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 (325) hide show
  1. package/dist/react-ui/blocks/Terminal/ResttyAdapter.d.ts +146 -0
  2. package/dist/react-ui/blocks/Terminal/ResttyAdapter.d.ts.map +1 -0
  3. package/dist/react-ui/blocks/Terminal/ResttyAdapter.js +213 -0
  4. package/dist/react-ui/blocks/Terminal/Terminal.adapter.d.ts +55 -0
  5. package/dist/react-ui/blocks/Terminal/Terminal.adapter.d.ts.map +1 -0
  6. package/dist/react-ui/blocks/Terminal/Terminal.adapter.js +68 -0
  7. package/dist/react-ui/blocks/Terminal/Terminal.theme.d.ts +43 -0
  8. package/dist/react-ui/blocks/Terminal/Terminal.theme.d.ts.map +1 -0
  9. package/dist/react-ui/blocks/Terminal/Terminal.theme.js +59 -0
  10. package/dist/react-ui/blocks/Terminal/Terminal.theme.restty.d.ts +63 -0
  11. package/dist/react-ui/blocks/Terminal/Terminal.theme.restty.d.ts.map +1 -0
  12. package/dist/react-ui/blocks/Terminal/Terminal.theme.restty.js +109 -0
  13. package/dist/react-ui/blocks/Terminal/Terminal.types.d.ts +351 -0
  14. package/dist/react-ui/blocks/Terminal/Terminal.types.d.ts.map +1 -0
  15. package/dist/react-ui/blocks/Terminal/TerminalPanel.d.ts +60 -0
  16. package/dist/react-ui/blocks/Terminal/TerminalPanel.d.ts.map +1 -0
  17. package/dist/react-ui/blocks/Terminal/TerminalPanel.js +183 -0
  18. package/dist/react-ui/blocks/Terminal/TerminalRestty.d.ts +111 -0
  19. package/dist/react-ui/blocks/Terminal/TerminalRestty.d.ts.map +1 -0
  20. package/dist/react-ui/blocks/Terminal/TerminalRestty.js +185 -0
  21. package/dist/react-ui/blocks/Terminal/TerminalXterm.d.ts +58 -0
  22. package/dist/react-ui/blocks/Terminal/TerminalXterm.d.ts.map +1 -0
  23. package/dist/react-ui/blocks/Terminal/TerminalXterm.js +143 -0
  24. package/dist/react-ui/blocks/Terminal/XTermAdapter.d.ts +87 -0
  25. package/dist/react-ui/blocks/Terminal/XTermAdapter.d.ts.map +1 -0
  26. package/dist/react-ui/blocks/Terminal/XTermAdapter.js +135 -0
  27. package/dist/react-ui/blocks/Terminal/components/LogLineBadges.d.ts +160 -0
  28. package/dist/react-ui/blocks/Terminal/components/LogLineBadges.d.ts.map +1 -0
  29. package/dist/react-ui/blocks/Terminal/components/LogLineBadges.js +185 -0
  30. package/dist/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.d.ts +48 -0
  31. package/dist/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.d.ts.map +1 -0
  32. package/dist/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.js +139 -0
  33. package/dist/react-ui/blocks/Terminal/components/SyntaxHighlight.d.ts +60 -0
  34. package/dist/react-ui/blocks/Terminal/components/SyntaxHighlight.d.ts.map +1 -0
  35. package/dist/react-ui/blocks/Terminal/components/SyntaxHighlight.js +352 -0
  36. package/dist/react-ui/blocks/Terminal/components/TerminalLogBadge.d.ts +36 -0
  37. package/dist/react-ui/blocks/Terminal/components/TerminalLogBadge.d.ts.map +1 -0
  38. package/dist/react-ui/blocks/Terminal/components/TerminalLogBadge.js +52 -0
  39. package/dist/react-ui/blocks/Terminal/components/index.d.ts +10 -0
  40. package/dist/react-ui/blocks/Terminal/components/index.d.ts.map +1 -0
  41. package/dist/react-ui/blocks/Terminal/components/index.js +4 -0
  42. package/dist/react-ui/blocks/Terminal/hooks/index.d.ts +11 -0
  43. package/dist/react-ui/blocks/Terminal/hooks/index.d.ts.map +1 -0
  44. package/dist/react-ui/blocks/Terminal/hooks/index.js +2 -0
  45. package/dist/react-ui/blocks/Terminal/hooks/useTerminalSettings.d.ts +69 -0
  46. package/dist/react-ui/blocks/Terminal/hooks/useTerminalSettings.d.ts.map +1 -0
  47. package/dist/react-ui/blocks/Terminal/hooks/useTerminalSettings.js +162 -0
  48. package/dist/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.d.ts +104 -0
  49. package/dist/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.d.ts.map +1 -0
  50. package/dist/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.js +180 -0
  51. package/dist/react-ui/blocks/Terminal/index.d.ts +39 -0
  52. package/dist/react-ui/blocks/Terminal/index.d.ts.map +1 -0
  53. package/dist/react-ui/blocks/Terminal/index.js +38 -0
  54. package/dist/react-ui/blocks/Terminal/panel/LogLinesViewer.d.ts +58 -0
  55. package/dist/react-ui/blocks/Terminal/panel/LogLinesViewer.d.ts.map +1 -0
  56. package/dist/react-ui/blocks/Terminal/panel/LogLinesViewer.js +222 -0
  57. package/dist/react-ui/blocks/Terminal/panel/TerminalDebugPanel.d.ts +74 -0
  58. package/dist/react-ui/blocks/Terminal/panel/TerminalDebugPanel.d.ts.map +1 -0
  59. package/dist/react-ui/blocks/Terminal/panel/TerminalDebugPanel.js +168 -0
  60. package/dist/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.d.ts +42 -0
  61. package/dist/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.d.ts.map +1 -0
  62. package/dist/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.js +175 -0
  63. package/dist/react-ui/blocks/Terminal/panel/TerminalFilterTabs.d.ts +43 -0
  64. package/dist/react-ui/blocks/Terminal/panel/TerminalFilterTabs.d.ts.map +1 -0
  65. package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.d.ts +38 -0
  66. package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.d.ts.map +1 -0
  67. package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.js +62 -0
  68. package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.types.d.ts +67 -0
  69. package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.types.d.ts.map +1 -0
  70. package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.d.ts +32 -0
  71. package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.d.ts.map +1 -0
  72. package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.js +326 -0
  73. package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.d.ts +36 -0
  74. package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.d.ts.map +1 -0
  75. package/dist/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.js +371 -0
  76. package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.d.ts +67 -0
  77. package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.d.ts.map +1 -0
  78. package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.js +417 -0
  79. package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.types.d.ts +197 -0
  80. package/dist/react-ui/blocks/Terminal/panel/TerminalLogsPanel.types.d.ts.map +1 -0
  81. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.d.ts +54 -0
  82. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.d.ts.map +1 -0
  83. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.js +193 -0
  84. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.d.ts +57 -0
  85. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.d.ts.map +1 -0
  86. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelFooter.d.ts +30 -0
  87. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelFooter.d.ts.map +1 -0
  88. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelFooter.js +126 -0
  89. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelHeader.d.ts +31 -0
  90. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelHeader.d.ts.map +1 -0
  91. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelHeader.js +149 -0
  92. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelToolbar.d.ts +35 -0
  93. package/dist/react-ui/blocks/Terminal/panel/TerminalPanelToolbar.d.ts.map +1 -0
  94. package/dist/react-ui/blocks/Terminal/panel/TerminalSessionControl.d.ts +58 -0
  95. package/dist/react-ui/blocks/Terminal/panel/TerminalSessionControl.d.ts.map +1 -0
  96. package/dist/react-ui/blocks/Terminal/panel/TerminalSessionTabs.d.ts +63 -0
  97. package/dist/react-ui/blocks/Terminal/panel/TerminalSessionTabs.d.ts.map +1 -0
  98. package/dist/react-ui/blocks/Terminal/panel/TerminalSessionTabs.js +245 -0
  99. package/dist/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.d.ts +24 -0
  100. package/dist/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.d.ts.map +1 -0
  101. package/dist/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.js +225 -0
  102. package/dist/react-ui/blocks/Terminal/panel/TerminalThemeSelector.d.ts +35 -0
  103. package/dist/react-ui/blocks/Terminal/panel/TerminalThemeSelector.d.ts.map +1 -0
  104. package/dist/react-ui/blocks/Terminal/panel/TerminalThemeSelector.js +187 -0
  105. package/dist/react-ui/blocks/Terminal/panel/index.d.ts +30 -0
  106. package/dist/react-ui/blocks/Terminal/panel/index.d.ts.map +1 -0
  107. package/dist/react-ui/blocks/Terminal/panel/terminal-filter-dropdown.module-Bovc57nm.css +60 -0
  108. package/dist/react-ui/blocks/Terminal/panel/terminal-filter-dropdown.module.js +5 -0
  109. package/dist/react-ui/blocks/Terminal/panel/terminal-session-tabs.module-QyxHO7cN.css +60 -0
  110. package/dist/react-ui/blocks/Terminal/panel/terminal-session-tabs.module.js +5 -0
  111. package/dist/react-ui/blocks/Terminal/parsing/BadgeFormatter.d.ts +73 -0
  112. package/dist/react-ui/blocks/Terminal/parsing/BadgeFormatter.d.ts.map +1 -0
  113. package/dist/react-ui/blocks/Terminal/parsing/BadgeFormatter.js +136 -0
  114. package/dist/react-ui/blocks/Terminal/parsing/HttpLogParser.d.ts +117 -0
  115. package/dist/react-ui/blocks/Terminal/parsing/HttpLogParser.d.ts.map +1 -0
  116. package/dist/react-ui/blocks/Terminal/parsing/HttpLogParser.js +174 -0
  117. package/dist/react-ui/blocks/Terminal/parsing/LogParser.types.d.ts +221 -0
  118. package/dist/react-ui/blocks/Terminal/parsing/LogParser.types.d.ts.map +1 -0
  119. package/dist/react-ui/blocks/Terminal/parsing/LogParserService.d.ts +184 -0
  120. package/dist/react-ui/blocks/Terminal/parsing/LogParserService.d.ts.map +1 -0
  121. package/dist/react-ui/blocks/Terminal/parsing/LogParserService.js +478 -0
  122. package/dist/react-ui/blocks/Terminal/parsing/MultilineAggregator.d.ts +173 -0
  123. package/dist/react-ui/blocks/Terminal/parsing/MultilineAggregator.d.ts.map +1 -0
  124. package/dist/react-ui/blocks/Terminal/parsing/MultilineAggregator.js +313 -0
  125. package/dist/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.d.ts +181 -0
  126. package/dist/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.d.ts.map +1 -0
  127. package/dist/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.js +221 -0
  128. package/dist/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.d.ts +69 -0
  129. package/dist/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.d.ts.map +1 -0
  130. package/dist/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.js +142 -0
  131. package/dist/react-ui/blocks/Terminal/parsing/TableParser.d.ts +125 -0
  132. package/dist/react-ui/blocks/Terminal/parsing/TableParser.d.ts.map +1 -0
  133. package/dist/react-ui/blocks/Terminal/parsing/TableParser.js +245 -0
  134. package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.d.ts +165 -0
  135. package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.d.ts.map +1 -0
  136. package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.js +225 -0
  137. package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.d.ts +164 -0
  138. package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.d.ts.map +1 -0
  139. package/dist/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.js +285 -0
  140. package/dist/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.d.ts +188 -0
  141. package/dist/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.d.ts.map +1 -0
  142. package/dist/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.js +178 -0
  143. package/dist/react-ui/blocks/Terminal/parsing/ansi/index.d.ts +12 -0
  144. package/dist/react-ui/blocks/Terminal/parsing/ansi/index.d.ts.map +1 -0
  145. package/dist/react-ui/blocks/Terminal/parsing/index.d.ts +24 -0
  146. package/dist/react-ui/blocks/Terminal/parsing/index.d.ts.map +1 -0
  147. package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevel.types.d.ts +56 -0
  148. package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevel.types.d.ts.map +1 -0
  149. package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.d.ts +140 -0
  150. package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.d.ts.map +1 -0
  151. package/dist/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.js +325 -0
  152. package/dist/react-ui/blocks/Terminal/parsing/levels/index.d.ts +10 -0
  153. package/dist/react-ui/blocks/Terminal/parsing/levels/index.d.ts.map +1 -0
  154. package/dist/react-ui/blocks/index.d.ts +11 -0
  155. package/dist/react-ui/blocks/index.d.ts.map +1 -0
  156. package/dist/react-ui/icons/lucide-animated/activity.js +1 -1
  157. package/dist/react-ui/icons/lucide-animated/bell-electric.js +1 -1
  158. package/dist/react-ui/icons/lucide-animated/bell.js +1 -1
  159. package/dist/react-ui/icons/lucide-animated/bot.js +1 -1
  160. package/dist/react-ui/icons/lucide-animated/box.js +1 -1
  161. package/dist/react-ui/icons/lucide-animated/circle-check.js +1 -1
  162. package/dist/react-ui/icons/lucide-animated/delete.js +1 -1
  163. package/dist/react-ui/icons/lucide-animated/download.js +1 -1
  164. package/dist/react-ui/icons/lucide-animated/home.js +1 -1
  165. package/dist/react-ui/icons/lucide-animated/layout-panel-top.js +1 -1
  166. package/dist/react-ui/icons/lucide-animated/plus.js +1 -1
  167. package/dist/react-ui/icons/lucide-animated/search.js +1 -1
  168. package/dist/react-ui/icons/lucide-animated/settings.js +1 -1
  169. package/dist/react-ui/icons/lucide-animated/trending-down.js +1 -1
  170. package/dist/react-ui/icons/lucide-animated/trending-up.js +1 -1
  171. package/dist/react-ui/icons/lucide-animated/x.js +1 -1
  172. package/dist/react-ui/index.js +4 -1
  173. package/dist/react-ui/lib/icon-wrapper.d.ts +37 -0
  174. package/dist/react-ui/lib/icon-wrapper.d.ts.map +1 -0
  175. package/dist/react-ui/lib/icon-wrapper.js +55 -0
  176. package/dist/react-ui/lib/index.d.ts +1 -0
  177. package/dist/react-ui/lib/index.d.ts.map +1 -1
  178. package/dist/react-ui/lib/index.js +1 -0
  179. package/dist/react-ui/primitives/AutoHeight/index.d.ts +1 -1
  180. package/dist/react-ui/primitives/CountingNumber/index.d.ts +1 -1
  181. package/dist/react-ui/primitives/waapi/SlidingNumber/SlidingNumber.styles.d.ts +1 -1
  182. package/dist/react-ui/primitives/waapi/SlidingText/SlidingText.styles.d.ts +1 -1
  183. package/dist/react-ui/ui/Accordion/Accordion.styles.d.ts +1 -1
  184. package/dist/react-ui/ui/Accordion/Accordion.types.d.ts +1 -1
  185. package/dist/react-ui/ui/AlertDialog/AlertDialog.styles.d.ts +1 -1
  186. package/dist/react-ui/ui/AlertDialog/AlertDialog.types.d.ts +1 -1
  187. package/dist/react-ui/ui/Badge/Badge.styles.d.ts +1 -1
  188. package/dist/react-ui/ui/Badge/Badge.types.d.ts +1 -1
  189. package/dist/react-ui/ui/Button/Button.styles.d.ts +2 -2
  190. package/dist/react-ui/ui/Button/Button.types.d.ts +1 -1
  191. package/dist/react-ui/ui/Card/Card.styles.d.ts +1 -1
  192. package/dist/react-ui/ui/Card/Card.types.d.ts +1 -1
  193. package/dist/react-ui/ui/Checkbox/Checkbox.styles.d.ts +1 -1
  194. package/dist/react-ui/ui/Checkbox/Checkbox.types.d.ts +1 -1
  195. package/dist/react-ui/ui/Combobox/Combobox.styles.d.ts +1 -1
  196. package/dist/react-ui/ui/Combobox/Combobox.types.d.ts +1 -1
  197. package/dist/react-ui/ui/CornerBracket/CornerBracket.styles.d.ts +2 -2
  198. package/dist/react-ui/ui/CornerBracket/CornerBracket.styles.js +1 -1
  199. package/dist/react-ui/ui/CornerBracket/CornerBracket.types.d.ts +1 -1
  200. package/dist/react-ui/ui/DataCard/DataCard.styles.d.ts +1 -1
  201. package/dist/react-ui/ui/DataCard/DataCard.types.d.ts +1 -1
  202. package/dist/react-ui/ui/DataCard/index.d.ts +1 -1
  203. package/dist/react-ui/ui/Dialog/Dialog.styles.d.ts +1 -1
  204. package/dist/react-ui/ui/Dialog/Dialog.types.d.ts +1 -1
  205. package/dist/react-ui/ui/DropdownMenu/DropdownMenu.styles.d.ts +1 -1
  206. package/dist/react-ui/ui/DropdownMenu/DropdownMenu.types.d.ts +1 -1
  207. package/dist/react-ui/ui/Field/Field.styles.d.ts +1 -1
  208. package/dist/react-ui/ui/Field/Field.types.d.ts +1 -1
  209. package/dist/react-ui/ui/Input/Input.styles.d.ts +1 -1
  210. package/dist/react-ui/ui/Input/Input.types.d.ts +1 -1
  211. package/dist/react-ui/ui/InputGroup/InputGroup.styles.d.ts +1 -1
  212. package/dist/react-ui/ui/InputGroup/InputGroup.types.d.ts +1 -1
  213. package/dist/react-ui/ui/Label/Label.styles.d.ts +1 -1
  214. package/dist/react-ui/ui/Label/Label.types.d.ts +1 -1
  215. package/dist/react-ui/ui/Menu/Menu.styles.d.ts +1 -1
  216. package/dist/react-ui/ui/Menu/Menu.types.d.ts +2 -2
  217. package/dist/react-ui/ui/Popover/Popover.styles.d.ts +1 -1
  218. package/dist/react-ui/ui/Popover/Popover.types.d.ts +1 -1
  219. package/dist/react-ui/ui/Progress/Progress.styles.d.ts +1 -1
  220. package/dist/react-ui/ui/Progress/Progress.types.d.ts +2 -2
  221. package/dist/react-ui/ui/Select/Select.styles.d.ts +1 -1
  222. package/dist/react-ui/ui/Select/Select.types.d.ts +1 -1
  223. package/dist/react-ui/ui/Separator/Separator.styles.d.ts +1 -1
  224. package/dist/react-ui/ui/Separator/Separator.types.d.ts +1 -1
  225. package/dist/react-ui/ui/Switch/Switch.styles.d.ts +1 -1
  226. package/dist/react-ui/ui/Switch/Switch.types.d.ts +1 -1
  227. package/dist/react-ui/ui/Tabs/Tabs.styles.d.ts +43 -25
  228. package/dist/react-ui/ui/Tabs/Tabs.styles.d.ts.map +1 -1
  229. package/dist/react-ui/ui/Tabs/Tabs.styles.js +105 -13
  230. package/dist/react-ui/ui/Tabs/Tabs.types.d.ts +9 -6
  231. package/dist/react-ui/ui/Tabs/Tabs.types.d.ts.map +1 -1
  232. package/dist/react-ui/ui/Tabs/index.d.ts +18 -9
  233. package/dist/react-ui/ui/Tabs/index.d.ts.map +1 -1
  234. package/dist/react-ui/ui/Tabs/index.js +99 -27
  235. package/dist/react-ui/ui/TextFlow/TextFlow.styles.d.ts +1 -1
  236. package/dist/react-ui/ui/Textarea/Textarea.styles.d.ts +1 -1
  237. package/dist/react-ui/ui/Textarea/Textarea.types.d.ts +1 -1
  238. package/dist/react-ui/ui/Tooltip/Tooltip.styles.d.ts +1 -1
  239. package/dist/react-ui/ui/Tooltip/Tooltip.types.d.ts +1 -1
  240. package/dist/react-ui/ui/index.d.ts +1 -0
  241. package/dist/react-ui/ui/index.d.ts.map +1 -1
  242. package/dist/react-ui/ui/index.js +2 -0
  243. package/package.json +54 -6
  244. package/src/react-ui/blocks/Terminal/ResttyAdapter.ts +278 -0
  245. package/src/react-ui/blocks/Terminal/Terminal.adapter.ts +97 -0
  246. package/src/react-ui/blocks/Terminal/Terminal.theme.restty.ts +155 -0
  247. package/src/react-ui/blocks/Terminal/Terminal.theme.ts +80 -0
  248. package/src/react-ui/blocks/Terminal/Terminal.types.ts +438 -0
  249. package/src/react-ui/blocks/Terminal/TerminalPanel.tsx +269 -0
  250. package/src/react-ui/blocks/Terminal/TerminalRestty.tsx +326 -0
  251. package/src/react-ui/blocks/Terminal/TerminalXterm.tsx +230 -0
  252. package/src/react-ui/blocks/Terminal/XTermAdapter.ts +163 -0
  253. package/src/react-ui/blocks/Terminal/components/LogLineBadges.tsx +316 -0
  254. package/src/react-ui/blocks/Terminal/components/SpecializedSyntaxHighlighter.tsx +218 -0
  255. package/src/react-ui/blocks/Terminal/components/SyntaxHighlight.tsx +386 -0
  256. package/src/react-ui/blocks/Terminal/components/TerminalLogBadge.tsx +67 -0
  257. package/src/react-ui/blocks/Terminal/components/index.ts +10 -0
  258. package/src/react-ui/blocks/Terminal/hooks/index.ts +22 -0
  259. package/src/react-ui/blocks/Terminal/hooks/useTerminalSettings.ts +229 -0
  260. package/src/react-ui/blocks/Terminal/hooks/useTerminalWebSocket.ts +292 -0
  261. package/src/react-ui/blocks/Terminal/index.ts +103 -0
  262. package/src/react-ui/blocks/Terminal/panel/LogLinesViewer.tsx +330 -0
  263. package/src/react-ui/blocks/Terminal/panel/TerminalDebugPanel.tsx +242 -0
  264. package/src/react-ui/blocks/Terminal/panel/TerminalFilterDropdown.tsx +202 -0
  265. package/src/react-ui/blocks/Terminal/panel/TerminalFilterTabs.tsx +140 -0
  266. package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.tsx +68 -0
  267. package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanel.types.ts +85 -0
  268. package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanelRestty.tsx +383 -0
  269. package/src/react-ui/blocks/Terminal/panel/TerminalInteractivePanelXterm.tsx +439 -0
  270. package/src/react-ui/blocks/Terminal/panel/TerminalLogsPanel.tsx +550 -0
  271. package/src/react-ui/blocks/Terminal/panel/TerminalLogsPanel.types.ts +259 -0
  272. package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.tsx +237 -0
  273. package/src/react-ui/blocks/Terminal/panel/TerminalPanelChrome.types.ts +76 -0
  274. package/src/react-ui/blocks/Terminal/panel/TerminalPanelFooter.tsx +112 -0
  275. package/src/react-ui/blocks/Terminal/panel/TerminalPanelHeader.tsx +178 -0
  276. package/src/react-ui/blocks/Terminal/panel/TerminalPanelToolbar.tsx +203 -0
  277. package/src/react-ui/blocks/Terminal/panel/TerminalSessionControl.tsx +252 -0
  278. package/src/react-ui/blocks/Terminal/panel/TerminalSessionTabs.tsx +334 -0
  279. package/src/react-ui/blocks/Terminal/panel/TerminalSettingsPopover.tsx +261 -0
  280. package/src/react-ui/blocks/Terminal/panel/TerminalThemeSelector.tsx +248 -0
  281. package/src/react-ui/blocks/Terminal/panel/index.ts +72 -0
  282. package/src/react-ui/blocks/Terminal/panel/terminal-filter-dropdown.module.css +59 -0
  283. package/src/react-ui/blocks/Terminal/panel/terminal-session-tabs.module.css +59 -0
  284. package/src/react-ui/blocks/Terminal/parsing/BadgeFormatter.ts +180 -0
  285. package/src/react-ui/blocks/Terminal/parsing/HttpLogParser.ts +248 -0
  286. package/src/react-ui/blocks/Terminal/parsing/LogParser.types.ts +283 -0
  287. package/src/react-ui/blocks/Terminal/parsing/LogParserService.ts +686 -0
  288. package/src/react-ui/blocks/Terminal/parsing/MultilineAggregator.ts +466 -0
  289. package/src/react-ui/blocks/Terminal/parsing/PersistentLogBuffer.ts +343 -0
  290. package/src/react-ui/blocks/Terminal/parsing/SyntaxHighlighter.ts +167 -0
  291. package/src/react-ui/blocks/Terminal/parsing/TableParser.ts +348 -0
  292. package/src/react-ui/blocks/Terminal/parsing/ansi/AnsiColorMapper.ts +251 -0
  293. package/src/react-ui/blocks/Terminal/parsing/ansi/AnsiParser.ts +390 -0
  294. package/src/react-ui/blocks/Terminal/parsing/ansi/ansi.constants.ts +320 -0
  295. package/src/react-ui/blocks/Terminal/parsing/ansi/index.ts +20 -0
  296. package/src/react-ui/blocks/Terminal/parsing/index.ts +69 -0
  297. package/src/react-ui/blocks/Terminal/parsing/levels/LogLevel.types.ts +68 -0
  298. package/src/react-ui/blocks/Terminal/parsing/levels/LogLevelDetector.ts +436 -0
  299. package/src/react-ui/blocks/Terminal/parsing/levels/index.ts +14 -0
  300. package/src/react-ui/blocks/index.ts +11 -0
  301. package/src/react-ui/icons/lucide-animated/activity.tsx +2 -2
  302. package/src/react-ui/icons/lucide-animated/bell-electric.tsx +1 -1
  303. package/src/react-ui/icons/lucide-animated/bell.tsx +2 -2
  304. package/src/react-ui/icons/lucide-animated/bot.tsx +1 -1
  305. package/src/react-ui/icons/lucide-animated/box.tsx +2 -2
  306. package/src/react-ui/icons/lucide-animated/circle-check.tsx +2 -2
  307. package/src/react-ui/icons/lucide-animated/delete.tsx +2 -2
  308. package/src/react-ui/icons/lucide-animated/download.tsx +2 -2
  309. package/src/react-ui/icons/lucide-animated/home.tsx +2 -2
  310. package/src/react-ui/icons/lucide-animated/layout-panel-top.tsx +1 -1
  311. package/src/react-ui/icons/lucide-animated/plus.tsx +1 -1
  312. package/src/react-ui/icons/lucide-animated/search.tsx +1 -1
  313. package/src/react-ui/icons/lucide-animated/settings.tsx +1 -1
  314. package/src/react-ui/icons/lucide-animated/trending-down.tsx +2 -2
  315. package/src/react-ui/icons/lucide-animated/trending-up.tsx +2 -2
  316. package/src/react-ui/icons/lucide-animated/x.tsx +2 -2
  317. package/src/react-ui/lib/icon-wrapper.tsx +70 -0
  318. package/src/react-ui/lib/index.ts +1 -0
  319. package/src/react-ui/ui/CornerBracket/CornerBracket.styles.ts +1 -1
  320. package/src/react-ui/ui/Tabs/Tabs.css +39 -0
  321. package/src/react-ui/ui/Tabs/Tabs.styles.ts +119 -31
  322. package/src/react-ui/ui/Tabs/Tabs.types.ts +8 -3
  323. package/src/react-ui/ui/Tabs/index.tsx +135 -27
  324. package/src/react-ui/ui/index.ts +1 -0
  325. package/dist/index.css +0 -129
@@ -0,0 +1,348 @@
1
+ /**
2
+ * Table parser for box-drawing character tables.
3
+ *
4
+ * Detects and parses tables created with box-drawing characters
5
+ * (├─│└┌) commonly found in CLI output.
6
+ *
7
+ * @module components/devenv/terminal/parsing/TableParser
8
+ */
9
+
10
+ import type { IParsedLogEntry } from './LogParser.types';
11
+
12
+ /**
13
+ * Box-drawing characters used for table borders.
14
+ * Unicode range: U+2500-U+257F
15
+ */
16
+ export const TABLE_CHARS = [
17
+ '─', '│', '┌', '┐', '└', '┘',
18
+ '├', '┤', '┬', '┴', '┼',
19
+ '═', '║', '╔', '╗', '╚', '╝',
20
+ '╠', '╣', '╦', '╩', '╬',
21
+ '╒', '╓', '╕', '╖', '╘', '╙',
22
+ '╛', '╜', '╢', '╡', '╤', '╧',
23
+ '╟', '╞', '╡', '╢', '╪', '╫',
24
+ ] as const;
25
+
26
+ /**
27
+ * Table row type.
28
+ */
29
+ export type TTableRowType = 'top' | 'header' | 'separator' | 'data' | 'bottom' | 'unknown';
30
+
31
+ /**
32
+ * Parsed table row.
33
+ */
34
+ export interface ITableRow {
35
+ /** Raw line */
36
+ raw: string;
37
+
38
+ /** Row type */
39
+ type: TTableRowType;
40
+
41
+ /** Cells extracted from the row (for data rows) */
42
+ cells?: string[];
43
+
44
+ /** Line number */
45
+ lineNumber: number;
46
+ }
47
+
48
+ /**
49
+ * Parsed table data.
50
+ */
51
+ export interface ITableData {
52
+ /** All rows in the table */
53
+ rows: ITableRow[];
54
+
55
+ /** Number of columns */
56
+ columnCount: number;
57
+
58
+ /** Header row if present */
59
+ headers?: string[];
60
+
61
+ /** Data rows (excluding borders) */
62
+ dataRows: string[][];
63
+
64
+ /** Line number of first row */
65
+ startLine: number;
66
+
67
+ /** Line number of last row */
68
+ endLine: number;
69
+ }
70
+
71
+ /**
72
+ * Table parser class.
73
+ *
74
+ * Detects and parses tables created with box-drawing characters.
75
+ * Groups consecutive table lines and extracts cell data.
76
+ *
77
+ * @example
78
+ * ```ts
79
+ * const parser = new TableParser();
80
+ * const isTable = parser.isTableLine('├──────────┼──────────┤');
81
+ * const table = parser.parseTable(lines);
82
+ * ```
83
+ */
84
+ export class TableParser {
85
+ /** Minimum box-drawing characters to consider a line a table */
86
+ private readonly MIN_TABLE_CHARS = 2;
87
+
88
+ /**
89
+ * Check if a line is a table line.
90
+ *
91
+ * A line is considered a table line if it contains multiple
92
+ * box-drawing characters.
93
+ *
94
+ * @param line - Line to check
95
+ * @returns true if line is part of a table
96
+ */
97
+ isTableLine(line: string): boolean {
98
+ let count = 0;
99
+
100
+ for (const char of TABLE_CHARS) {
101
+ if (line.includes(char)) {
102
+ count++;
103
+ if (count >= this.MIN_TABLE_CHARS) {
104
+ return true;
105
+ }
106
+ }
107
+ }
108
+
109
+ return count >= this.MIN_TABLE_CHARS;
110
+ }
111
+
112
+ /**
113
+ * Determine the type of a table row.
114
+ *
115
+ * @param line - Table row line
116
+ * @returns Row type
117
+ */
118
+ getRowType(line: string): TTableRowType {
119
+ const trimmed = line.trim();
120
+
121
+ // Top border: starts with ┌ or ╒
122
+ if (/^[┌╒]/.test(trimmed)) {
123
+ return 'top';
124
+ }
125
+
126
+ // Bottom border: starts with └ or ╘
127
+ if (/^[└╘]/.test(trimmed)) {
128
+ return 'bottom';
129
+ }
130
+
131
+ // Separator: contains ├, ┼, ┬, ┴, ╪, ╤, ╧, etc.
132
+ if (/[├┼┬┴╪╤╧╠╦╩╬]/.test(trimmed)) {
133
+ return 'separator';
134
+ }
135
+
136
+ // Header separator: usually has ═ or ─
137
+ if (/[═]/.test(trimmed) && /[│║]/.test(trimmed)) {
138
+ return 'separator';
139
+ }
140
+
141
+ // Data or header row: contains │ with text
142
+ if (/[│║]/.test(trimmed) && /[a-zA-Z0-9]/.test(trimmed)) {
143
+ // Check if it looks like a header (all caps or specific patterns)
144
+ const content = trimmed.replace(/[│║═─┼┬┴├╪╤╧]/g, ' ').trim();
145
+ if (content.length > 0 && content === content.toUpperCase() && content.length < 50) {
146
+ return 'header';
147
+ }
148
+ return 'data';
149
+ }
150
+
151
+ return 'unknown';
152
+ }
153
+
154
+ /**
155
+ * Extract cells from a table row.
156
+ *
157
+ * Splits the row by │ characters and trims each cell.
158
+ *
159
+ * @param line - Table row line
160
+ * @returns Array of cell contents
161
+ */
162
+ extractCells(line: string): string[] {
163
+ // Remove border characters and split by │
164
+ const cleaned = line.replace(/^[│║]|[│║]$/g, '');
165
+ const cells = cleaned.split(/[│║]/);
166
+
167
+ return cells.map((cell) => cell.trim()).filter((cell) => cell.length > 0);
168
+ }
169
+
170
+ /**
171
+ * Parse a complete table from an array of lines.
172
+ *
173
+ * Groups consecutive table lines and extracts structured data.
174
+ *
175
+ * @param lines - Array of table lines
176
+ * @param startLine - Starting line number
177
+ * @returns Parsed table data
178
+ */
179
+ parseTable(lines: string[], startLine: number): ITableData {
180
+ const rows: ITableRow[] = [];
181
+ const dataRows: string[][] = [];
182
+
183
+ for (let i = 0; i < lines.length; i++) {
184
+ const line = lines[i];
185
+ const type = this.getRowType(line);
186
+ const cells = type === 'data' || type === 'header' ? this.extractCells(line) : undefined;
187
+
188
+ const row: ITableRow = {
189
+ raw: line,
190
+ type,
191
+ cells,
192
+ lineNumber: startLine + i,
193
+ };
194
+
195
+ rows.push(row);
196
+
197
+ if (cells) {
198
+ dataRows.push(cells);
199
+ }
200
+ }
201
+
202
+ // Determine column count from the widest row
203
+ const columnCount = Math.max(...dataRows.map((r) => r.length), 1);
204
+
205
+ // Extract headers if present (first data row that looks like headers)
206
+ const headerRow = rows.find((r) => r.type === 'header');
207
+ const headers = headerRow?.cells;
208
+
209
+ return {
210
+ rows,
211
+ columnCount,
212
+ headers,
213
+ dataRows,
214
+ startLine,
215
+ endLine: startLine + lines.length - 1,
216
+ };
217
+ }
218
+
219
+ /**
220
+ * Parse table entries from a log stream.
221
+ *
222
+ * Scans through lines, grouping table lines into entries.
223
+ *
224
+ * @param lines - Array of log lines
225
+ * @param startLine - Starting line number
226
+ * @returns Array of parsed log entries
227
+ */
228
+ parseTableEntries(lines: string[], startLine: number): IParsedLogEntry[] {
229
+ const entries: IParsedLogEntry[] = [];
230
+ let inTable = false;
231
+ let tableStartLine = 0;
232
+ const tableLines: string[] = [];
233
+
234
+ for (let i = 0; i < lines.length; i++) {
235
+ const line = lines[i];
236
+ const isTable = this.isTableLine(line);
237
+
238
+ if (isTable && !inTable) {
239
+ // Start of a new table
240
+ inTable = true;
241
+ tableStartLine = startLine + i;
242
+ tableLines.push(line);
243
+ } else if (isTable && inTable) {
244
+ // Continuation of table
245
+ tableLines.push(line);
246
+ } else if (!isTable && inTable) {
247
+ // End of table - create entry
248
+ const tableData = this.parseTable(tableLines, tableStartLine);
249
+
250
+ entries.push({
251
+ raw: tableLines.join('\n'),
252
+ formatted: tableLines.join('\n'),
253
+ level: 'info',
254
+ line_number: tableStartLine,
255
+ is_stderr: false,
256
+ content_type: 'table',
257
+ table_data: tableData,
258
+ is_continuation: false,
259
+ });
260
+
261
+ // Mark continuation lines
262
+ for (let j = 1; j < tableLines.length; j++) {
263
+ entries.push({
264
+ raw: tableLines[j],
265
+ formatted: tableLines[j],
266
+ level: 'info',
267
+ line_number: tableStartLine + j,
268
+ is_stderr: false,
269
+ content_type: 'table',
270
+ is_continuation: true,
271
+ parent_line_number: tableStartLine,
272
+ });
273
+ }
274
+
275
+ // Reset state
276
+ inTable = false;
277
+ tableLines.length = 0;
278
+
279
+ // Process current line as normal entry (will be handled by caller)
280
+ // Don't add non-table line here - let other parsers handle it
281
+ } else {
282
+ // Not a table line, not in table - skip (handled by other parsers)
283
+ }
284
+ }
285
+
286
+ // Handle table that ends at the end of the batch
287
+ if (tableLines.length > 0) {
288
+ const tableData = this.parseTable(tableLines, tableStartLine);
289
+
290
+ entries.push({
291
+ raw: tableLines.join('\n'),
292
+ formatted: tableLines.join('\n'),
293
+ level: 'info',
294
+ line_number: tableStartLine,
295
+ is_stderr: false,
296
+ content_type: 'table',
297
+ table_data: tableData,
298
+ is_continuation: false,
299
+ });
300
+
301
+ for (let j = 1; j < tableLines.length; j++) {
302
+ entries.push({
303
+ raw: tableLines[j],
304
+ formatted: tableLines[j],
305
+ level: 'info',
306
+ line_number: tableStartLine + j,
307
+ is_stderr: false,
308
+ content_type: 'table',
309
+ is_continuation: true,
310
+ parent_line_number: tableStartLine,
311
+ });
312
+ }
313
+ }
314
+
315
+ return entries;
316
+ }
317
+
318
+ /**
319
+ * Get CSS class for a table row type.
320
+ *
321
+ * @param type - Row type
322
+ * @returns CSS class string
323
+ */
324
+ getRowClass(type: TTableRowType): string {
325
+ switch (type) {
326
+ case 'top':
327
+ case 'bottom':
328
+ return 'text-gray-500';
329
+ case 'separator':
330
+ return 'text-gray-600';
331
+ case 'header':
332
+ return 'font-semibold text-foreground';
333
+ case 'data':
334
+ return 'text-foreground';
335
+ default:
336
+ return 'text-foreground';
337
+ }
338
+ }
339
+ }
340
+
341
+ /**
342
+ * Create a new table parser instance.
343
+ *
344
+ * @returns New TableParser instance
345
+ */
346
+ export function createTableParser(): TableParser {
347
+ return new TableParser();
348
+ }
@@ -0,0 +1,251 @@
1
+ /**
2
+ * ANSI color mapper for Synthwave theme integration.
3
+ *
4
+ * Maps ANSI color codes to Synthwave Industrial Dark theme colors
5
+ * from Terminal.theme.ts. Provides utilities for converting between
6
+ * different color representations and applying theme-aware coloring.
7
+ *
8
+ * @module components/devenv/terminal/parsing/ansi/mapper
9
+ */
10
+
11
+ import { SYNTHWAVE_ANSI_COLORS } from './ansi.constants';
12
+ import type { IAnsiStyle } from '../LogParser.types';
13
+
14
+ /**
15
+ * ANSI color mapper class.
16
+ *
17
+ * Provides static methods for mapping ANSI color codes to
18
+ * Synthwave theme colors and converting between color formats.
19
+ */
20
+ export class AnsiColorMapper {
21
+ /**
22
+ * Get hex color for ANSI foreground color code.
23
+ *
24
+ * Converts ANSI SGR foreground color codes (30-37, 90-97) to
25
+ * their corresponding hex colors in the Synthwave theme.
26
+ *
27
+ * @param code - ANSI color code (e.g., 31 for red, 32 for green)
28
+ * @returns Hex color string (e.g., '#ff4466') or undefined if unknown
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const red = AnsiColorMapper.fgColor(31); // '#ff4466'
33
+ * const green = AnsiColorMapper.fgColor(32); // '#44ffaa'
34
+ * ```
35
+ */
36
+ static fgColor(code: number): string | undefined {
37
+ return SYNTHWAVE_ANSI_COLORS[code];
38
+ }
39
+
40
+ /**
41
+ * Get hex color for ANSI background color code.
42
+ *
43
+ * Converts ANSI SGR background color codes (40-47, 100-107) to
44
+ * their corresponding hex colors by converting to foreground
45
+ * code and looking up in theme.
46
+ *
47
+ * @param code - ANSI background color code (e.g., 41 for red bg)
48
+ * @returns Hex color string or undefined if unknown
49
+ *
50
+ * @example
51
+ * ```ts
52
+ * const redBg = AnsiColorMapper.bgColor(41); // '#ff4466'
53
+ * ```
54
+ */
55
+ static bgColor(code: number): string | undefined {
56
+ // Convert background code (40-47, 100-107) to foreground (30-37, 90-97)
57
+ const fgCode = code >= 100 ? code - 10 : code - 10;
58
+ return SYNTHWAVE_ANSI_COLORS[fgCode];
59
+ }
60
+
61
+ /**
62
+ * Check if color code is bright variant.
63
+ *
64
+ * @param code - ANSI color code
65
+ * @returns true if code is bright (90-97 or 100-107)
66
+ */
67
+ static isBright(code: number): boolean {
68
+ return (code >= 90 && code <= 97) || (code >= 100 && code <= 107);
69
+ }
70
+
71
+ /**
72
+ * Check if color code is background color.
73
+ *
74
+ * @param code - ANSI color code
75
+ * @returns true if code is background (40-47 or 100-107)
76
+ */
77
+ static isBackground(code: number): boolean {
78
+ return (code >= 40 && code <= 47) || (code >= 100 && code <= 107);
79
+ }
80
+
81
+ /**
82
+ * Convert ANSI style to hex color pair.
83
+ *
84
+ * Takes a parsed ANSI style and returns foreground and background
85
+ * hex colors for use in xterm.js or CSS styling.
86
+ *
87
+ * @param style - Parsed ANSI style
88
+ * @returns Object with fg and bg hex colors (undefined if not set)
89
+ *
90
+ * @example
91
+ * ```ts
92
+ * const colors = AnsiColorMapper.styleToHex({
93
+ * fg_color: 31,
94
+ * bg_color: 44,
95
+ * modifiers: ['bold']
96
+ * });
97
+ * // { fg: '#ff4466', bg: '#00d9ff' }
98
+ * ```
99
+ */
100
+ static styleToHex(style: IAnsiStyle): { fg?: string; bg?: string } {
101
+ const result: { fg?: string; bg?: string } = {};
102
+
103
+ if (style.fg_color !== undefined) {
104
+ result.fg = this.fgColor(style.fg_color);
105
+ }
106
+
107
+ if (style.bg_color !== undefined) {
108
+ result.bg = this.bgColor(style.bg_color);
109
+ }
110
+
111
+ return result;
112
+ }
113
+
114
+ /**
115
+ * Convert hex color to xterm.js color index.
116
+ *
117
+ * xterm.js uses a 256-color palette. This method maps Synthwave
118
+ * hex colors to the closest xterm.js color index.
119
+ *
120
+ * @param hex - Hex color string (e.g., '#ff4466')
121
+ * @returns xterm.js color index (0-255) or closest match
122
+ */
123
+ static hexToXtermColor(hex: string): number {
124
+ // Map Synthwave colors to xterm.js palette indices
125
+ const colorMap: Record<string, number> = {
126
+ '#1a1a2e': 0, // Black
127
+ '#ff4466': 197, // Red (closest)
128
+ '#44ffaa': 84, // Green (closest)
129
+ '#ffcc00': 226, // Yellow
130
+ '#00d9ff': 87, // Cyan
131
+ '#D40C67': 198, // Magenta (closest)
132
+ '#e8e8ec': 255, // White
133
+ '#2d2d44': 8, // Bright Black
134
+ '#ff6b6b': 203, // Bright Red
135
+ '#66ffcc': 86, // Bright Green
136
+ '#ffdd33': 227, // Bright Yellow
137
+ '#33e0ff': 117, // Bright Cyan
138
+ '#ff3399': 205, // Bright Magenta
139
+ '#ffffff': 15, // Bright White
140
+ };
141
+
142
+ // Normalize hex
143
+ const normalized = hex.toLowerCase();
144
+ return colorMap[normalized] ?? 7; // Default to white
145
+ }
146
+
147
+ /**
148
+ * Get log level color as hex.
149
+ *
150
+ * Returns the Synthwave theme color for a given log level.
151
+ *
152
+ * @param level - Log level
153
+ * @returns Hex color string for the log level
154
+ *
155
+ * @example
156
+ * ```ts
157
+ * const errorColor = AnsiColorMapper.logLevelColor('error'); // '#ff4466'
158
+ * const infoColor = AnsiColorMapper.logLevelColor('info'); // '#00d9ff'
159
+ * ```
160
+ */
161
+ static logLevelColor(level: string): string {
162
+ const levelColors: Record<string, string> = {
163
+ trace: '#8b9bb4', // Gray (hsl(240, 10%, 50%))
164
+ debug: '#00d9ff', // Cyan (hsl(190, 100%, 50%))
165
+ info: '#4db8ff', // Blue (hsl(210, 100%, 60%))
166
+ warn: '#ffcc00', // Yellow (hsl(45, 100%, 50%))
167
+ error: '#ff4466', // Red (hsl(350, 100%, 63%))
168
+ fatal: '#D40C67', // Magenta (hsl(330, 85%, 43%))
169
+ unknown: '#e8e8ec', // White
170
+ };
171
+
172
+ return levelColors[level] ?? levelColors.unknown;
173
+ }
174
+
175
+ /**
176
+ * Get log level background color (semi-transparent).
177
+ *
178
+ * Returns the background color for log level badges with
179
+ * transparency for overlay effects.
180
+ *
181
+ * @param level - Log level
182
+ * @returns RGBA color string for background
183
+ *
184
+ * @example
185
+ * ```ts
186
+ * const errorBg = AnsiColorMapper.logLevelBgColor('error'); // 'rgba(255, 68, 102, 0.1)'
187
+ * ```
188
+ */
189
+ static logLevelBgColor(level: string): string {
190
+ const hex = this.logLevelColor(level);
191
+ // Convert hex to rgba with 10% opacity
192
+ const r = parseInt(hex.slice(1, 3), 16);
193
+ const g = parseInt(hex.slice(3, 5), 16);
194
+ const b = parseInt(hex.slice(5, 7), 16);
195
+ return `rgba(${r}, ${g}, ${b}, 0.1)`;
196
+ }
197
+
198
+ /**
199
+ * Create xterm.js color sequence from hex.
200
+ *
201
+ * Generates xterm.js escape sequence for setting text color
202
+ * from a hex color value.
203
+ *
204
+ * @param hex - Hex color string
205
+ * @param isBackground - true for background color, false for foreground
206
+ * @returns xterm.js escape sequence
207
+ *
208
+ * @example
209
+ * ```ts
210
+ * const seq = AnsiColorMapper.xtermColorSequence('#ff4466', false);
211
+ * // '\x1b]4;196;#ff4466\x07' (OSC 4 sequence for true color)
212
+ * ```
213
+ */
214
+ static xtermColorSequence(hex: string, isBackground = false): string {
215
+ const prefix = isBackground ? '4' : '10';
216
+ return `\x1b]${prefix};#${hex.slice(1)}\x07`;
217
+ }
218
+
219
+ /**
220
+ * Convert RGB values to hex color.
221
+ *
222
+ * @param r - Red value (0-255)
223
+ * @param g - Green value (0-255)
224
+ * @param b - Blue value (0-255)
225
+ * @returns Hex color string (e.g., '#ff4466')
226
+ */
227
+ static rgbToHex(r: number, g: number, b: number): string {
228
+ const toHex = (n: number): string => {
229
+ const hex = Math.round(Math.min(255, Math.max(0, n))).toString(16);
230
+ return hex.length === 1 ? '0' + hex : hex;
231
+ };
232
+ return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
233
+ }
234
+
235
+ /**
236
+ * Convert hex color to RGB values.
237
+ *
238
+ * @param hex - Hex color string
239
+ * @returns Object with r, g, b values (0-255)
240
+ */
241
+ static hexToRgb(hex: string): { r: number; g: number; b: number } {
242
+ const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
243
+ return result
244
+ ? {
245
+ r: parseInt(result[1], 16),
246
+ g: parseInt(result[2], 16),
247
+ b: parseInt(result[3], 16),
248
+ }
249
+ : { r: 255, g: 255, b: 255 };
250
+ }
251
+ }