@mindlogic-ai/logician-ui 2.0.0-alpha.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 (432) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +234 -0
  3. package/USAGE.md +299 -0
  4. package/dist/Markdown-2D5K42BY.js +16 -0
  5. package/dist/Markdown-2D5K42BY.js.map +1 -0
  6. package/dist/Markdown-AZBXO5ZP.css +29 -0
  7. package/dist/Markdown-AZBXO5ZP.css.map +1 -0
  8. package/dist/Markdown-RJJEQN4R.mjs +3 -0
  9. package/dist/Markdown-RJJEQN4R.mjs.map +1 -0
  10. package/dist/analytics-GNSHP7X3.svg +1 -0
  11. package/dist/bulb-24SQINQB.svg +1 -0
  12. package/dist/chat-TLRFEUAS.svg +1 -0
  13. package/dist/chunk-5FHXD7KR.js +1735 -0
  14. package/dist/chunk-5FHXD7KR.js.map +1 -0
  15. package/dist/chunk-WSOHBA2C.mjs +1693 -0
  16. package/dist/chunk-WSOHBA2C.mjs.map +1 -0
  17. package/dist/edit-RWL72JNM.svg +1 -0
  18. package/dist/face-55KPDCH4.svg +1 -0
  19. package/dist/filled-analytics-RBC7KWND.svg +1 -0
  20. package/dist/filled-bulb-RC7E2WSM.svg +1 -0
  21. package/dist/filled-chat-A6J44Q7A.svg +1 -0
  22. package/dist/filled-edit-NKKWFSTW.svg +1 -0
  23. package/dist/filled-face-UML5C3LB.svg +1 -0
  24. package/dist/filled-layout-HBVCSDFO.svg +1 -0
  25. package/dist/index.css +51 -0
  26. package/dist/index.css.map +1 -0
  27. package/dist/index.d.mts +964 -0
  28. package/dist/index.d.ts +964 -0
  29. package/dist/index.js +5600 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/index.mjs +5401 -0
  32. package/dist/index.mjs.map +1 -0
  33. package/dist/language-VBJ24OPV.svg +1 -0
  34. package/dist/layout-NDDSWNNV.svg +1 -0
  35. package/dist/pending-NF7NSBYO.svg +1 -0
  36. package/dist/receipt-MNLQIFCO.svg +1 -0
  37. package/dist/sparkles-EOEGVL6G.svg +1 -0
  38. package/dist/store-3RQPBJWG.svg +1 -0
  39. package/dist/store_active-SAOAGVKC.svg +1 -0
  40. package/dist/studio-LYPUIEFA.svg +1 -0
  41. package/dist/studio_active-BC6O66OI.svg +1 -0
  42. package/dist/vertical-ellipsis-3G4WEOCW.svg +1 -0
  43. package/package.json +138 -0
  44. package/src/components/Accordion/Accordion.stories.tsx +41 -0
  45. package/src/components/Accordion/Accordion.tsx +14 -0
  46. package/src/components/Accordion/AccordionButton.tsx +40 -0
  47. package/src/components/Accordion/AccordionItem.tsx +17 -0
  48. package/src/components/Accordion/index.ts +4 -0
  49. package/src/components/Alert/Alert.stories.tsx +38 -0
  50. package/src/components/Alert/Alert.styles.ts +19 -0
  51. package/src/components/Alert/Alert.tsx +41 -0
  52. package/src/components/Alert/Alert.types.ts +5 -0
  53. package/src/components/Alert/index.ts +1 -0
  54. package/src/components/AutowidthInput/AutowidthInput.stories.tsx +23 -0
  55. package/src/components/AutowidthInput/AutowidthInput.tsx +47 -0
  56. package/src/components/AutowidthInput/index.ts +1 -0
  57. package/src/components/Avatar/Avatar.stories.tsx +23 -0
  58. package/src/components/Avatar/Avatar.tsx +19 -0
  59. package/src/components/Avatar/index.tsx +1 -0
  60. package/src/components/Badge/Badge.stories.tsx +23 -0
  61. package/src/components/Badge/Badge.styles.ts +11 -0
  62. package/src/components/Badge/Badge.tsx +26 -0
  63. package/src/components/Badge/index.ts +2 -0
  64. package/src/components/Banner/Banner.stories.tsx +37 -0
  65. package/src/components/Banner/Banner.styles.ts +79 -0
  66. package/src/components/Banner/Banner.tsx +68 -0
  67. package/src/components/Banner/Banner.types.ts +6 -0
  68. package/src/components/Banner/index.ts +2 -0
  69. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +14 -0
  70. package/src/components/Breadcrumb/Breadcrumb.tsx +19 -0
  71. package/src/components/Breadcrumb/Breadcrumb.types.ts +3 -0
  72. package/src/components/Breadcrumb/BreadcrumbItem/BreadcrumbItem.tsx +12 -0
  73. package/src/components/Breadcrumb/BreadcrumbItem/BreadcrumbItem.types.ts +3 -0
  74. package/src/components/Breadcrumb/BreadcrumbItem/index.ts +2 -0
  75. package/src/components/Breadcrumb/BreadcrumbLink/BreadcrumbLink.tsx +30 -0
  76. package/src/components/Breadcrumb/BreadcrumbLink/BreadcrumbLink.types.ts +3 -0
  77. package/src/components/Breadcrumb/BreadcrumbLink/index.ts +2 -0
  78. package/src/components/Breadcrumb/index.ts +3 -0
  79. package/src/components/Button/Button.stories.tsx +52 -0
  80. package/src/components/Button/Button.styles.ts +59 -0
  81. package/src/components/Button/Button.tsx +43 -0
  82. package/src/components/Button/Button.types.ts +13 -0
  83. package/src/components/Button/index.tsx +3 -0
  84. package/src/components/Card/Card.stories.tsx +24 -0
  85. package/src/components/Card/Card.styles.ts +30 -0
  86. package/src/components/Card/Card.tsx +29 -0
  87. package/src/components/Card/Card.types.ts +8 -0
  88. package/src/components/Card/index.ts +2 -0
  89. package/src/components/Carousel/Carousel.stories.tsx +159 -0
  90. package/src/components/Carousel/Carousel.tsx +160 -0
  91. package/src/components/Carousel/Carousel.types.ts +22 -0
  92. package/src/components/Carousel/index.ts +1 -0
  93. package/src/components/CarouselModal/CarouselModal.stories.tsx +53 -0
  94. package/src/components/CarouselModal/CarouselModal.tsx +106 -0
  95. package/src/components/CarouselModal/CarouselModal.types.ts +16 -0
  96. package/src/components/CarouselModal/index.ts +2 -0
  97. package/src/components/Checkbox/Checkbox.stories.tsx +16 -0
  98. package/src/components/Checkbox/Checkbox.tsx +29 -0
  99. package/src/components/Checkbox/Checkbox.types.ts +3 -0
  100. package/src/components/Checkbox/index.ts +2 -0
  101. package/src/components/Chip/Chip.stories.tsx +44 -0
  102. package/src/components/Chip/Chip.styles.ts +114 -0
  103. package/src/components/Chip/Chip.tsx +23 -0
  104. package/src/components/Chip/Chip.types.ts +14 -0
  105. package/src/components/Chip/index.ts +2 -0
  106. package/src/components/ChipButton/Chip.types.ts +4 -0
  107. package/src/components/ChipButton/ChipButton.tsx +25 -0
  108. package/src/components/ChipButton/index.ts +1 -0
  109. package/src/components/Code/Code.stories.tsx +28 -0
  110. package/src/components/Code/Code.tsx +160 -0
  111. package/src/components/Code/Code.types.ts +40 -0
  112. package/src/components/Code/_components/CopyButton.tsx +48 -0
  113. package/src/components/Code/index.ts +1 -0
  114. package/src/components/CodeTabs/CodeTabs.stories.tsx +51 -0
  115. package/src/components/CodeTabs/CodeTabs.tsx +98 -0
  116. package/src/components/CodeTabs/CodeTabs.types.ts +17 -0
  117. package/src/components/CodeTabs/index.ts +1 -0
  118. package/src/components/Container/Container.stories.tsx +28 -0
  119. package/src/components/Container/Container.tsx +21 -0
  120. package/src/components/Container/index.ts +1 -0
  121. package/src/components/Container/useContainerSize.ts +47 -0
  122. package/src/components/CopyableCode/CopyableCode.stories.tsx +26 -0
  123. package/src/components/CopyableCode/CopyableCode.tsx +58 -0
  124. package/src/components/CopyableCode/CopyableCode.types.ts +7 -0
  125. package/src/components/CopyableCode/index.ts +2 -0
  126. package/src/components/CrossPageToasts/CrossPageToasts.tsx +33 -0
  127. package/src/components/CrossPageToasts/index.ts +1 -0
  128. package/src/components/DataField/DataField.stories.tsx +61 -0
  129. package/src/components/DataField/DataField.styles.ts +33 -0
  130. package/src/components/DataField/DataField.tsx +141 -0
  131. package/src/components/DataField/DataField.types.ts +18 -0
  132. package/src/components/DataField/index.ts +1 -0
  133. package/src/components/DatePicker/RangeDatePicker.stories.tsx +45 -0
  134. package/src/components/DatePicker/RangeDatePicker.tsx +74 -0
  135. package/src/components/DatePicker/SingleDatePicker.stories.tsx +31 -0
  136. package/src/components/DatePicker/SingleDatePicker.tsx +72 -0
  137. package/src/components/DatePicker/index.ts +2 -0
  138. package/src/components/FileInput/FileInput.stories.tsx +28 -0
  139. package/src/components/FileInput/FileInput.tsx +117 -0
  140. package/src/components/FileInput/FileInput.types.ts +14 -0
  141. package/src/components/FileInput/index.ts +2 -0
  142. package/src/components/FileItem/FileItem.stories.tsx +27 -0
  143. package/src/components/FileItem/FileItem.tsx +134 -0
  144. package/src/components/FileItem/FileItem.types.ts +11 -0
  145. package/src/components/FileItem/index.ts +1 -0
  146. package/src/components/FileList/FileList.stories.tsx +65 -0
  147. package/src/components/FileList/FileList.tsx +97 -0
  148. package/src/components/FileList/FileList.types.ts +18 -0
  149. package/src/components/FileList/index.tsx +1 -0
  150. package/src/components/FormControl/FormControl.stories.tsx +16 -0
  151. package/src/components/FormControl/FormControl.tsx +12 -0
  152. package/src/components/FormControl/FormControl.types.ts +3 -0
  153. package/src/components/FormControl/index.ts +2 -0
  154. package/src/components/FormLabel/FormLabel.tsx +5 -0
  155. package/src/components/FormLabel/index.ts +1 -0
  156. package/src/components/GuideCue/GuideCue.stories.tsx +57 -0
  157. package/src/components/GuideCue/GuideCue.tsx +231 -0
  158. package/src/components/GuideCue/GuideCueContext.tsx +70 -0
  159. package/src/components/GuideCue/index.ts +2 -0
  160. package/src/components/Icon/Icon.stories.tsx +77 -0
  161. package/src/components/Icon/Icon.styles.ts +6 -0
  162. package/src/components/Icon/Icon.tsx +73 -0
  163. package/src/components/Icon/Icon.types.ts +10 -0
  164. package/src/components/Icon/IconMap.ts +290 -0
  165. package/src/components/Icon/icons/analytics.svg +1 -0
  166. package/src/components/Icon/icons/bulb.svg +1 -0
  167. package/src/components/Icon/icons/chat.svg +1 -0
  168. package/src/components/Icon/icons/edit.svg +1 -0
  169. package/src/components/Icon/icons/face.svg +1 -0
  170. package/src/components/Icon/icons/filled-analytics.svg +1 -0
  171. package/src/components/Icon/icons/filled-bulb.svg +1 -0
  172. package/src/components/Icon/icons/filled-chat.svg +1 -0
  173. package/src/components/Icon/icons/filled-edit.svg +1 -0
  174. package/src/components/Icon/icons/filled-face.svg +1 -0
  175. package/src/components/Icon/icons/filled-layout.svg +1 -0
  176. package/src/components/Icon/icons/language.svg +1 -0
  177. package/src/components/Icon/icons/layout.svg +1 -0
  178. package/src/components/Icon/icons/pending.svg +1 -0
  179. package/src/components/Icon/icons/receipt.svg +1 -0
  180. package/src/components/Icon/icons/sparkles.svg +1 -0
  181. package/src/components/Icon/icons/store.svg +1 -0
  182. package/src/components/Icon/icons/store_active.svg +1 -0
  183. package/src/components/Icon/icons/studio.svg +1 -0
  184. package/src/components/Icon/icons/studio_active.svg +1 -0
  185. package/src/components/Icon/icons/vertical-ellipsis.svg +1 -0
  186. package/src/components/Icon/index.tsx +3 -0
  187. package/src/components/IconButton/IconButton.stories.tsx +51 -0
  188. package/src/components/IconButton/IconButton.styles.ts +52 -0
  189. package/src/components/IconButton/IconButton.tsx +36 -0
  190. package/src/components/IconButton/IconButton.types.ts +12 -0
  191. package/src/components/IconButton/index.tsx +1 -0
  192. package/src/components/InfoSprinkle/InfoSprinkle.stories.tsx +25 -0
  193. package/src/components/InfoSprinkle/InfoSprinkle.tsx +48 -0
  194. package/src/components/InfoSprinkle/index.ts +1 -0
  195. package/src/components/InlineCode/InlineCode.tsx +18 -0
  196. package/src/components/InlineCode/index.ts +1 -0
  197. package/src/components/Input/Input.stories.tsx +55 -0
  198. package/src/components/Input/Input.tsx +358 -0
  199. package/src/components/Input/Input.types.ts +19 -0
  200. package/src/components/Input/index.tsx +2 -0
  201. package/src/components/LineGraph/LineGraph.stories.tsx +98 -0
  202. package/src/components/LineGraph/LineGraph.tsx +88 -0
  203. package/src/components/LineGraph/LineGraph.types.ts +41 -0
  204. package/src/components/LineGraph/index.ts +1 -0
  205. package/src/components/Link/Link.styles.ts +13 -0
  206. package/src/components/Link/Link.tsx +93 -0
  207. package/src/components/Link/index.ts +1 -0
  208. package/src/components/Loaders/PageLoader.stories.tsx +29 -0
  209. package/src/components/Loaders/PageLoader.tsx +30 -0
  210. package/src/components/Loaders/SectionLoader.stories.tsx +26 -0
  211. package/src/components/Loaders/SectionLoader.tsx +30 -0
  212. package/src/components/Loaders/index.ts +1 -0
  213. package/src/components/MDXEditor/MDXEditor.css +21 -0
  214. package/src/components/MDXEditor/MDXEditor.stories.tsx +45 -0
  215. package/src/components/MDXEditor/MDXEditor.tsx +189 -0
  216. package/src/components/MDXEditor/MDXEditor.types.ts +6 -0
  217. package/src/components/MDXEditor/index.ts +1 -0
  218. package/src/components/Markdown/Markdown.module.css +30 -0
  219. package/src/components/Markdown/Markdown.tsx +133 -0
  220. package/src/components/Markdown/Markdown.types.ts +5 -0
  221. package/src/components/Markdown/index.ts +2 -0
  222. package/src/components/Masonry/Masonry.stories.tsx +288 -0
  223. package/src/components/Masonry/Masonry.tsx +187 -0
  224. package/src/components/Masonry/Masonry.types.ts +18 -0
  225. package/src/components/Masonry/index.ts +2 -0
  226. package/src/components/MaxLengthIndicator/MaxLengthIndicator.stories.tsx +26 -0
  227. package/src/components/MaxLengthIndicator/MaxLengthIndicator.tsx +25 -0
  228. package/src/components/MaxLengthIndicator/index.tsx +1 -0
  229. package/src/components/Menu/Menu.stories.tsx +186 -0
  230. package/src/components/Menu/MenuButton.tsx +8 -0
  231. package/src/components/Menu/MenuButton.types.ts +23 -0
  232. package/src/components/Menu/MenuItem.tsx +35 -0
  233. package/src/components/Menu/MenuItem.types.ts +13 -0
  234. package/src/components/Menu/MenuList.tsx +19 -0
  235. package/src/components/Menu/index.ts +7 -0
  236. package/src/components/Modal/Modal.stories.tsx +83 -0
  237. package/src/components/Modal/Modal.styles.ts +14 -0
  238. package/src/components/Modal/Modal.tsx +14 -0
  239. package/src/components/Modal/Modal.types.ts +3 -0
  240. package/src/components/Modal/ModalBody.tsx +9 -0
  241. package/src/components/Modal/ModalCloseButton.tsx +18 -0
  242. package/src/components/Modal/ModalContent/ModalContent.tsx +8 -0
  243. package/src/components/Modal/ModalContent/ModalContent.types.ts +3 -0
  244. package/src/components/Modal/ModalContent/index.ts +1 -0
  245. package/src/components/Modal/ModalFooter/ModalFooter.module.css +3 -0
  246. package/src/components/Modal/ModalFooter/ModalFooter.tsx +20 -0
  247. package/src/components/Modal/ModalFooter/index.ts +1 -0
  248. package/src/components/Modal/ModalHeader.tsx +9 -0
  249. package/src/components/Modal/ModalOverlay.tsx +9 -0
  250. package/src/components/Modal/index.tsx +8 -0
  251. package/src/components/MonthRangePicker/MonthButton/MonthButton.tsx +105 -0
  252. package/src/components/MonthRangePicker/MonthButton/MonthButton.types.ts +42 -0
  253. package/src/components/MonthRangePicker/MonthButton/index.ts +2 -0
  254. package/src/components/MonthRangePicker/MonthRangePicker.stories.tsx +164 -0
  255. package/src/components/MonthRangePicker/MonthRangePicker.tsx +274 -0
  256. package/src/components/MonthRangePicker/MonthRangePicker.types.ts +38 -0
  257. package/src/components/MonthRangePicker/_utils/hasEnabledMonthsInYear.ts +15 -0
  258. package/src/components/MonthRangePicker/_utils/index.ts +6 -0
  259. package/src/components/MonthRangePicker/_utils/isMonthDisabled.ts +20 -0
  260. package/src/components/MonthRangePicker/_utils/isMonthInPreviewRange.ts +32 -0
  261. package/src/components/MonthRangePicker/_utils/isMonthInRange.ts +17 -0
  262. package/src/components/MonthRangePicker/_utils/isMonthSelected.ts +19 -0
  263. package/src/components/MonthRangePicker/_utils/isSelectionStart.ts +12 -0
  264. package/src/components/MonthRangePicker/constants.ts +63 -0
  265. package/src/components/MonthRangePicker/index.ts +2 -0
  266. package/src/components/Pagination/Pagination.stories.tsx +51 -0
  267. package/src/components/Pagination/Pagination.tsx +150 -0
  268. package/src/components/Pagination/Pagination.types.ts +12 -0
  269. package/src/components/Pagination/index.tsx +1 -0
  270. package/src/components/PasswordInput/PasswordInput.stories.tsx +16 -0
  271. package/src/components/PasswordInput/PasswordInput.tsx +42 -0
  272. package/src/components/PasswordInput/PasswordInput.types.ts +11 -0
  273. package/src/components/PasswordInput/index.ts +1 -0
  274. package/src/components/PinInput/PinInput.stories.tsx +26 -0
  275. package/src/components/PinInput/PinInput.tsx +53 -0
  276. package/src/components/PinInput/PinInput.types.ts +27 -0
  277. package/src/components/PinInput/index.tsx +2 -0
  278. package/src/components/ProgressBar/ProgressBar.stories.tsx +18 -0
  279. package/src/components/ProgressBar/ProgressBar.styles.ts +4 -0
  280. package/src/components/ProgressBar/ProgressBar.tsx +27 -0
  281. package/src/components/ProgressBar/ProgressBar.types.ts +4 -0
  282. package/src/components/ProgressBar/index.ts +1 -0
  283. package/src/components/RadialProgress/RadialProgress.stories.tsx +272 -0
  284. package/src/components/RadialProgress/RadialProgress.tsx +232 -0
  285. package/src/components/RadialProgress/RadialProgress.types.ts +27 -0
  286. package/src/components/RadialProgress/index.ts +2 -0
  287. package/src/components/Radio/Radio.stories.tsx +226 -0
  288. package/src/components/Radio/Radio.tsx +35 -0
  289. package/src/components/Radio/Radio.types.ts +21 -0
  290. package/src/components/Radio/RadioGroup.tsx +26 -0
  291. package/src/components/Radio/index.ts +3 -0
  292. package/src/components/SeeMoreButton/SeeMoreButton.stories.tsx +48 -0
  293. package/src/components/SeeMoreButton/SeeMoreButton.styles.ts +11 -0
  294. package/src/components/SeeMoreButton/SeeMoreButton.tsx +34 -0
  295. package/src/components/SeeMoreButton/SeeMoreButton.types.ts +6 -0
  296. package/src/components/SeeMoreButton/index.tsx +1 -0
  297. package/src/components/SegmentedControl/SegmentedControl.stories.tsx +96 -0
  298. package/src/components/SegmentedControl/SegmentedControl.styles.ts +28 -0
  299. package/src/components/SegmentedControl/SegmentedControl.tsx +89 -0
  300. package/src/components/SegmentedControl/SegmentedControl.types.ts +15 -0
  301. package/src/components/SegmentedControl/index.ts +2 -0
  302. package/src/components/SegmentedProgressBar/ProgressSegment.tsx +18 -0
  303. package/src/components/SegmentedProgressBar/SegmentedProgressBar.stories.tsx +228 -0
  304. package/src/components/SegmentedProgressBar/SegmentedProgressBar.tsx +25 -0
  305. package/src/components/SegmentedProgressBar/SegmentedProgressBar.types.ts +11 -0
  306. package/src/components/SegmentedProgressBar/SegmentedProgressBarContext.tsx +24 -0
  307. package/src/components/SegmentedProgressBar/index.ts +3 -0
  308. package/src/components/Select/MenuList/MenuList.tsx +87 -0
  309. package/src/components/Select/MenuList/MenuList.types.ts +21 -0
  310. package/src/components/Select/MenuList/VirtualizedMenuList.tsx +140 -0
  311. package/src/components/Select/MenuList/VirtualizedMenuListContext.tsx +35 -0
  312. package/src/components/Select/MenuList/index.ts +3 -0
  313. package/src/components/Select/Select.stories.tsx +70 -0
  314. package/src/components/Select/Select.styles.ts +102 -0
  315. package/src/components/Select/Select.tsx +204 -0
  316. package/src/components/Select/Select.types.ts +18 -0
  317. package/src/components/Select/_utils/resolveStyle.ts +21 -0
  318. package/src/components/Select/index.ts +1 -0
  319. package/src/components/Slider/Slider.stories.tsx +75 -0
  320. package/src/components/Slider/Slider.tsx +12 -0
  321. package/src/components/Slider/Slider.types.ts +3 -0
  322. package/src/components/Slider/SliderFilledTrack/SliderFilledTrack.tsx +14 -0
  323. package/src/components/Slider/SliderFilledTrack/SliderFilledTrack.types.ts +3 -0
  324. package/src/components/Slider/SliderFilledTrack/index.ts +2 -0
  325. package/src/components/Slider/SliderMark/SliderMark.tsx +12 -0
  326. package/src/components/Slider/SliderMark/SliderMark.types.ts +3 -0
  327. package/src/components/Slider/SliderMark/index.ts +2 -0
  328. package/src/components/Slider/SliderThumb/SliderThumb.tsx +22 -0
  329. package/src/components/Slider/SliderThumb/SliderThumb.types.ts +3 -0
  330. package/src/components/Slider/SliderThumb/index.ts +2 -0
  331. package/src/components/Slider/SliderTrack/SliderTrack.tsx +12 -0
  332. package/src/components/Slider/SliderTrack/SliderTrack.types.ts +3 -0
  333. package/src/components/Slider/SliderTrack/index.ts +2 -0
  334. package/src/components/Slider/index.ts +5 -0
  335. package/src/components/Spinner/Spinner.stories.tsx +16 -0
  336. package/src/components/Spinner/Spinner.tsx +20 -0
  337. package/src/components/Spinner/Spinner.types.ts +3 -0
  338. package/src/components/Spinner/index.ts +2 -0
  339. package/src/components/Switch/Switch.stories.tsx +63 -0
  340. package/src/components/Switch/Switch.tsx +8 -0
  341. package/src/components/Switch/index.ts +1 -0
  342. package/src/components/Table/ExpandingTr/ExpandingTr.tsx +31 -0
  343. package/src/components/Table/ExpandingTr/ExpandingTr.types.ts +9 -0
  344. package/src/components/Table/ExpandingTr/index.ts +2 -0
  345. package/src/components/Table/Table.stories.tsx +326 -0
  346. package/src/components/Table/Table.styles.ts +48 -0
  347. package/src/components/Table/Table.tsx +9 -0
  348. package/src/components/Table/Table.types.ts +16 -0
  349. package/src/components/Table/TableContainer.tsx +55 -0
  350. package/src/components/Table/TableContext.tsx +187 -0
  351. package/src/components/Table/Tbody.tsx +12 -0
  352. package/src/components/Table/Td.tsx +138 -0
  353. package/src/components/Table/Th.tsx +154 -0
  354. package/src/components/Table/Thead.tsx +5 -0
  355. package/src/components/Table/Tr.tsx +5 -0
  356. package/src/components/Table/index.tsx +8 -0
  357. package/src/components/Tabs/Tab/Tab.styles.ts +35 -0
  358. package/src/components/Tabs/Tab/Tab.tsx +67 -0
  359. package/src/components/Tabs/Tab/index.ts +1 -0
  360. package/src/components/Tabs/TabList/TabList.styles.ts +11 -0
  361. package/src/components/Tabs/TabList/TabList.tsx +19 -0
  362. package/src/components/Tabs/TabList/index.ts +1 -0
  363. package/src/components/Tabs/TabPanel.tsx +5 -0
  364. package/src/components/Tabs/TabPanels.tsx +5 -0
  365. package/src/components/Tabs/Tabs.stories.tsx +45 -0
  366. package/src/components/Tabs/Tabs.tsx +65 -0
  367. package/src/components/Tabs/Tabs.types.ts +19 -0
  368. package/src/components/Tabs/TabsContext.tsx +162 -0
  369. package/src/components/Tabs/index.tsx +5 -0
  370. package/src/components/Tag/Tag.stories.tsx +28 -0
  371. package/src/components/Tag/Tag.styles.ts +12 -0
  372. package/src/components/Tag/Tag.tsx +23 -0
  373. package/src/components/Tag/Tag.types.ts +5 -0
  374. package/src/components/Tag/TagCloseButton/TagCloseButton.tsx +12 -0
  375. package/src/components/Tag/TagCloseButton/TagCloseButton.types.ts +3 -0
  376. package/src/components/Tag/TagCloseButton/index.ts +2 -0
  377. package/src/components/Tag/TagLabel/TagLabel.tsx +12 -0
  378. package/src/components/Tag/TagLabel/TagLabel.types.ts +3 -0
  379. package/src/components/Tag/TagLabel/index.ts +2 -0
  380. package/src/components/Tag/TagLeftIcon/TagLeftIcon.tsx +12 -0
  381. package/src/components/Tag/TagLeftIcon/TagLeftIcon.types.ts +3 -0
  382. package/src/components/Tag/TagLeftIcon/index.ts +2 -0
  383. package/src/components/Tag/TagRightIcon/TagRightIcon.tsx +12 -0
  384. package/src/components/Tag/TagRightIcon/TagRightIcon.types.ts +3 -0
  385. package/src/components/Tag/TagRightIcon/index.ts +2 -0
  386. package/src/components/Tag/index.ts +5 -0
  387. package/src/components/Textarea/Textarea.tsx +56 -0
  388. package/src/components/Textarea/adjustHeight.tsx +9 -0
  389. package/src/components/Textarea/index.ts +1 -0
  390. package/src/components/Toast/Toast.stories.tsx +49 -0
  391. package/src/components/Toast/Toast.styles.ts +19 -0
  392. package/src/components/Toast/Toast.tsx +38 -0
  393. package/src/components/Toast/Toast.types.ts +22 -0
  394. package/src/components/Toast/ToastIcon/ToastIcon.tsx +26 -0
  395. package/src/components/Toast/ToastIcon/index.ts +0 -0
  396. package/src/components/Toast/index.ts +2 -0
  397. package/src/components/Toast/useToast.tsx +65 -0
  398. package/src/components/Tooltip/Tooltip.stories.tsx +97 -0
  399. package/src/components/Tooltip/Tooltip.tsx +22 -0
  400. package/src/components/Tooltip/Tooltip.types.ts +3 -0
  401. package/src/components/Tooltip/index.ts +2 -0
  402. package/src/components/Typography/H1.tsx +17 -0
  403. package/src/components/Typography/H2.tsx +17 -0
  404. package/src/components/Typography/H3.tsx +17 -0
  405. package/src/components/Typography/H4.tsx +17 -0
  406. package/src/components/Typography/H5.tsx +17 -0
  407. package/src/components/Typography/Link.tsx +49 -0
  408. package/src/components/Typography/Subtext.tsx +17 -0
  409. package/src/components/Typography/Subtitle.tsx +18 -0
  410. package/src/components/Typography/Text.tsx +22 -0
  411. package/src/components/Typography/Typography.stories.tsx +54 -0
  412. package/src/components/Typography/Typography.types.ts +3 -0
  413. package/src/components/Typography/index.ts +26 -0
  414. package/src/components/UrlInput/UrlInput.stories.tsx +66 -0
  415. package/src/components/UrlInput/UrlInput.tsx +47 -0
  416. package/src/components/UrlInput/index.tsx +1 -0
  417. package/src/hooks/useLocale.ts +11 -0
  418. package/src/hooks/useTranslate.ts +57 -0
  419. package/src/index.ts +96 -0
  420. package/src/theme/Palette.stories.tsx +171 -0
  421. package/src/theme/colors.ts +64 -0
  422. package/src/theme/font.ts +23 -0
  423. package/src/theme/global.ts +30 -0
  424. package/src/theme/index.ts +49 -0
  425. package/src/translations/Defaults.translations.json +100 -0
  426. package/src/types/css-modules.d.ts +0 -0
  427. package/src/types/svg.d.ts +15 -0
  428. package/src/utils/findKeyByValue.ts +17 -0
  429. package/src/utils/formatDateByLocale.ts +36 -0
  430. package/src/utils/formatFileSize.ts +14 -0
  431. package/src/utils/formatNumber.ts +29 -0
  432. package/src/utils/formatTextForMarkdown.ts +3 -0
@@ -0,0 +1,1693 @@
1
+ import ReactMarkdown from 'react-markdown';
2
+ import { extendTheme, Card as Card$1, useTheme, Heading, useToken, Link as Link$1, Text, chakra, IconButton as IconButton$1, Tooltip as Tooltip$1, TableContainer as TableContainer$1, Tbody as Tbody$1, Th as Th$1, Code as Code$1, Flex, Button, Box, Spinner, Td as Td$1, Tr as Tr$1, Collapse, Table as Table$1, Thead as Thead$1 } from '@chakra-ui/react';
3
+ import rehypeKatex from 'rehype-katex';
4
+ import rehypeRaw from 'rehype-raw';
5
+ import remarkBreaks from 'remark-breaks';
6
+ import remarkFlexibleMarkers from 'remark-flexible-markers';
7
+ import remarkGfm from 'remark-gfm';
8
+ import remarkMath from 'remark-math';
9
+ import 'katex/dist/katex.min.css';
10
+ import { forwardRef, lazy, createContext, useCallback, useRef, useEffect, useContext, useState, Suspense, Children } from 'react';
11
+ import { Prism } from 'react-syntax-highlighter';
12
+ import { a11yDark } from 'react-syntax-highlighter/dist/esm/styles/prism';
13
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
14
+ import { motion } from 'framer-motion';
15
+ import { darken } from 'polished';
16
+ import { BiExpandAlt, BiDetail } from 'react-icons/bi';
17
+ import { BsTranslate } from 'react-icons/bs';
18
+ import { CiFileOn } from 'react-icons/ci';
19
+ import { FaUsers, FaUserPlus, FaUserCheck, FaUniversity, FaSortNumericUp, FaSortNumericDown, FaSortAlphaUp, FaSortAlphaDown, FaPlay, FaRegEyeSlash, FaRegEye, FaRegUserCircle, FaRegTrashAlt, FaRegQuestionCircle, FaPrint, FaMoneyBillWave, FaImage, FaGraduationCap, FaChartPie, FaBeer, FaArchive } from 'react-icons/fa';
20
+ import { FaUserClock, FaRotateRight, FaRegCopy, FaPersonChalkboard, FaLock, FaCode, FaCheck } from 'react-icons/fa6';
21
+ import { GiTwoCoins } from 'react-icons/gi';
22
+ import { GoArrowDownRight, GoArrowUpRight } from 'react-icons/go';
23
+ import { GrUserAdmin } from 'react-icons/gr';
24
+ import { HiX, HiRefresh, HiLightningBolt } from 'react-icons/hi';
25
+ import { IoMdSettings, IoIosShareAlt, IoIosMail, IoIosAddCircleOutline, IoIosCheckmarkCircle, IoIosAttach, IoIosArrowBack, IoMdThumbsDown, IoMdThumbsUp, IoMdSave, IoMdLink, IoIosList, IoIosArrowForward } from 'react-icons/io';
26
+ import { IoWarning, IoSearch, IoWarningOutline, IoHome, IoFilter, IoEyeOffOutline, IoEyeOutline, IoDocumentTextSharp, IoCloseOutline, IoClose, IoCodeSlash, IoChevronForward, IoChevronDownOutline, IoChatbubbleEllipses, IoCall, IoAddOutline, IoAddCircleOutline } from 'react-icons/io5';
27
+ import { LiaNewspaper } from 'react-icons/lia';
28
+ import { LuUpload, LuSendHorizontal, LuReceipt, LuMenu, LuInfo, LuGraduationCap, LuBookOpenText, LuDownload, LuExternalLink } from 'react-icons/lu';
29
+ import { MdThumbsUpDown, MdSpaceDashboard, MdPreview, MdOutlineSpaceDashboard, MdOutlinePersonPin, MdOutlineCalendarToday, MdLogout, MdFilterList, MdError, MdCardMembership, MdAnnouncement } from 'react-icons/md';
30
+ import { PiGlobeX, PiGlobe, PiExam, PiChatSlashBold } from 'react-icons/pi';
31
+ import { RxDotsHorizontal } from 'react-icons/rx';
32
+ import { SlSettings } from 'react-icons/sl';
33
+ import { TbWorldSearch, TbSum, TbMessageChatbotFilled, TbLockCog, TbLayoutNavbar, TbInfinity, TbAppWindowFilled } from 'react-icons/tb';
34
+
35
+ var __create = Object.create;
36
+ var __defProp = Object.defineProperty;
37
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
38
+ var __getOwnPropNames = Object.getOwnPropertyNames;
39
+ var __getProtoOf = Object.getPrototypeOf;
40
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
41
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
42
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
43
+ }) : x)(function(x) {
44
+ if (typeof require !== "undefined") return require.apply(this, arguments);
45
+ throw Error('Dynamic require of "' + x + '" is not supported');
46
+ });
47
+ var __commonJS = (cb, mod) => function __require2() {
48
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
49
+ };
50
+ var __copyProps = (to, from, except, desc) => {
51
+ if (from && typeof from === "object" || typeof from === "function") {
52
+ for (let key of __getOwnPropNames(from))
53
+ if (!__hasOwnProp.call(to, key) && key !== except)
54
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
55
+ }
56
+ return to;
57
+ };
58
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
59
+ // If the importer is in node compatibility mode or this is not an ESM
60
+ // file that has been converted to a CommonJS file using a Babel-
61
+ // compatible transform (i.e. "__esModule" has not been set), then set
62
+ // "default" to the CommonJS "module.exports" for node compatibility.
63
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
64
+ mod
65
+ ));
66
+
67
+ // src/utils/formatTextForMarkdown.ts
68
+ var formatForMarkdown = (text) => {
69
+ return text?.replace(/\\n/g, " \n");
70
+ };
71
+
72
+ // src/translations/Defaults.translations.json
73
+ var Defaults_translations_default = {
74
+ get_started: {
75
+ ko: "\uC2DC\uC791\uD558\uAE30",
76
+ en: "Get Started",
77
+ zh: "\u5F00\u59CB",
78
+ ja: "\u59CB\u3081\u308B",
79
+ es: "Comenzar"
80
+ },
81
+ next: {
82
+ ko: "\uB2E4\uC74C",
83
+ en: "Next",
84
+ zh: "\u4E0B\u4E00\u4E2A",
85
+ ja: "\u6B21",
86
+ es: "Siguiente"
87
+ },
88
+ copy: {
89
+ ko: "\uBCF5\uC0AC",
90
+ en: "Copy",
91
+ zh: "\u590D\u5236",
92
+ ja: "\u30B3\u30D4\u30FC",
93
+ es: "Copiar"
94
+ },
95
+ copied: {
96
+ ko: "\uBCF5\uC0AC \uC644\uB8CC",
97
+ en: "Copy completed",
98
+ zh: "\u590D\u5236\u5B8C\u6210",
99
+ ja: "\u30B3\u30D4\u30FC\u5B8C\u4E86",
100
+ es: "Copia completada"
101
+ },
102
+ see_more: {
103
+ ko: "\uB354\uBCF4\uAE30",
104
+ en: "See more",
105
+ zh: "\u67E5\u770B\u66F4\u591A",
106
+ ja: "\u3082\u3063\u3068\u898B\u308B",
107
+ es: "Ver m\xE1s"
108
+ },
109
+ previous: {
110
+ ko: "\uC774\uC804",
111
+ en: "Previous",
112
+ zh: "\u4EE5\u524D",
113
+ ja: "\u524D",
114
+ es: "Anterior"
115
+ },
116
+ go_next_page_button: {
117
+ ko: "\uB2E4\uC74C",
118
+ en: "Next",
119
+ zh: "\u4E0B\u4E00\u4E2A",
120
+ ja: "\u6B21",
121
+ es: "Siguiente"
122
+ },
123
+ pagination_range_text: {
124
+ ko: "{num_total_items}\uAC1C \uC911 {range_start} - {range_end} \uD45C\uC2DC \uC911",
125
+ en: "Displaying {range_start} - {range_end} of {num_total_items}",
126
+ zh: "\u663E\u793A\u7B2C {range_start} - {range_end} \u9879\uFF0C\u5171 {num_total_items} \u9879",
127
+ ja: "{num_total_items} \u4EF6\u4E2D {range_start} - {range_end} \u3092\u8868\u793A\u4E2D",
128
+ es: "Mostrando {range_start} - {range_end} de {num_total_items}"
129
+ },
130
+ pagination_items_per_page: {
131
+ ko: "\uD56D\uBAA9 \uC218",
132
+ en: "items per page",
133
+ zh: "\u6BCF\u9875\u9879\u76EE\u6570",
134
+ ja: "\u30DA\u30FC\u30B8\u3054\u3068\u306E\u9805\u76EE\u6570",
135
+ es: "elementos por p\xE1gina"
136
+ },
137
+ code_markdown_raw: {
138
+ ko: "\uC6D0\uBB38",
139
+ en: "Raw",
140
+ zh: "\u539F\u6587",
141
+ ja: "\u539F\u6587",
142
+ es: "Crudo"
143
+ },
144
+ code_markdown_preview: {
145
+ ko: "\uBBF8\uB9AC\uBCF4\uAE30",
146
+ en: "Preview",
147
+ zh: "\u9884\u89C8",
148
+ ja: "\u30D7\u30EC\u30D3\u30E5\u30FC",
149
+ es: "Vista previa"
150
+ },
151
+ month_range_placeholder: {
152
+ ko: "\uC6D4 \uBC94\uC704 \uC120\uD0DD",
153
+ en: "Select month range",
154
+ zh: "\u9009\u62E9\u6708\u4EFD\u8303\u56F4",
155
+ ja: "\u6708\u7BC4\u56F2\u3092\u9078\u629E",
156
+ es: "Seleccionar rango de meses"
157
+ },
158
+ clear: {
159
+ ko: "\uC9C0\uC6B0\uAE30",
160
+ en: "Clear",
161
+ zh: "\u6E05\u9664",
162
+ ja: "\u30AF\u30EA\u30A2",
163
+ es: "Borrar"
164
+ },
165
+ upload_your_file: {
166
+ ko: "\uD30C\uC77C \uC5C5\uB85C\uB4DC",
167
+ en: "Upload file",
168
+ zh: "\u6587\u4EF6\u4E0A\u4F20",
169
+ ja: "\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",
170
+ es: "Subir archivo"
171
+ }
172
+ };
173
+ var replaceVariables = (text, variables) => {
174
+ if (!variables) return formatForMarkdown(text);
175
+ const regex = /({(.*?)})/gi;
176
+ const potentialKeys = text.match(regex) ?? [];
177
+ const textParts = [];
178
+ let lastIndex = 0;
179
+ potentialKeys.forEach((potentialKey) => {
180
+ const keyIndex = text.indexOf(potentialKey);
181
+ textParts.push(text.slice(lastIndex, keyIndex));
182
+ textParts.push(text.slice(keyIndex, keyIndex + potentialKey.length));
183
+ lastIndex = keyIndex + potentialKey.length;
184
+ });
185
+ textParts.push(text.slice(lastIndex));
186
+ const parts = textParts.map(
187
+ (partText) => (
188
+ // Slice to remove { and }
189
+ variables[partText.slice(1, partText.length - 1)] ?? formatForMarkdown(partText)
190
+ )
191
+ );
192
+ return parts.every((part) => typeof part === "string") ? parts.join("") : parts;
193
+ };
194
+ var getLanguage = () => {
195
+ return "ko";
196
+ };
197
+ var useTranslate = (translations = {}) => {
198
+ const userLanguage = getLanguage();
199
+ return useCallback(
200
+ (key, variables) => {
201
+ const locale = userLanguage;
202
+ const translation = { ...Defaults_translations_default, ...translations }[key]?.[locale] ?? key;
203
+ const finalRes = replaceVariables(translation, variables);
204
+ return finalRes;
205
+ },
206
+ [userLanguage, translations]
207
+ );
208
+ };
209
+
210
+ // src/theme/colors.ts
211
+ var colors = {
212
+ primary: {
213
+ lighter: "blue.50",
214
+ light: "blue.300",
215
+ main: "blue.900",
216
+ dark: "blue.1000"
217
+ },
218
+ secondary: {
219
+ lighter: "purple.50",
220
+ light: "purple.300",
221
+ main: "purple.500",
222
+ dark: "purple.700"
223
+ },
224
+ danger: {
225
+ lighter: "red.50",
226
+ light: "#FFC9C9",
227
+ main: "red.500",
228
+ dark: "#961616"
229
+ },
230
+ success: {
231
+ lighter: "#EBFBF1",
232
+ light: "#C1F4D4",
233
+ main: "#019939",
234
+ dark: "#016626"
235
+ },
236
+ warning: {
237
+ lighter: "#FFF6E7",
238
+ light: "#FFE9BA",
239
+ main: "yellow.400",
240
+ dark: "#9D6508"
241
+ },
242
+ gray: {
243
+ 50: "#F4F5F6",
244
+ 100: "#EAECEF",
245
+ 200: "#E5E7EB",
246
+ 300: "#EBF0FB",
247
+ 400: "#D1D4DA",
248
+ 500: "#C7CAD1",
249
+ 600: "#BDC1C9",
250
+ 700: "#AEB2BC",
251
+ 800: "#9499A5",
252
+ 900: "#7F8493",
253
+ 1e3: "#6B7180",
254
+ 1100: "#595E6A",
255
+ 1200: "#474B55",
256
+ 1300: "#363840",
257
+ 1400: "#24262B",
258
+ 1500: "#121315"
259
+ },
260
+ blue: {
261
+ 100: "#FDFDFF",
262
+ 200: "#FAFBFE",
263
+ 300: "#EFF4FF",
264
+ 400: "#D6E0F7",
265
+ 500: "#94b0ec",
266
+ 600: "#3182ce",
267
+ 700: "#6c92e4",
268
+ 800: "#4272dd",
269
+ 900: "#1751D0",
270
+ 1e3: "#113B98"
271
+ },
272
+ white: "#FFFFFF",
273
+ black: "#121212"
274
+ };
275
+
276
+ // src/theme/font.ts
277
+ var inter = {
278
+ style: {
279
+ fontFamily: '"Inter", sans-serif'
280
+ }};
281
+ var noto = {
282
+ style: {
283
+ fontFamily: '"Noto Sans", sans-serif'
284
+ }};
285
+ var pretendard = {
286
+ style: {
287
+ fontFamily: '"Pretendard Variable", sans-serif'
288
+ }};
289
+
290
+ // src/theme/global.ts
291
+ var global = {
292
+ ":root": {
293
+ "--chakra-colors-chakra-body-text": "#121315",
294
+ // gray.1500 hex value
295
+ "--chakra-colors-chakra-body-bg": "#FFFFFF"
296
+ },
297
+ html: {
298
+ height: "var(--chakra-vh)",
299
+ fontSize: 14,
300
+ fontFamily: [
301
+ pretendard.style.fontFamily,
302
+ inter.style.fontFamily,
303
+ noto.style.fontFamily
304
+ ].join(","),
305
+ overflow: "auto"
306
+ },
307
+ "html, body": {
308
+ color: "gray.1500"
309
+ // Set the default body color
310
+ },
311
+ "#__next": {
312
+ height: "var(--chakra-vh)"
313
+ },
314
+ "body[data-lang='es']": {
315
+ fontFamily: inter.style.fontFamily
316
+ }
317
+ };
318
+
319
+ // src/theme/index.ts
320
+ var theme = extendTheme({
321
+ colors,
322
+ semanticTokens: {
323
+ colors: {
324
+ ...colors,
325
+ "chakra-body-text": "gray.1500",
326
+ "chakra-body-bg": "white",
327
+ "chakra-body-text-secondary": "gray.1200"
328
+ }
329
+ },
330
+ styles: {
331
+ global
332
+ },
333
+ fonts: {
334
+ body: '"Pretendard Variable", "Inter", "Noto Sans", sans-serif',
335
+ heading: '"Pretendard Variable", "Inter", "Noto Sans", sans-serif'
336
+ },
337
+ // 반응형 폰트 사이즈 - 모바일에서는 더 작은 폰트 크기, 데스크톱에서는 기존 크기 유지
338
+ fontSizes: {
339
+ // 커스텀 폰트 크기 토큰 (em 단위 사용)
340
+ // xs: { base: '0.7em', md: '0.7em' },
341
+ subtitle: { base: "0.8em", md: "0.92em" },
342
+ subtext: { base: "0.8em", md: "0.92em" },
343
+ p: { base: "0.9em", md: "1em" },
344
+ h5: { base: "1.1em", md: "1.2em" },
345
+ h4: { base: "1.25em", md: "1.44em" },
346
+ h3: { base: "1.5em", md: "1.75em" },
347
+ h2: { base: "2em", md: "2.5em" },
348
+ h1: { base: "2.4em", md: "3em" }
349
+ },
350
+ radii: {
351
+ none: "0",
352
+ sm: "6px",
353
+ md: "8px",
354
+ lg: "12px",
355
+ xl: "32px",
356
+ full: "9999px"
357
+ }
358
+ });
359
+ var theme_default = theme;
360
+
361
+ // src/components/Card/Card.styles.ts
362
+ ({
363
+ bgColor: theme_default.colors.white,
364
+ color: theme_default.colors.black,
365
+ borderColor: theme_default.colors.gray[100]
366
+ });
367
+ var clickableStyles = {
368
+ cursor: "pointer",
369
+ _hover: {
370
+ boxShadow: "lg",
371
+ [".card-image"]: {
372
+ // TODO: define in theme
373
+ transition: "0.3s all",
374
+ transform: "scale(1.05)",
375
+ backgroundSize: "105%"
376
+ }
377
+ }
378
+ };
379
+ var variantStyles = {
380
+ default: {},
381
+ gradient: {
382
+ bg: `linear-gradient(180deg, #F5F8FD 0%, #FFFFFF 100%)`,
383
+ border: `1px solid`,
384
+ borderColor: "blue.600"
385
+ }
386
+ };
387
+ var Card = forwardRef(
388
+ ({ clickable, variant = "default", ...rest }, ref) => {
389
+ return /* @__PURE__ */ jsx(
390
+ Card$1,
391
+ {
392
+ ref,
393
+ position: "relative",
394
+ bgColor: "inherit",
395
+ color: "inherit",
396
+ boxShadow: "none",
397
+ border: "1px solid",
398
+ borderColor: "gray.300",
399
+ borderRadius: "lg",
400
+ transition: "0.3s all",
401
+ p: 8,
402
+ ...clickable ? clickableStyles : {},
403
+ ...variantStyles[variant],
404
+ ...rest
405
+ }
406
+ );
407
+ }
408
+ );
409
+ Card.displayName = "Card";
410
+ var InlineCode = ({ children, ...rest }) => {
411
+ return /* @__PURE__ */ jsx(
412
+ Code$1,
413
+ {
414
+ bg: "gray.50",
415
+ color: "primary.dark",
416
+ borderRadius: "sm",
417
+ fontSize: "p",
418
+ ...rest,
419
+ children
420
+ }
421
+ );
422
+ };
423
+
424
+ // src/components/SegmentedControl/SegmentedControl.styles.ts
425
+ var OptionStyles = {
426
+ xs: {
427
+ minW: 6,
428
+ paddingInlineStart: 2,
429
+ paddingInlineEnd: 2,
430
+ h: 6
431
+ },
432
+ sm: {
433
+ minW: 10,
434
+ paddingInlineStart: 6,
435
+ paddingInlineEnd: 6,
436
+ h: 8
437
+ },
438
+ md: {
439
+ paddingInlineStart: 6,
440
+ paddingInlineEnd: 6,
441
+ minW: 10,
442
+ h: 10
443
+ },
444
+ lg: {},
445
+ xl: {}
446
+ };
447
+ var SegmentedControl = ({
448
+ options,
449
+ value,
450
+ onSelect,
451
+ borderRadius = "md",
452
+ size,
453
+ ...rest
454
+ }) => {
455
+ const [internalValue, setInternalValue] = useState(options[0].value);
456
+ const theme2 = useTheme();
457
+ const activeValue = value !== void 0 ? value : internalValue;
458
+ const activeIndex = options.findIndex(
459
+ (option) => option.value === activeValue
460
+ );
461
+ const getControlPadding = (size2 = "md") => {
462
+ const paddings = {
463
+ xs: theme2.space[1],
464
+ sm: theme2.space[1],
465
+ md: theme2.space[1],
466
+ lg: {},
467
+ xl: {}
468
+ };
469
+ return paddings[size2];
470
+ };
471
+ const handleSelect = (selectedValue) => {
472
+ if (value === void 0) {
473
+ setInternalValue(selectedValue);
474
+ }
475
+ if (onSelect) onSelect(selectedValue);
476
+ };
477
+ return /* @__PURE__ */ jsxs(
478
+ Flex,
479
+ {
480
+ position: "relative",
481
+ borderRadius,
482
+ bg: "gray.50",
483
+ ...rest,
484
+ children: [
485
+ /* @__PURE__ */ jsx(
486
+ motion.div,
487
+ {
488
+ initial: false,
489
+ animate: {
490
+ x: `calc(${100 * activeIndex}% + ${getControlPadding(size)})`
491
+ },
492
+ transition: { type: "spring", stiffness: 300, damping: 30 },
493
+ style: {
494
+ position: "absolute",
495
+ // @ts-expect-error - Chakra UI responsive values in Framer Motion styles
496
+ top: getControlPadding(size),
497
+ // @ts-expect-error - Chakra UI responsive values in Framer Motion styles
498
+ bottom: getControlPadding(size),
499
+ left: `calc(${activeIndex * 2} * ${getControlPadding(size)})`,
500
+ width: `calc(${100 / options.length}% - 2 * ${getControlPadding(size)})`,
501
+ borderRadius: theme2.radii[borderRadius],
502
+ background: theme2.colors.white,
503
+ boxShadow: theme2.shadows.md
504
+ }
505
+ }
506
+ ),
507
+ options.map((option) => /* @__PURE__ */ jsx(
508
+ Button,
509
+ {
510
+ flex: 1,
511
+ variant: "ghost",
512
+ color: activeValue === option.value ? "gray.1200" : "gray.600",
513
+ onClick: () => handleSelect(option.value),
514
+ _hover: { bg: "transparent" },
515
+ fontSize: size,
516
+ ...OptionStyles[size ?? "md"],
517
+ children: option.label
518
+ },
519
+ option.value
520
+ ))
521
+ ]
522
+ }
523
+ );
524
+ };
525
+ var H1 = forwardRef((props, ref) => {
526
+ const theme2 = useTheme();
527
+ return /* @__PURE__ */ jsx(
528
+ Heading,
529
+ {
530
+ ref,
531
+ as: "h1",
532
+ fontSize: theme2.fontSizes.h1,
533
+ fontWeight: "bold",
534
+ ...props
535
+ }
536
+ );
537
+ });
538
+ H1.displayName = "H1";
539
+ var H2 = forwardRef((props, ref) => {
540
+ const theme2 = useTheme();
541
+ return /* @__PURE__ */ jsx(
542
+ Heading,
543
+ {
544
+ ref,
545
+ as: "h2",
546
+ fontSize: theme2.fontSizes.h2,
547
+ fontWeight: "semibold",
548
+ ...props
549
+ }
550
+ );
551
+ });
552
+ H2.displayName = "H2";
553
+ var H3 = forwardRef((props, ref) => {
554
+ const theme2 = useTheme();
555
+ return /* @__PURE__ */ jsx(
556
+ Heading,
557
+ {
558
+ ref,
559
+ as: "h3",
560
+ fontSize: theme2.fontSizes.h3,
561
+ fontWeight: "semibold",
562
+ ...props
563
+ }
564
+ );
565
+ });
566
+ H3.displayName = "H3";
567
+ var H4 = forwardRef((props, ref) => {
568
+ const theme2 = useTheme();
569
+ return /* @__PURE__ */ jsx(
570
+ Heading,
571
+ {
572
+ ref,
573
+ as: "h4",
574
+ fontSize: theme2.fontSizes.h4,
575
+ fontWeight: "semibold",
576
+ ...props
577
+ }
578
+ );
579
+ });
580
+ H4.displayName = "H4";
581
+ var H5 = forwardRef((props, ref) => {
582
+ const theme2 = useTheme();
583
+ return /* @__PURE__ */ jsx(
584
+ Heading,
585
+ {
586
+ ref,
587
+ as: "h5",
588
+ fontSize: theme2.fontSizes.h5,
589
+ fontWeight: "bold",
590
+ ...props
591
+ }
592
+ );
593
+ });
594
+ H5.displayName = "H5";
595
+ var Link = forwardRef(
596
+ ({ color, variant, ...rest }, ref) => {
597
+ const theme2 = useTheme();
598
+ const defaultColor = theme2.semanticTokens.colors.primary.main;
599
+ const errorColor = theme2.semanticTokens.colors.danger.main;
600
+ const linkColor = useToken(
601
+ "colors",
602
+ variant === "error" ? errorColor : color || defaultColor
603
+ ) ?? color;
604
+ const getHoverColor = () => {
605
+ let hoverColor;
606
+ try {
607
+ hoverColor = darken(0.1, linkColor);
608
+ } catch (e) {
609
+ hoverColor = "inherit";
610
+ }
611
+ return hoverColor;
612
+ };
613
+ return /* @__PURE__ */ jsx(
614
+ Link$1,
615
+ {
616
+ ref,
617
+ fontWeight: "semibold",
618
+ color: linkColor,
619
+ _hover: {
620
+ color: getHoverColor()
621
+ },
622
+ ...rest
623
+ }
624
+ );
625
+ }
626
+ );
627
+ Link.displayName = "Link";
628
+ var Subtext = forwardRef((props, ref) => {
629
+ const theme2 = useTheme();
630
+ return /* @__PURE__ */ jsx(
631
+ Text,
632
+ {
633
+ ref,
634
+ fontSize: theme2.fontSizes.subtext,
635
+ fontWeight: "regular",
636
+ ...props
637
+ }
638
+ );
639
+ });
640
+ Subtext.displayName = "Subtext";
641
+ var Subtitle = forwardRef((props, ref) => {
642
+ const theme2 = useTheme();
643
+ return /* @__PURE__ */ jsx(
644
+ Text,
645
+ {
646
+ ref,
647
+ as: "h6",
648
+ fontSize: theme2.fontSizes.p,
649
+ fontWeight: "medium",
650
+ color: "gray.1000",
651
+ ...props
652
+ }
653
+ );
654
+ });
655
+ Subtitle.displayName = "Subtitle";
656
+ var Text3 = forwardRef(
657
+ (props, ref) => {
658
+ const theme2 = useTheme();
659
+ return /* @__PURE__ */ jsx(
660
+ Text,
661
+ {
662
+ ref,
663
+ as: "p",
664
+ fontSize: theme2.fontSizes.p,
665
+ lineHeight: "1.5",
666
+ fontWeight: "medium",
667
+ color: "gray.1200",
668
+ ...props
669
+ }
670
+ );
671
+ }
672
+ );
673
+ Text3.displayName = "Text";
674
+
675
+ // src/components/Icon/Icon.styles.ts
676
+ var iconStyles = {
677
+ color: theme_default.colors.black
678
+ };
679
+
680
+ // src/components/Icon/icons/analytics.svg
681
+ var analytics_default = "./analytics-GNSHP7X3.svg";
682
+
683
+ // src/components/Icon/icons/bulb.svg
684
+ var bulb_default = "./bulb-24SQINQB.svg";
685
+
686
+ // src/components/Icon/icons/chat.svg
687
+ var chat_default = "./chat-TLRFEUAS.svg";
688
+
689
+ // src/components/Icon/icons/edit.svg
690
+ var edit_default = "./edit-RWL72JNM.svg";
691
+
692
+ // src/components/Icon/icons/face.svg
693
+ var face_default = "./face-55KPDCH4.svg";
694
+
695
+ // src/components/Icon/icons/filled-analytics.svg
696
+ var filled_analytics_default = "./filled-analytics-RBC7KWND.svg";
697
+
698
+ // src/components/Icon/icons/filled-bulb.svg
699
+ var filled_bulb_default = "./filled-bulb-RC7E2WSM.svg";
700
+
701
+ // src/components/Icon/icons/filled-chat.svg
702
+ var filled_chat_default = "./filled-chat-A6J44Q7A.svg";
703
+
704
+ // src/components/Icon/icons/filled-edit.svg
705
+ var filled_edit_default = "./filled-edit-NKKWFSTW.svg";
706
+
707
+ // src/components/Icon/icons/filled-face.svg
708
+ var filled_face_default = "./filled-face-UML5C3LB.svg";
709
+
710
+ // src/components/Icon/icons/filled-layout.svg
711
+ var filled_layout_default = "./filled-layout-HBVCSDFO.svg";
712
+
713
+ // src/components/Icon/icons/language.svg
714
+ var language_default = "./language-VBJ24OPV.svg";
715
+
716
+ // src/components/Icon/icons/layout.svg
717
+ var layout_default = "./layout-NDDSWNNV.svg";
718
+
719
+ // src/components/Icon/icons/pending.svg
720
+ var pending_default = "./pending-NF7NSBYO.svg";
721
+
722
+ // src/components/Icon/icons/receipt.svg
723
+ var receipt_default = "./receipt-MNLQIFCO.svg";
724
+
725
+ // src/components/Icon/icons/sparkles.svg
726
+ var sparkles_default = "./sparkles-EOEGVL6G.svg";
727
+
728
+ // src/components/Icon/icons/store.svg
729
+ var store_default = "./store-3RQPBJWG.svg";
730
+
731
+ // src/components/Icon/icons/store_active.svg
732
+ var store_active_default = "./store_active-SAOAGVKC.svg";
733
+
734
+ // src/components/Icon/icons/studio.svg
735
+ var studio_default = "./studio-LYPUIEFA.svg";
736
+
737
+ // src/components/Icon/icons/studio_active.svg
738
+ var studio_active_default = "./studio_active-BC6O66OI.svg";
739
+
740
+ // src/components/Icon/icons/vertical-ellipsis.svg
741
+ var vertical_ellipsis_default = "./vertical-ellipsis-3G4WEOCW.svg";
742
+
743
+ // src/components/Icon/IconMap.ts
744
+ var REACT_ICONS_MAP = {
745
+ BiDetail,
746
+ BiExpandAlt,
747
+ BsTranslate,
748
+ CiFileOn,
749
+ FaArchive,
750
+ FaBeer,
751
+ FaChartPie,
752
+ FaCheck,
753
+ FaCode,
754
+ FaGraduationCap,
755
+ FaImage,
756
+ FaLock,
757
+ FaMoneyBillWave,
758
+ FaPersonChalkboard,
759
+ FaPrint,
760
+ FaRegQuestionCircle,
761
+ FaRegCopy,
762
+ FaRegTrashAlt,
763
+ FaRegUserCircle,
764
+ FaRegEye,
765
+ FaRegEyeSlash,
766
+ FaRotateRight,
767
+ FaPlay,
768
+ FaSortAlphaDown,
769
+ FaSortAlphaUp,
770
+ FaSortNumericDown,
771
+ FaSortNumericUp,
772
+ FaUniversity,
773
+ FaUserCheck,
774
+ FaUserClock,
775
+ FaUserPlus,
776
+ FaUsers,
777
+ GiTwoCoins,
778
+ GoArrowUpRight,
779
+ GoArrowDownRight,
780
+ IoIosArrowForward,
781
+ GrUserAdmin,
782
+ HiLightningBolt,
783
+ HiRefresh,
784
+ IoAddCircleOutline,
785
+ IoAddOutline,
786
+ IoCall,
787
+ IoChatbubbleEllipses,
788
+ IoChevronDownOutline,
789
+ IoChevronForward,
790
+ IoCodeSlash,
791
+ IoClose,
792
+ IoCloseOutline,
793
+ IoDocumentTextSharp,
794
+ IoIosList,
795
+ IoMdLink,
796
+ IoMdSave,
797
+ IoMdThumbsUp,
798
+ IoMdThumbsDown,
799
+ IoEyeOutline,
800
+ IoEyeOffOutline,
801
+ IoFilter,
802
+ IoHome,
803
+ IoIosArrowBack,
804
+ IoIosAttach,
805
+ IoIosCheckmarkCircle,
806
+ IoIosAddCircleOutline,
807
+ IoIosMail,
808
+ IoIosShareAlt,
809
+ IoMdSettings,
810
+ IoWarningOutline,
811
+ IoSearch,
812
+ IoWarning,
813
+ LuExternalLink,
814
+ LuDownload,
815
+ LiaNewspaper,
816
+ LuBookOpenText,
817
+ LuGraduationCap,
818
+ LuInfo,
819
+ LuMenu,
820
+ LuReceipt,
821
+ LuSendHorizontal,
822
+ LuUpload,
823
+ MdAnnouncement,
824
+ MdCardMembership,
825
+ MdError,
826
+ MdFilterList,
827
+ MdLogout,
828
+ MdOutlineCalendarToday,
829
+ MdOutlinePersonPin,
830
+ MdOutlineSpaceDashboard,
831
+ HiX,
832
+ MdPreview,
833
+ MdSpaceDashboard,
834
+ MdThumbsUpDown,
835
+ PiChatSlashBold,
836
+ PiExam,
837
+ PiGlobe,
838
+ PiGlobeX,
839
+ RxDotsHorizontal,
840
+ SlSettings,
841
+ TbAppWindowFilled,
842
+ TbInfinity,
843
+ TbLayoutNavbar,
844
+ TbLockCog,
845
+ TbMessageChatbotFilled,
846
+ TbSum,
847
+ TbWorldSearch
848
+ };
849
+ var CUSTOM_ICON_MAP = {
850
+ Analytics: analytics_default,
851
+ Bulb: bulb_default,
852
+ Chat: chat_default,
853
+ Edit: edit_default,
854
+ Face: face_default,
855
+ Language: language_default,
856
+ Layout: layout_default,
857
+ FilledAnalytics: filled_analytics_default,
858
+ FilledBulb: filled_bulb_default,
859
+ FilledChat: filled_chat_default,
860
+ FilledEdit: filled_edit_default,
861
+ FilledFace: filled_face_default,
862
+ FilledLayout: filled_layout_default,
863
+ Pending: pending_default,
864
+ Sparkles: sparkles_default,
865
+ Studio: studio_default,
866
+ StudioActive: studio_active_default,
867
+ Store: store_default,
868
+ StoreActive: store_active_default,
869
+ Receipt: receipt_default,
870
+ VerticalEllipsis: vertical_ellipsis_default
871
+ };
872
+ var IconTypes = Object.keys({
873
+ ...CUSTOM_ICON_MAP,
874
+ ...REACT_ICONS_MAP
875
+ }).reduce(
876
+ (prevVal, currVal) => {
877
+ prevVal[currVal] = currVal;
878
+ return prevVal;
879
+ },
880
+ {}
881
+ );
882
+ var Icon = forwardRef(
883
+ ({
884
+ icon,
885
+ color,
886
+ boxSize = "md",
887
+ // Default to 'md' size
888
+ ...rest
889
+ }, ref) => {
890
+ const sizeMapping = {
891
+ xs: "4",
892
+ sm: "5",
893
+ md: "6",
894
+ lg: "8",
895
+ xl: "10"
896
+ };
897
+ const mappedBoxSize = sizeMapping[boxSize] || boxSize;
898
+ const [resolvedBoxSize] = useToken("sizes", [
899
+ mappedBoxSize
900
+ ]);
901
+ const [resolvedColor] = useToken("colors", [color || ""]);
902
+ if (icon in REACT_ICONS_MAP) {
903
+ const IconComponent2 = chakra(REACT_ICONS_MAP[icon]);
904
+ return /* @__PURE__ */ jsx(
905
+ IconComponent2,
906
+ {
907
+ size: resolvedBoxSize,
908
+ color: resolvedColor || color,
909
+ ref,
910
+ ...rest
911
+ }
912
+ );
913
+ }
914
+ let IconComponent = CUSTOM_ICON_MAP[icon];
915
+ if (!IconComponent) {
916
+ console.warn(
917
+ `No icon component found for ${icon}. Rendering fallback icon.`
918
+ );
919
+ IconComponent = CUSTOM_ICON_MAP["VerticalEllipsis"];
920
+ }
921
+ const ChakraIcon = chakra(IconComponent);
922
+ return /* @__PURE__ */ jsx(
923
+ ChakraIcon,
924
+ {
925
+ ...iconStyles,
926
+ color: resolvedColor,
927
+ boxSize: resolvedBoxSize,
928
+ ref,
929
+ ...rest
930
+ }
931
+ );
932
+ }
933
+ );
934
+ Icon.displayName = "Icon";
935
+
936
+ // src/components/IconButton/IconButton.styles.ts
937
+ var variantStyles2 = {
938
+ primary: {
939
+ borderColor: "primary.main",
940
+ bgColor: "primary.main",
941
+ color: "white",
942
+ _hover: {
943
+ borderColor: "blue.800",
944
+ bgColor: "blue.800"
945
+ }
946
+ },
947
+ secondary: {
948
+ borderColor: "primary.light",
949
+ bgColor: "primary.light",
950
+ color: "primary.main",
951
+ _hover: {
952
+ borderColor: "blue.200",
953
+ bgColor: "blue.200"
954
+ }
955
+ },
956
+ tertiary: {
957
+ borderColor: "gray.400",
958
+ bgColor: "white",
959
+ color: "gray.1200",
960
+ _hover: {
961
+ bgColor: "gray.50"
962
+ }
963
+ },
964
+ danger: {
965
+ borderColor: "danger.main",
966
+ bgColor: "danger.main",
967
+ color: "white",
968
+ _hover: {
969
+ bgColor: "red.600"
970
+ }
971
+ },
972
+ link: {
973
+ borderColor: "transparent",
974
+ bgColor: "transparent",
975
+ borderRadius: "none",
976
+ _hover: {
977
+ bgColor: "transparent"
978
+ }
979
+ }
980
+ };
981
+ var IconButton = forwardRef(
982
+ ({ variant = "link", sx, ...rest }, ref) => {
983
+ return /* @__PURE__ */ jsx(
984
+ IconButton$1,
985
+ {
986
+ border: "1px solid",
987
+ borderRadius: "full",
988
+ background: "transparent",
989
+ ...variantStyles2[variant],
990
+ ...rest,
991
+ ref,
992
+ sx: {
993
+ ...sx,
994
+ "& svg": {
995
+ pointerEvents: "none",
996
+ ...sx?.["& svg"]
997
+ },
998
+ "& svg *": {
999
+ pointerEvents: "none",
1000
+ ...sx?.["& svg *"]
1001
+ }
1002
+ }
1003
+ }
1004
+ );
1005
+ }
1006
+ );
1007
+ IconButton.displayName = "IconButton";
1008
+ var Tooltip = forwardRef(
1009
+ ({ ...rest }, ref) => {
1010
+ const theme2 = useTheme();
1011
+ return /* @__PURE__ */ jsx(
1012
+ Tooltip$1,
1013
+ {
1014
+ bgColor: "gray.1200",
1015
+ placement: "top",
1016
+ fontSize: theme2.fontSizes.p,
1017
+ closeOnScroll: true,
1018
+ ...rest,
1019
+ ref
1020
+ }
1021
+ );
1022
+ }
1023
+ );
1024
+ Tooltip.displayName = "Tooltip";
1025
+ var CopyButton = ({
1026
+ onClick,
1027
+ ...rest
1028
+ }) => {
1029
+ const translate = useTranslate();
1030
+ const [labelText, setLabelText] = useState(
1031
+ translate("copy")
1032
+ );
1033
+ const [isTooltipOpen, setIsTooltipOpen] = useState(
1034
+ void 0
1035
+ );
1036
+ const handleClick = (e) => {
1037
+ setLabelText(translate("copied"));
1038
+ onClick?.(e);
1039
+ setIsTooltipOpen(true);
1040
+ const t = setTimeout(() => {
1041
+ setLabelText(translate("copy"));
1042
+ setIsTooltipOpen(void 0);
1043
+ clearTimeout(t);
1044
+ }, 3e3);
1045
+ };
1046
+ return /* @__PURE__ */ jsx(Tooltip, { label: labelText, isOpen: isTooltipOpen, placement: "top", children: /* @__PURE__ */ jsx(
1047
+ IconButton,
1048
+ {
1049
+ "aria-label": "Copy code",
1050
+ icon: /* @__PURE__ */ jsx(Icon, { icon: "FaRegCopy", boxSize: "sm" }),
1051
+ onClick: handleClick,
1052
+ p: 0,
1053
+ ...rest
1054
+ }
1055
+ ) });
1056
+ };
1057
+ var Markdown = lazy(
1058
+ () => import('./Markdown-RJJEQN4R.mjs').then((module) => ({ default: module.Markdown }))
1059
+ );
1060
+ var Code = ({
1061
+ children,
1062
+ language: languageProp,
1063
+ onCopy,
1064
+ style = a11yDark,
1065
+ customStyle,
1066
+ hideHeader = false,
1067
+ containerProps,
1068
+ ...rest
1069
+ }) => {
1070
+ const language = languageProp === "js" ? "javascript" : languageProp;
1071
+ const translate = useTranslate();
1072
+ const [isMarkdownPreviewMode, setIsMarkdownPreviewMode] = useState(false);
1073
+ const handleCopyClick = () => {
1074
+ onCopy?.(children);
1075
+ };
1076
+ const handleMarkdownModeChange = (selectedValue) => {
1077
+ setIsMarkdownPreviewMode(selectedValue === "preview");
1078
+ };
1079
+ const handleSyntaxHighlighterClick = (e) => {
1080
+ if (e.detail > 1 || window.getSelection()?.toString() !== "") {
1081
+ return;
1082
+ }
1083
+ try {
1084
+ const codeElement = e.currentTarget.querySelector("code");
1085
+ if (codeElement) {
1086
+ const range = document.createRange();
1087
+ range.selectNodeContents(codeElement);
1088
+ const selection = window.getSelection();
1089
+ if (selection) {
1090
+ selection.removeAllRanges();
1091
+ selection.addRange(range);
1092
+ }
1093
+ }
1094
+ } catch (error) {
1095
+ console.error("Error selecting code content:", error);
1096
+ }
1097
+ };
1098
+ return /* @__PURE__ */ jsxs(
1099
+ Card,
1100
+ {
1101
+ p: 0,
1102
+ borderRadius: "none",
1103
+ ...containerProps,
1104
+ className: ["ml-code", containerProps?.className].join(" "),
1105
+ children: [
1106
+ !hideHeader && language && /* @__PURE__ */ jsxs(
1107
+ Flex,
1108
+ {
1109
+ className: "ml-code-header",
1110
+ justify: "space-between",
1111
+ align: "center",
1112
+ px: 4,
1113
+ py: 2,
1114
+ bgColor: "white",
1115
+ borderBottom: "1px solid",
1116
+ borderColor: "primary.light",
1117
+ width: "100%",
1118
+ zIndex: 2,
1119
+ children: [
1120
+ /* @__PURE__ */ jsx(Subtext, { fontWeight: "bold", color: "gray.1200", children: /* @__PURE__ */ jsx("pre", { children: language }) }),
1121
+ /* @__PURE__ */ jsxs(Flex, { align: "center", justify: "flex-end", gap: 2, children: [
1122
+ language === "markdown" && /* @__PURE__ */ jsx(
1123
+ SegmentedControl,
1124
+ {
1125
+ size: "sm",
1126
+ options: [
1127
+ {
1128
+ label: translate("code_markdown_raw"),
1129
+ value: "raw"
1130
+ },
1131
+ {
1132
+ label: translate("code_markdown_preview"),
1133
+ value: "preview"
1134
+ }
1135
+ ],
1136
+ onSelect: handleMarkdownModeChange
1137
+ }
1138
+ ),
1139
+ onCopy && /* @__PURE__ */ jsx(CopyButton, { onClick: handleCopyClick })
1140
+ ] })
1141
+ ]
1142
+ }
1143
+ ),
1144
+ /* @__PURE__ */ jsx(Box, { overflow: "hidden", children: /* @__PURE__ */ jsx(Box, { position: "relative", overflowY: "scroll", h: "fit-content", p: 0, children: isMarkdownPreviewMode ? /* @__PURE__ */ jsx(Box, { p: 2, children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Spinner, {}), children: /* @__PURE__ */ jsx(
1145
+ Markdown,
1146
+ {
1147
+ components: {
1148
+ code: ({ className, ...rest2 }) => {
1149
+ if (!className) {
1150
+ return /* @__PURE__ */ jsx(InlineCode, { ...rest2 });
1151
+ }
1152
+ }
1153
+ },
1154
+ children
1155
+ }
1156
+ ) }) }) : (
1157
+ // @ts-expect-error - SyntaxHighlighter type issues with React 18
1158
+ /* @__PURE__ */ jsx(
1159
+ Prism,
1160
+ {
1161
+ language,
1162
+ style,
1163
+ wrapLines: true,
1164
+ wrapLongLines: true,
1165
+ ...rest,
1166
+ customStyle: {
1167
+ maxWidth: "100%",
1168
+ margin: 0,
1169
+ borderRadius: 0,
1170
+ ...customStyle
1171
+ },
1172
+ onClick: handleSyntaxHighlighterClick,
1173
+ children
1174
+ }
1175
+ )
1176
+ ) }) })
1177
+ ]
1178
+ }
1179
+ );
1180
+ };
1181
+
1182
+ // src/components/Table/Table.styles.ts
1183
+ var getStickyStyles = (isSticky, stickyDirection = "left", scrollState, stickyOffset = 0, isLastSticky = false) => {
1184
+ if (!isSticky || !scrollState) return {};
1185
+ const { isScrollStart, isScrollEnd, isScrolling } = scrollState;
1186
+ const isBothSticky = stickyDirection === "left" && isScrollEnd || stickyDirection === "right" && isScrollStart;
1187
+ const isSingleSticky = isScrolling;
1188
+ const shouldShowShadow = isLastSticky && (isSingleSticky || isBothSticky);
1189
+ return {
1190
+ position: "sticky",
1191
+ overflow: "visible",
1192
+ [stickyDirection]: `${stickyOffset}px`,
1193
+ zIndex: 2,
1194
+ backgroundColor: "white",
1195
+ ...shouldShowShadow && {
1196
+ _after: {
1197
+ content: '""',
1198
+ position: "absolute",
1199
+ top: 0,
1200
+ bottom: "-1px",
1201
+ width: "32px",
1202
+ insetInlineEnd: stickyDirection === "left" ? 0 : "100%",
1203
+ translate: stickyDirection === "left" ? "100%" : "-8",
1204
+ boxShadow: stickyDirection === "left" ? "rgba(0, 0, 0, 0.16) 8px 0px 8px -8px inset" : "rgba(0, 0, 0, 0.16) -8px 0px 8px -8px inset"
1205
+ }
1206
+ }
1207
+ };
1208
+ };
1209
+ var TableContext = createContext(null);
1210
+ var useTableContext = () => {
1211
+ const context = useContext(TableContext);
1212
+ if (!context) {
1213
+ console.error("useTableContext must be used within a TableProvider");
1214
+ }
1215
+ return context;
1216
+ };
1217
+ var TableProvider = ({ children }) => {
1218
+ const containerRef = useRef(null);
1219
+ const [scrollState, setScrollState] = useState({
1220
+ isScrollStart: true,
1221
+ isScrollEnd: false,
1222
+ isScrolling: false
1223
+ });
1224
+ const stickyColumnsRef = useRef({
1225
+ leftColumnWidths: /* @__PURE__ */ new Map(),
1226
+ rightColumnWidths: /* @__PURE__ */ new Map()
1227
+ });
1228
+ const updateScrollState = useCallback(() => {
1229
+ const container = containerRef.current;
1230
+ if (!container) return;
1231
+ const { scrollLeft, scrollWidth, clientWidth } = container;
1232
+ const isScrollStart = scrollLeft <= 1;
1233
+ const isScrollEnd = Math.abs(scrollWidth - clientWidth - scrollLeft) <= 1;
1234
+ setScrollState((prevState) => {
1235
+ if (prevState.isScrollStart !== isScrollStart || prevState.isScrollEnd !== isScrollEnd || prevState.isScrolling !== (!isScrollStart && !isScrollEnd)) {
1236
+ return {
1237
+ isScrollStart,
1238
+ isScrollEnd,
1239
+ isScrolling: !isScrollStart && !isScrollEnd
1240
+ };
1241
+ }
1242
+ return prevState;
1243
+ });
1244
+ }, []);
1245
+ const setContainerRef = useCallback(
1246
+ (node) => {
1247
+ containerRef.current = node;
1248
+ if (node) {
1249
+ updateScrollState();
1250
+ }
1251
+ },
1252
+ [updateScrollState]
1253
+ );
1254
+ const registerStickyColumn = useCallback(
1255
+ (direction, index, width) => {
1256
+ if (direction === "left") {
1257
+ stickyColumnsRef.current.leftColumnWidths.set(index, width);
1258
+ } else {
1259
+ stickyColumnsRef.current.rightColumnWidths.set(index, width);
1260
+ }
1261
+ },
1262
+ []
1263
+ );
1264
+ const getStickyOffset = useCallback(
1265
+ (direction, index) => {
1266
+ if (index === 0) return 0;
1267
+ const widthsMap = direction === "left" ? stickyColumnsRef.current.leftColumnWidths : stickyColumnsRef.current.rightColumnWidths;
1268
+ let offset = 0;
1269
+ for (let i = 0; i < index; i++) {
1270
+ offset += widthsMap.get(i) || 0;
1271
+ }
1272
+ return offset;
1273
+ },
1274
+ []
1275
+ );
1276
+ const isLastStickyColumn = useCallback(
1277
+ (direction, index) => {
1278
+ const widthsMap = direction === "left" ? stickyColumnsRef.current.leftColumnWidths : stickyColumnsRef.current.rightColumnWidths;
1279
+ let maxIndex = -1;
1280
+ for (const idx of widthsMap.keys()) {
1281
+ if (idx > maxIndex) maxIndex = idx;
1282
+ }
1283
+ return index === maxIndex;
1284
+ },
1285
+ []
1286
+ );
1287
+ useEffect(() => {
1288
+ const container = containerRef.current;
1289
+ if (!container) return;
1290
+ const handleScroll = () => updateScrollState();
1291
+ const handleResize = () => updateScrollState();
1292
+ container.addEventListener("scroll", handleScroll);
1293
+ window.addEventListener("resize", handleResize);
1294
+ updateScrollState();
1295
+ return () => {
1296
+ container.removeEventListener("scroll", handleScroll);
1297
+ window.removeEventListener("resize", handleResize);
1298
+ };
1299
+ }, [updateScrollState]);
1300
+ return /* @__PURE__ */ jsx(
1301
+ TableContext.Provider,
1302
+ {
1303
+ value: {
1304
+ ...scrollState,
1305
+ setContainerRef,
1306
+ registerStickyColumn,
1307
+ getStickyOffset,
1308
+ isLastStickyColumn
1309
+ },
1310
+ children
1311
+ }
1312
+ );
1313
+ };
1314
+ var Td = ({
1315
+ wrap,
1316
+ isSticky = false,
1317
+ stickyDirection = "left",
1318
+ stickyIndex = 0,
1319
+ _first,
1320
+ style,
1321
+ className,
1322
+ children,
1323
+ onClick,
1324
+ onMouseEnter,
1325
+ onMouseLeave,
1326
+ ...rest
1327
+ }) => {
1328
+ const cellRef = useRef(null);
1329
+ const tableContext = useTableContext();
1330
+ const grayColor = useToken("colors", "gray.300");
1331
+ const paddingToken = useToken("space", "3");
1332
+ const fontSizeToken = useToken("fontSizes", "p");
1333
+ const spacingToken = useToken("space", "4");
1334
+ if (!tableContext) {
1335
+ const htmlProps = {
1336
+ className,
1337
+ onClick,
1338
+ onMouseEnter,
1339
+ onMouseLeave
1340
+ // Add other standard HTML props as needed
1341
+ };
1342
+ return /* @__PURE__ */ jsx(
1343
+ "td",
1344
+ {
1345
+ ref: cellRef,
1346
+ style: {
1347
+ border: 0,
1348
+ borderTop: "1px solid",
1349
+ borderTopColor: grayColor,
1350
+ color: "inherit",
1351
+ fontSize: fontSizeToken,
1352
+ paddingTop: paddingToken,
1353
+ paddingBottom: paddingToken,
1354
+ overflow: "hidden",
1355
+ textOverflow: "ellipsis",
1356
+ paddingInlineStart: _first ? spacingToken : void 0,
1357
+ ...wrap ? {
1358
+ whiteSpace: "normal",
1359
+ wordWrap: "break-word",
1360
+ overflowWrap: "break-word"
1361
+ } : {},
1362
+ ...style
1363
+ },
1364
+ ...htmlProps,
1365
+ children
1366
+ }
1367
+ );
1368
+ }
1369
+ const {
1370
+ registerStickyColumn,
1371
+ getStickyOffset,
1372
+ isLastStickyColumn,
1373
+ ...scrollState
1374
+ } = tableContext;
1375
+ useEffect(() => {
1376
+ if (isSticky && cellRef.current) {
1377
+ const width = cellRef.current.getBoundingClientRect().width;
1378
+ registerStickyColumn(stickyDirection, stickyIndex, width);
1379
+ }
1380
+ }, [isSticky, registerStickyColumn, stickyDirection, stickyIndex]);
1381
+ const stickyOffset = isSticky ? getStickyOffset(stickyDirection, stickyIndex) : 0;
1382
+ const isLastSticky = isSticky && isLastStickyColumn(stickyDirection, stickyIndex);
1383
+ const stickyStyles = getStickyStyles(
1384
+ isSticky,
1385
+ stickyDirection,
1386
+ scrollState,
1387
+ stickyOffset,
1388
+ isLastSticky
1389
+ );
1390
+ return /* @__PURE__ */ jsx(
1391
+ Td$1,
1392
+ {
1393
+ border: 0,
1394
+ borderTop: "1px solid",
1395
+ borderTopColor: "gray.300",
1396
+ color: "inherit",
1397
+ fontSize: "p",
1398
+ py: 3,
1399
+ overflow: "hidden",
1400
+ textOverflow: "ellipsis",
1401
+ ref: cellRef,
1402
+ style,
1403
+ _first: {
1404
+ "&:not(:last-child)": {
1405
+ paddingInlineStart: 4
1406
+ },
1407
+ ..._first
1408
+ },
1409
+ ...wrap ? {
1410
+ whiteSpace: "normal",
1411
+ wordWrap: "break-word",
1412
+ overflowWrap: "break-word"
1413
+ } : {},
1414
+ ...stickyStyles,
1415
+ ...rest,
1416
+ children
1417
+ }
1418
+ );
1419
+ };
1420
+ Td.displayName = "Td";
1421
+ var Tr = ({ ...rest }) => {
1422
+ return /* @__PURE__ */ jsx(Tr$1, { h: 12, ...rest });
1423
+ };
1424
+ var ExpandingTr = ({
1425
+ children,
1426
+ expandedContent,
1427
+ isExpanded,
1428
+ onExpandChange,
1429
+ expandedRowProps,
1430
+ ...rest
1431
+ }) => {
1432
+ const childrenArray = Children.toArray(children);
1433
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1434
+ /* @__PURE__ */ jsx(Tr, { ...rest, children }),
1435
+ /* @__PURE__ */ jsx(Tr, { h: isExpanded ? void 0 : 0, ...expandedRowProps, children: /* @__PURE__ */ jsx(Td, { colSpan: childrenArray.length, p: 0, children: /* @__PURE__ */ jsx(Collapse, { in: isExpanded, children: expandedContent }) }) })
1436
+ ] });
1437
+ };
1438
+ var Table = ({ ...rest }) => {
1439
+ return /* @__PURE__ */ jsx(Table$1, { ...rest });
1440
+ };
1441
+ var TableContainerInner = forwardRef(
1442
+ ({ children, ...rest }, ref) => {
1443
+ const { setContainerRef } = useTableContext();
1444
+ const handleRef = useCallback(
1445
+ (node) => {
1446
+ if (typeof ref === "function") {
1447
+ ref(node);
1448
+ } else if (ref) {
1449
+ ref.current = node;
1450
+ }
1451
+ setContainerRef(node);
1452
+ },
1453
+ [ref, setContainerRef]
1454
+ );
1455
+ return /* @__PURE__ */ jsx(
1456
+ TableContainer$1,
1457
+ {
1458
+ border: "1px solid",
1459
+ borderRadius: "md",
1460
+ borderColor: "gray.300",
1461
+ ref: handleRef,
1462
+ ...rest,
1463
+ children
1464
+ }
1465
+ );
1466
+ }
1467
+ );
1468
+ TableContainerInner.displayName = "TableContainerInner";
1469
+ var TableContainer = forwardRef(
1470
+ (props, ref) => {
1471
+ return /* @__PURE__ */ jsx(TableProvider, { children: /* @__PURE__ */ jsx(TableContainerInner, { ...props, ref }) });
1472
+ }
1473
+ );
1474
+ TableContainer.displayName = "TableContainer";
1475
+ var Tbody = forwardRef(
1476
+ (props, ref) => {
1477
+ return /* @__PURE__ */ jsx(Tbody$1, { ref, color: "gray.1500", fontWeight: "medium", ...props });
1478
+ }
1479
+ );
1480
+ Tbody.displayName = "Tbody";
1481
+ var Th = forwardRef(
1482
+ ({
1483
+ isSticky = false,
1484
+ stickyDirection = "left",
1485
+ stickyIndex = 0,
1486
+ style,
1487
+ className,
1488
+ children,
1489
+ onClick,
1490
+ onMouseEnter,
1491
+ onMouseLeave,
1492
+ ...rest
1493
+ }, forwardedRef) => {
1494
+ const tableContext = useTableContext();
1495
+ const measureNodeRef = useRef(null);
1496
+ const fontSizeToken = useToken("fontSizes", "subtitle");
1497
+ const spacingToken = useToken("space", "4");
1498
+ if (!tableContext) {
1499
+ const htmlProps = {
1500
+ className,
1501
+ onClick,
1502
+ onMouseEnter,
1503
+ onMouseLeave
1504
+ // Add other standard HTML props as needed
1505
+ };
1506
+ const setRefsForRegularTh = useCallback(
1507
+ (node) => {
1508
+ measureNodeRef.current = node;
1509
+ if (typeof forwardedRef === "function") {
1510
+ forwardedRef(node);
1511
+ } else if (forwardedRef) {
1512
+ forwardedRef.current = node;
1513
+ }
1514
+ },
1515
+ [forwardedRef]
1516
+ );
1517
+ return /* @__PURE__ */ jsx(
1518
+ "th",
1519
+ {
1520
+ ref: setRefsForRegularTh,
1521
+ style: {
1522
+ color: "inherit",
1523
+ fontWeight: "inherit",
1524
+ fontSize: fontSizeToken,
1525
+ overflow: "hidden",
1526
+ textOverflow: "ellipsis",
1527
+ paddingInlineStart: spacingToken,
1528
+ ...style
1529
+ },
1530
+ ...htmlProps,
1531
+ children
1532
+ }
1533
+ );
1534
+ }
1535
+ const {
1536
+ registerStickyColumn,
1537
+ getStickyOffset,
1538
+ isLastStickyColumn,
1539
+ ...scrollState
1540
+ } = tableContext;
1541
+ useEffect(() => {
1542
+ if (isSticky && measureNodeRef.current) {
1543
+ const width = measureNodeRef.current.getBoundingClientRect().width;
1544
+ registerStickyColumn(stickyDirection, stickyIndex, width);
1545
+ }
1546
+ }, [isSticky, registerStickyColumn, stickyDirection, stickyIndex]);
1547
+ const setRefs = useCallback(
1548
+ (node) => {
1549
+ measureNodeRef.current = node;
1550
+ if (typeof forwardedRef === "function") {
1551
+ forwardedRef(node);
1552
+ } else if (forwardedRef) {
1553
+ forwardedRef.current = node;
1554
+ }
1555
+ },
1556
+ [forwardedRef]
1557
+ );
1558
+ const stickyOffset = isSticky ? getStickyOffset(stickyDirection, stickyIndex) : 0;
1559
+ const isLastSticky = isSticky && isLastStickyColumn(stickyDirection, stickyIndex);
1560
+ const stickyStyles = getStickyStyles(
1561
+ isSticky,
1562
+ stickyDirection,
1563
+ scrollState,
1564
+ stickyOffset,
1565
+ isLastSticky
1566
+ );
1567
+ return /* @__PURE__ */ jsx(
1568
+ Th$1,
1569
+ {
1570
+ color: "inherit",
1571
+ fontWeight: "inherit",
1572
+ fontSize: "subtitle",
1573
+ overflow: "hidden",
1574
+ textOverflow: "ellipsis",
1575
+ ref: setRefs,
1576
+ style,
1577
+ _first: {
1578
+ "&:not(:last-child)": {
1579
+ paddingInlineStart: 4
1580
+ }
1581
+ },
1582
+ ...stickyStyles,
1583
+ ...rest,
1584
+ children
1585
+ }
1586
+ );
1587
+ }
1588
+ );
1589
+ Th.displayName = "Th";
1590
+ var Thead = ({ ...rest }) => {
1591
+ return /* @__PURE__ */ jsx(Thead$1, { color: "gray.800", fontWeight: "medium", ...rest });
1592
+ };
1593
+
1594
+ // src/components/Markdown/Markdown.module.css
1595
+ var Markdown_default = {};
1596
+ var H1Wrapper = (props) => /* @__PURE__ */ jsx(H1, { ...props });
1597
+ var H2Wrapper = (props) => /* @__PURE__ */ jsx(H2, { ...props });
1598
+ var H3Wrapper = (props) => /* @__PURE__ */ jsx(H3, { ...props });
1599
+ var H4Wrapper = (props) => /* @__PURE__ */ jsx(H4, { ...props });
1600
+ var H5Wrapper = (props) => /* @__PURE__ */ jsx(H5, { ...props });
1601
+ var SubtitleWrapper = (props) => /* @__PURE__ */ jsx(Subtitle, { ...props });
1602
+ var TheadWrapper = (props) => /* @__PURE__ */ jsx(Thead, { ...props });
1603
+ var TbodyWrapper = (props) => /* @__PURE__ */ jsx(Tbody, { ...props });
1604
+ var TrWrapper = (props) => /* @__PURE__ */ jsx(Tr, { ...props });
1605
+ var TdWrapper = (props) => /* @__PURE__ */ jsx(Td, { ...props });
1606
+ var ThWrapper = (props) => /* @__PURE__ */ jsx(Th, { ...props });
1607
+ var baseMarkdownComponents = {
1608
+ h1: H1Wrapper,
1609
+ h2: H2Wrapper,
1610
+ h3: H3Wrapper,
1611
+ h4: H4Wrapper,
1612
+ h5: H5Wrapper,
1613
+ h6: SubtitleWrapper,
1614
+ // The key fix: instead of trying to unwrap pre/code combinations,
1615
+ // we customize just the code element to detect if it's a code block
1616
+ code: ({ inline, className, children, ...props }) => {
1617
+ if (inline || !className) {
1618
+ return /* @__PURE__ */ jsx(InlineCode, { ...props, children });
1619
+ }
1620
+ const language = className.match(/language-(.*)/)?.[1];
1621
+ return /* @__PURE__ */ jsx(
1622
+ Code,
1623
+ {
1624
+ language,
1625
+ onCopy: (textToCopy) => {
1626
+ navigator.clipboard.writeText(textToCopy).then(() => {
1627
+ console.log("Text copied to clipboard");
1628
+ }).catch((err) => {
1629
+ console.error("Could not copy text to clipboard:", err);
1630
+ });
1631
+ },
1632
+ containerProps: { mb: 4, className },
1633
+ ...props,
1634
+ children
1635
+ }
1636
+ );
1637
+ },
1638
+ // Make the pre tag a no-op that just renders children
1639
+ pre: ({ children }) => /* @__PURE__ */ jsx(Box, { children }),
1640
+ p: (props) => /* @__PURE__ */ jsx(Text3, { color: "inherit", ...props }),
1641
+ a: ({ style, ...rest }) => (
1642
+ // `children` should be inside ...rest
1643
+ /* @__PURE__ */ jsx(Link, { target: "_blank", ...rest })
1644
+ ),
1645
+ ol: ({ style, ...rest }) => /* @__PURE__ */ jsx(
1646
+ "ol",
1647
+ {
1648
+ style: { paddingInlineStart: "22px", color: "inherit", ...style },
1649
+ ...rest
1650
+ }
1651
+ ),
1652
+ ul: ({ style, ...rest }) => /* @__PURE__ */ jsx(
1653
+ "ul",
1654
+ {
1655
+ style: { paddingInlineStart: "22px", color: "inherit", ...style },
1656
+ ...rest
1657
+ }
1658
+ ),
1659
+ img: ({ style, ...rest }) => /* @__PURE__ */ jsx("img", { style: { maxWidth: "100%", ...style }, alt: "chat-image", ...rest }),
1660
+ table: (props) => /* @__PURE__ */ jsx(TableContainer, { mt: 4, children: /* @__PURE__ */ jsx(Table, { ...props }) }),
1661
+ thead: TheadWrapper,
1662
+ tbody: TbodyWrapper,
1663
+ tr: TrWrapper,
1664
+ td: TdWrapper,
1665
+ th: ThWrapper
1666
+ };
1667
+ var Markdown2 = ({
1668
+ className,
1669
+ components,
1670
+ children,
1671
+ ...rest
1672
+ }) => {
1673
+ const allComponents = { ...baseMarkdownComponents, ...components };
1674
+ return /* @__PURE__ */ jsx("div", { className: [Markdown_default.markdownStyles, className].join(" "), children: /* @__PURE__ */ jsx(
1675
+ ReactMarkdown,
1676
+ {
1677
+ remarkPlugins: [
1678
+ remarkGfm,
1679
+ remarkFlexibleMarkers,
1680
+ remarkBreaks,
1681
+ remarkMath
1682
+ ],
1683
+ rehypePlugins: [rehypeRaw, rehypeKatex],
1684
+ components: allComponents,
1685
+ ...rest,
1686
+ children: formatForMarkdown(children ?? "")
1687
+ }
1688
+ ) });
1689
+ };
1690
+
1691
+ export { Card, Code, ExpandingTr, H1, H2, H3, H4, H5, Icon, IconButton, IconTypes, InlineCode, Markdown2 as Markdown, SegmentedControl, Subtext, Subtitle, Table, TableContainer, Tbody, Td, Text3 as Text, Th, Thead, Tooltip, Tr, __commonJS, __require, __toESM, baseMarkdownComponents, theme_default, useTranslate };
1692
+ //# sourceMappingURL=chunk-WSOHBA2C.mjs.map
1693
+ //# sourceMappingURL=chunk-WSOHBA2C.mjs.map