@stack-spot/portal-components 0.0.18 → 1.0.0-dev.1770393008395

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 (533) hide show
  1. package/CHANGELOG.md +670 -0
  2. package/dist/components/AnimatedHeight.d.ts +58 -0
  3. package/dist/components/AnimatedHeight.d.ts.map +1 -0
  4. package/dist/components/AnimatedHeight.js +105 -0
  5. package/dist/components/AnimatedHeight.js.map +1 -0
  6. package/dist/components/AsyncContent.d.ts +46 -0
  7. package/dist/components/AsyncContent.d.ts.map +1 -0
  8. package/dist/components/AsyncContent.js +34 -0
  9. package/dist/components/AsyncContent.js.map +1 -0
  10. package/dist/components/BannerWarning.d.ts +11 -2
  11. package/dist/components/BannerWarning.d.ts.map +1 -1
  12. package/dist/components/BannerWarning.js +45 -3
  13. package/dist/components/BannerWarning.js.map +1 -1
  14. package/dist/components/Breadcrumb/index.d.ts +7 -9
  15. package/dist/components/Breadcrumb/index.d.ts.map +1 -1
  16. package/dist/components/Breadcrumb/index.js +7 -6
  17. package/dist/components/Breadcrumb/index.js.map +1 -1
  18. package/dist/components/Breadcrumb/styled.d.ts +1 -2
  19. package/dist/components/Breadcrumb/styled.d.ts.map +1 -1
  20. package/dist/components/Breadcrumb/styled.js +1 -0
  21. package/dist/components/Breadcrumb/styled.js.map +1 -1
  22. package/dist/components/ButtonLoading.d.ts +11 -0
  23. package/dist/components/ButtonLoading.d.ts.map +1 -0
  24. package/dist/components/ButtonLoading.js +5 -0
  25. package/dist/components/ButtonLoading.js.map +1 -0
  26. package/dist/components/ChatBot.d.ts +5 -0
  27. package/dist/components/ChatBot.d.ts.map +1 -1
  28. package/dist/components/ChatBot.js +11 -6
  29. package/dist/components/ChatBot.js.map +1 -1
  30. package/dist/components/ContentValidateFilter.d.ts +6 -0
  31. package/dist/components/ContentValidateFilter.d.ts.map +1 -0
  32. package/dist/components/ContentValidateFilter.js +8 -0
  33. package/dist/components/ContentValidateFilter.js.map +1 -0
  34. package/dist/components/FadingOverflow.d.ts +37 -0
  35. package/dist/components/FadingOverflow.d.ts.map +1 -0
  36. package/dist/components/FadingOverflow.js +228 -0
  37. package/dist/components/FadingOverflow.js.map +1 -0
  38. package/dist/components/FileTreeView/More.d.ts +23 -0
  39. package/dist/components/FileTreeView/More.d.ts.map +1 -0
  40. package/dist/components/FileTreeView/More.js +55 -0
  41. package/dist/components/FileTreeView/More.js.map +1 -0
  42. package/dist/components/FileTreeView/index.d.ts +32 -0
  43. package/dist/components/FileTreeView/index.d.ts.map +1 -0
  44. package/dist/components/FileTreeView/index.js +91 -0
  45. package/dist/components/FileTreeView/index.js.map +1 -0
  46. package/dist/components/InfiniteScroll.d.ts +11 -0
  47. package/dist/components/InfiniteScroll.d.ts.map +1 -0
  48. package/dist/components/InfiniteScroll.js +14 -0
  49. package/dist/components/InfiniteScroll.js.map +1 -0
  50. package/dist/components/InfoMaintenanceBanner.d.ts +8 -0
  51. package/dist/components/InfoMaintenanceBanner.d.ts.map +1 -0
  52. package/dist/components/InfoMaintenanceBanner.js +19 -0
  53. package/dist/components/InfoMaintenanceBanner.js.map +1 -0
  54. package/dist/components/LazyMarkdown/BlockquoteMd.d.ts +11 -0
  55. package/dist/components/LazyMarkdown/BlockquoteMd.d.ts.map +1 -0
  56. package/dist/components/LazyMarkdown/BlockquoteMd.js +77 -0
  57. package/dist/components/LazyMarkdown/BlockquoteMd.js.map +1 -0
  58. package/dist/components/LazyMarkdown/CodeViewer.d.ts +24 -0
  59. package/dist/components/LazyMarkdown/CodeViewer.d.ts.map +1 -0
  60. package/dist/components/LazyMarkdown/CodeViewer.js +122 -0
  61. package/dist/components/LazyMarkdown/CodeViewer.js.map +1 -0
  62. package/dist/components/LazyMarkdown/Markdown.d.ts +19 -0
  63. package/dist/components/LazyMarkdown/Markdown.d.ts.map +1 -0
  64. package/dist/components/LazyMarkdown/Markdown.js +96 -0
  65. package/dist/components/LazyMarkdown/Markdown.js.map +1 -0
  66. package/dist/components/LazyMarkdown/MarkdownButton.d.ts +19 -0
  67. package/dist/components/LazyMarkdown/MarkdownButton.d.ts.map +1 -0
  68. package/dist/components/LazyMarkdown/MarkdownButton.js +9 -0
  69. package/dist/components/LazyMarkdown/MarkdownButton.js.map +1 -0
  70. package/dist/components/LazyMarkdown/Video.d.ts +11 -0
  71. package/dist/components/LazyMarkdown/Video.d.ts.map +1 -0
  72. package/dist/components/LazyMarkdown/Video.js +10 -0
  73. package/dist/components/LazyMarkdown/Video.js.map +1 -0
  74. package/dist/components/LazyMarkdown/index.d.ts +10 -0
  75. package/dist/components/LazyMarkdown/index.d.ts.map +1 -0
  76. package/dist/components/LazyMarkdown/index.js +8 -0
  77. package/dist/components/LazyMarkdown/index.js.map +1 -0
  78. package/dist/components/Placeholder.d.ts +28 -0
  79. package/dist/components/Placeholder.d.ts.map +1 -0
  80. package/dist/components/Placeholder.js +32 -0
  81. package/dist/components/Placeholder.js.map +1 -0
  82. package/dist/components/ScrollView.d.ts +31 -0
  83. package/dist/components/ScrollView.d.ts.map +1 -0
  84. package/dist/components/ScrollView.js +30 -0
  85. package/dist/components/ScrollView.js.map +1 -0
  86. package/dist/components/Select/BadgeItem.d.ts +4 -0
  87. package/dist/components/Select/BadgeItem.d.ts.map +1 -0
  88. package/dist/components/Select/BadgeItem.js +28 -0
  89. package/dist/components/Select/BadgeItem.js.map +1 -0
  90. package/dist/components/Select/ClearInput.d.ts +3 -0
  91. package/dist/components/Select/ClearInput.d.ts.map +1 -0
  92. package/dist/components/Select/ClearInput.js +18 -0
  93. package/dist/components/Select/ClearInput.js.map +1 -0
  94. package/dist/components/Select/CloseItem.d.ts +3 -0
  95. package/dist/components/Select/CloseItem.d.ts.map +1 -0
  96. package/dist/components/Select/CloseItem.js +26 -0
  97. package/dist/components/Select/CloseItem.js.map +1 -0
  98. package/dist/components/Select/CreatableSelect.d.ts +16 -0
  99. package/dist/components/Select/CreatableSelect.d.ts.map +1 -0
  100. package/dist/components/Select/CreatableSelect.js +114 -0
  101. package/dist/components/Select/CreatableSelect.js.map +1 -0
  102. package/dist/components/Select/CustomMenu.d.ts +8 -0
  103. package/dist/components/Select/CustomMenu.d.ts.map +1 -0
  104. package/dist/components/Select/CustomMenu.js +4 -0
  105. package/dist/components/Select/CustomMenu.js.map +1 -0
  106. package/dist/components/Select/LabelItem.d.ts +3 -0
  107. package/dist/components/Select/LabelItem.d.ts.map +1 -0
  108. package/dist/components/Select/LabelItem.js +4 -0
  109. package/dist/components/Select/LabelItem.js.map +1 -0
  110. package/dist/components/Select/MultiValue.d.ts +3 -0
  111. package/dist/components/Select/MultiValue.d.ts.map +1 -0
  112. package/dist/components/Select/MultiValue.js +27 -0
  113. package/dist/components/Select/MultiValue.js.map +1 -0
  114. package/dist/components/Select/SelectInfiniteScroll.d.ts +14 -0
  115. package/dist/components/Select/SelectInfiniteScroll.d.ts.map +1 -0
  116. package/dist/components/Select/SelectInfiniteScroll.js +31 -0
  117. package/dist/components/Select/SelectInfiniteScroll.js.map +1 -0
  118. package/dist/components/Select/SelectSearch.d.ts +11 -0
  119. package/dist/components/Select/SelectSearch.d.ts.map +1 -0
  120. package/dist/components/Select/SelectSearch.js +156 -0
  121. package/dist/components/Select/SelectSearch.js.map +1 -0
  122. package/dist/components/Select/index.d.ts +6 -0
  123. package/dist/components/Select/index.d.ts.map +1 -0
  124. package/dist/components/Select/index.js +6 -0
  125. package/dist/components/Select/index.js.map +1 -0
  126. package/dist/components/Select/types.d.ts +7 -0
  127. package/dist/components/Select/types.d.ts.map +1 -0
  128. package/dist/components/Select/types.js +2 -0
  129. package/dist/components/Select/types.js.map +1 -0
  130. package/dist/components/SelectionList.d.ts +151 -0
  131. package/dist/components/SelectionList.d.ts.map +1 -0
  132. package/dist/components/SelectionList.js +180 -0
  133. package/dist/components/SelectionList.js.map +1 -0
  134. package/dist/components/StatusCircle.d.ts +24 -0
  135. package/dist/components/StatusCircle.d.ts.map +1 -0
  136. package/dist/components/StatusCircle.js +44 -0
  137. package/dist/components/StatusCircle.js.map +1 -0
  138. package/dist/components/Stepper/Navigation.d.ts +35 -0
  139. package/dist/components/Stepper/Navigation.d.ts.map +1 -0
  140. package/dist/components/Stepper/Navigation.js +41 -0
  141. package/dist/components/Stepper/Navigation.js.map +1 -0
  142. package/dist/components/Stepper/Step.d.ts +18 -0
  143. package/dist/components/Stepper/Step.d.ts.map +1 -0
  144. package/dist/components/Stepper/Step.js +13 -0
  145. package/dist/components/Stepper/Step.js.map +1 -0
  146. package/dist/components/Stepper/Stepper.d.ts +45 -0
  147. package/dist/components/Stepper/Stepper.d.ts.map +1 -0
  148. package/dist/components/Stepper/Stepper.js +57 -0
  149. package/dist/components/Stepper/Stepper.js.map +1 -0
  150. package/dist/components/Stepper/headers.d.ts +19 -0
  151. package/dist/components/Stepper/headers.d.ts.map +1 -0
  152. package/dist/components/Stepper/headers.js +40 -0
  153. package/dist/components/Stepper/headers.js.map +1 -0
  154. package/dist/components/Stepper/index.d.ts +4 -0
  155. package/dist/components/Stepper/index.d.ts.map +1 -0
  156. package/dist/components/Stepper/index.js +4 -0
  157. package/dist/components/Stepper/index.js.map +1 -0
  158. package/dist/components/Table/HeaderItem.d.ts +18 -0
  159. package/dist/components/Table/HeaderItem.d.ts.map +1 -0
  160. package/dist/components/Table/HeaderItem.js +14 -0
  161. package/dist/components/Table/HeaderItem.js.map +1 -0
  162. package/dist/components/Table/SettingsVerticalMenu.d.ts +14 -0
  163. package/dist/components/Table/SettingsVerticalMenu.d.ts.map +1 -0
  164. package/dist/components/Table/SettingsVerticalMenu.js +14 -0
  165. package/dist/components/Table/SettingsVerticalMenu.js.map +1 -0
  166. package/dist/components/Table/StyledLinkTable.d.ts +5 -0
  167. package/dist/components/Table/StyledLinkTable.d.ts.map +1 -0
  168. package/dist/components/Table/StyledLinkTable.js +13 -0
  169. package/dist/components/Table/StyledLinkTable.js.map +1 -0
  170. package/dist/components/Table/TableData.d.ts +37 -0
  171. package/dist/components/Table/TableData.d.ts.map +1 -0
  172. package/dist/components/Table/TableData.js +84 -0
  173. package/dist/components/Table/TableData.js.map +1 -0
  174. package/dist/components/Table/index.d.ts +3 -0
  175. package/dist/components/Table/index.d.ts.map +1 -0
  176. package/dist/components/Table/index.js +3 -0
  177. package/dist/components/Table/index.js.map +1 -0
  178. package/dist/components/TimelineSection.d.ts +24 -0
  179. package/dist/components/TimelineSection.d.ts.map +1 -0
  180. package/dist/components/TimelineSection.js +37 -0
  181. package/dist/components/TimelineSection.js.map +1 -0
  182. package/dist/components/error/ErrorFeedback.d.ts +58 -0
  183. package/dist/components/error/ErrorFeedback.d.ts.map +1 -0
  184. package/dist/components/error/ErrorFeedback.js +110 -0
  185. package/dist/components/error/ErrorFeedback.js.map +1 -0
  186. package/dist/components/error/NotFound.d.ts +4 -0
  187. package/dist/components/error/NotFound.d.ts.map +1 -0
  188. package/dist/components/error/NotFound.js +19 -0
  189. package/dist/components/error/NotFound.js.map +1 -0
  190. package/dist/components/error/UnderMaintenance.d.ts +4 -0
  191. package/dist/components/error/UnderMaintenance.d.ts.map +1 -0
  192. package/dist/components/error/UnderMaintenance.js +25 -0
  193. package/dist/components/error/UnderMaintenance.js.map +1 -0
  194. package/dist/components/error/index.d.ts +4 -0
  195. package/dist/components/error/index.d.ts.map +1 -0
  196. package/dist/components/error/index.js +4 -0
  197. package/dist/components/error/index.js.map +1 -0
  198. package/dist/components/form/Form/Form.d.ts +15 -0
  199. package/dist/components/form/Form/Form.d.ts.map +1 -0
  200. package/dist/components/form/Form/Form.js +48 -0
  201. package/dist/components/form/Form/Form.js.map +1 -0
  202. package/dist/components/form/Form/FormGroup.d.ts +37 -0
  203. package/dist/components/form/Form/FormGroup.d.ts.map +1 -0
  204. package/dist/components/form/Form/FormGroup.js +72 -0
  205. package/dist/components/form/Form/FormGroup.js.map +1 -0
  206. package/dist/components/form/Form/index.d.ts +3 -0
  207. package/dist/components/form/Form/index.d.ts.map +1 -0
  208. package/dist/components/form/Form/index.js +3 -0
  209. package/dist/components/form/Form/index.js.map +1 -0
  210. package/dist/components/form/SearchInput.d.ts +9 -0
  211. package/dist/components/form/SearchInput.d.ts.map +1 -0
  212. package/dist/components/form/SearchInput.js +27 -0
  213. package/dist/components/form/SearchInput.js.map +1 -0
  214. package/dist/components/form/Select/CustomSelect.d.ts +81 -0
  215. package/dist/components/form/Select/CustomSelect.d.ts.map +1 -0
  216. package/dist/components/form/Select/CustomSelect.js +178 -0
  217. package/dist/components/form/Select/CustomSelect.js.map +1 -0
  218. package/dist/components/form/Select/DetailedSelect.d.ts +65 -0
  219. package/dist/components/form/Select/DetailedSelect.d.ts.map +1 -0
  220. package/dist/components/form/Select/DetailedSelect.js +80 -0
  221. package/dist/components/form/Select/DetailedSelect.js.map +1 -0
  222. package/dist/components/form/Select/Select.d.ts +47 -0
  223. package/dist/components/form/Select/Select.d.ts.map +1 -0
  224. package/dist/components/form/Select/Select.js +62 -0
  225. package/dist/components/form/Select/Select.js.map +1 -0
  226. package/dist/components/form/Select/index.d.ts +5 -0
  227. package/dist/components/form/Select/index.d.ts.map +1 -0
  228. package/dist/components/form/Select/index.js +5 -0
  229. package/dist/components/form/Select/index.js.map +1 -0
  230. package/dist/components/form/Select/styled.d.ts +5 -0
  231. package/dist/components/form/Select/styled.d.ts.map +1 -0
  232. package/dist/components/form/Select/styled.js +165 -0
  233. package/dist/components/form/Select/styled.js.map +1 -0
  234. package/dist/components/form/Select/types.d.ts +103 -0
  235. package/dist/components/form/Select/types.d.ts.map +1 -0
  236. package/dist/components/form/Select/types.js +2 -0
  237. package/dist/components/form/Select/types.js.map +1 -0
  238. package/dist/components/form/Select/utils.d.ts +3 -0
  239. package/dist/components/form/Select/utils.d.ts.map +1 -0
  240. package/dist/components/form/Select/utils.js +20 -0
  241. package/dist/components/form/Select/utils.js.map +1 -0
  242. package/dist/components/notification/NotificationComponent.d.ts +31 -0
  243. package/dist/components/notification/NotificationComponent.d.ts.map +1 -0
  244. package/dist/components/notification/NotificationComponent.js +176 -0
  245. package/dist/components/notification/NotificationComponent.js.map +1 -0
  246. package/dist/components/notification/NotificationItem.d.ts +51 -0
  247. package/dist/components/notification/NotificationItem.d.ts.map +1 -0
  248. package/dist/components/notification/NotificationItem.js +165 -0
  249. package/dist/components/notification/NotificationItem.js.map +1 -0
  250. package/dist/components/notification/NotificationList.d.ts +47 -0
  251. package/dist/components/notification/NotificationList.d.ts.map +1 -0
  252. package/dist/components/notification/NotificationList.js +102 -0
  253. package/dist/components/notification/NotificationList.js.map +1 -0
  254. package/dist/components/notification/types.d.ts +60 -0
  255. package/dist/components/notification/types.d.ts.map +1 -0
  256. package/dist/components/notification/types.js +7 -0
  257. package/dist/components/notification/types.js.map +1 -0
  258. package/dist/containers/NotificationsPage.d.ts +2 -0
  259. package/dist/containers/NotificationsPage.d.ts.map +1 -0
  260. package/dist/containers/NotificationsPage.js +72 -0
  261. package/dist/containers/NotificationsPage.js.map +1 -0
  262. package/dist/context/anchor.d.ts +27 -0
  263. package/dist/context/anchor.d.ts.map +1 -0
  264. package/dist/context/anchor.js +23 -0
  265. package/dist/context/anchor.js.map +1 -0
  266. package/dist/context/loading.d.ts +27 -0
  267. package/dist/context/loading.d.ts.map +1 -0
  268. package/dist/context/loading.js +24 -0
  269. package/dist/context/loading.js.map +1 -0
  270. package/dist/context/notification/LazyNotificationList.d.ts +28 -0
  271. package/dist/context/notification/LazyNotificationList.d.ts.map +1 -0
  272. package/dist/context/notification/LazyNotificationList.js +136 -0
  273. package/dist/context/notification/LazyNotificationList.js.map +1 -0
  274. package/dist/context/notification/NotificationController.d.ts +25 -0
  275. package/dist/context/notification/NotificationController.d.ts.map +1 -0
  276. package/dist/context/notification/NotificationController.js +153 -0
  277. package/dist/context/notification/NotificationController.js.map +1 -0
  278. package/dist/context/notification/context.d.ts +8 -0
  279. package/dist/context/notification/context.d.ts.map +1 -0
  280. package/dist/context/notification/context.js +12 -0
  281. package/dist/context/notification/context.js.map +1 -0
  282. package/dist/context/notification/hooks.d.ts +18 -0
  283. package/dist/context/notification/hooks.d.ts.map +1 -0
  284. package/dist/context/notification/hooks.js +104 -0
  285. package/dist/context/notification/hooks.js.map +1 -0
  286. package/dist/context/notification/types.d.ts +65 -0
  287. package/dist/context/notification/types.d.ts.map +1 -0
  288. package/dist/context/notification/types.js +2 -0
  289. package/dist/context/notification/types.js.map +1 -0
  290. package/dist/hooks/date.d.ts +18 -0
  291. package/dist/hooks/date.d.ts.map +1 -0
  292. package/dist/hooks/date.js +68 -0
  293. package/dist/hooks/date.js.map +1 -0
  294. package/dist/hooks/keyboard.d.ts +64 -0
  295. package/dist/hooks/keyboard.d.ts.map +1 -0
  296. package/dist/hooks/keyboard.js +84 -0
  297. package/dist/hooks/keyboard.js.map +1 -0
  298. package/dist/hooks/manual-render.d.ts +8 -0
  299. package/dist/hooks/manual-render.d.ts.map +1 -0
  300. package/dist/hooks/manual-render.js +10 -0
  301. package/dist/hooks/manual-render.js.map +1 -0
  302. package/dist/hooks/service-now.d.ts +32 -1
  303. package/dist/hooks/service-now.d.ts.map +1 -1
  304. package/dist/hooks/service-now.js +58 -18
  305. package/dist/hooks/service-now.js.map +1 -1
  306. package/dist/hooks/text.d.ts +9 -0
  307. package/dist/hooks/text.d.ts.map +1 -0
  308. package/dist/hooks/text.js +24 -0
  309. package/dist/hooks/text.js.map +1 -0
  310. package/dist/hooks/title.d.ts +13 -0
  311. package/dist/hooks/title.d.ts.map +1 -1
  312. package/dist/hooks/title.js +13 -0
  313. package/dist/hooks/title.js.map +1 -1
  314. package/dist/hooks/use-effect-once.d.ts.map +1 -1
  315. package/dist/hooks/use-effect-once.js.map +1 -1
  316. package/dist/index.d.ts +14 -4
  317. package/dist/index.d.ts.map +1 -1
  318. package/dist/index.js +14 -4
  319. package/dist/index.js.map +1 -1
  320. package/dist/notifications.d.ts +11 -0
  321. package/dist/notifications.d.ts.map +1 -0
  322. package/dist/notifications.js +10 -0
  323. package/dist/notifications.js.map +1 -0
  324. package/dist/svg/AI.d.ts +8 -0
  325. package/dist/svg/AI.d.ts.map +1 -0
  326. package/dist/svg/AI.js +15 -0
  327. package/dist/svg/AI.js.map +1 -0
  328. package/dist/svg/CS.d.ts +8 -0
  329. package/dist/svg/CS.d.ts.map +1 -0
  330. package/dist/svg/CS.js +15 -0
  331. package/dist/svg/CS.js.map +1 -0
  332. package/dist/svg/EDP.d.ts +8 -0
  333. package/dist/svg/EDP.d.ts.map +1 -0
  334. package/dist/svg/EDP.js +15 -0
  335. package/dist/svg/EDP.js.map +1 -0
  336. package/dist/svg/Forbidden.d.ts +5 -0
  337. package/dist/svg/Forbidden.d.ts.map +1 -0
  338. package/dist/svg/Forbidden.js +4 -0
  339. package/dist/svg/Forbidden.js.map +1 -0
  340. package/dist/svg/GenericPlaceholder.d.ts +7 -0
  341. package/dist/svg/GenericPlaceholder.d.ts.map +1 -0
  342. package/dist/svg/GenericPlaceholder.js +4 -0
  343. package/dist/svg/GenericPlaceholder.js.map +1 -0
  344. package/dist/svg/GenericPlaceholderCentered.d.ts +7 -0
  345. package/dist/svg/GenericPlaceholderCentered.d.ts.map +1 -0
  346. package/dist/svg/GenericPlaceholderCentered.js +4 -0
  347. package/dist/svg/GenericPlaceholderCentered.js.map +1 -0
  348. package/dist/svg/HUB.d.ts +8 -0
  349. package/dist/svg/HUB.d.ts.map +1 -0
  350. package/dist/svg/HUB.js +15 -0
  351. package/dist/svg/HUB.js.map +1 -0
  352. package/dist/svg/Logo.d.ts +5 -0
  353. package/dist/svg/Logo.d.ts.map +1 -0
  354. package/dist/svg/Logo.js +8 -0
  355. package/dist/svg/Logo.js.map +1 -0
  356. package/dist/svg/MiniLogo.d.ts +8 -0
  357. package/dist/svg/MiniLogo.d.ts.map +1 -0
  358. package/dist/svg/MiniLogo.js +6 -0
  359. package/dist/svg/MiniLogo.js.map +1 -0
  360. package/dist/svg/NotFound.d.ts +5 -0
  361. package/dist/svg/NotFound.d.ts.map +1 -0
  362. package/dist/svg/NotFound.js +4 -0
  363. package/dist/svg/NotFound.js.map +1 -0
  364. package/dist/svg/ServerError.d.ts +5 -0
  365. package/dist/svg/ServerError.d.ts.map +1 -0
  366. package/dist/svg/ServerError.js +4 -0
  367. package/dist/svg/ServerError.js.map +1 -0
  368. package/dist/svg/Unauthenticated.d.ts +5 -0
  369. package/dist/svg/Unauthenticated.d.ts.map +1 -0
  370. package/dist/svg/Unauthenticated.js +4 -0
  371. package/dist/svg/Unauthenticated.js.map +1 -0
  372. package/dist/svg/index.d.ts +13 -0
  373. package/dist/svg/index.d.ts.map +1 -0
  374. package/dist/svg/index.js +14 -0
  375. package/dist/svg/index.js.map +1 -0
  376. package/dist/utils/accessibility.d.ts +75 -0
  377. package/dist/utils/accessibility.d.ts.map +1 -0
  378. package/dist/utils/accessibility.js +123 -0
  379. package/dist/utils/accessibility.js.map +1 -0
  380. package/dist/utils/cookie.d.ts +34 -0
  381. package/dist/utils/cookie.d.ts.map +1 -0
  382. package/dist/utils/cookie.js +69 -0
  383. package/dist/utils/cookie.js.map +1 -0
  384. package/dist/utils/promise.d.ts +2 -0
  385. package/dist/utils/promise.d.ts.map +1 -0
  386. package/dist/utils/promise.js +6 -0
  387. package/dist/utils/promise.js.map +1 -0
  388. package/dist/utils/read-file.d.ts +2 -0
  389. package/dist/utils/read-file.d.ts.map +1 -0
  390. package/dist/utils/read-file.js +14 -0
  391. package/dist/utils/read-file.js.map +1 -0
  392. package/package.dev.json +3 -0
  393. package/package.json +54 -14
  394. package/package.stg.json +3 -0
  395. package/readme.md +55 -13
  396. package/src/components/AnimatedHeight.tsx +174 -0
  397. package/src/components/AsyncContent.tsx +78 -0
  398. package/src/components/BannerWarning.tsx +89 -19
  399. package/src/components/Breadcrumb/index.tsx +15 -13
  400. package/src/components/Breadcrumb/styled.ts +2 -1
  401. package/src/components/ButtonLoading.tsx +29 -0
  402. package/src/components/ChatBot.tsx +12 -7
  403. package/src/components/ContentValidateFilter.tsx +15 -0
  404. package/src/components/FadingOverflow.tsx +265 -0
  405. package/src/components/FileTreeView/More.tsx +114 -0
  406. package/src/components/FileTreeView/index.tsx +186 -0
  407. package/src/components/InfiniteScroll.tsx +24 -0
  408. package/src/components/InfoMaintenanceBanner.tsx +25 -0
  409. package/src/components/LazyMarkdown/BlockquoteMd.tsx +107 -0
  410. package/src/components/LazyMarkdown/CodeViewer.tsx +161 -0
  411. package/src/components/LazyMarkdown/Markdown.tsx +122 -0
  412. package/src/components/LazyMarkdown/MarkdownButton.tsx +24 -0
  413. package/src/components/LazyMarkdown/Video.tsx +13 -0
  414. package/src/components/LazyMarkdown/index.tsx +21 -0
  415. package/src/components/Placeholder.tsx +123 -0
  416. package/src/components/ScrollView.tsx +57 -0
  417. package/src/components/Select/BadgeItem.tsx +58 -0
  418. package/src/components/Select/ClearInput.tsx +24 -0
  419. package/src/components/Select/CloseItem.tsx +38 -0
  420. package/src/components/Select/CreatableSelect.tsx +155 -0
  421. package/src/components/Select/CustomMenu.tsx +16 -0
  422. package/src/components/Select/LabelItem.tsx +8 -0
  423. package/src/components/Select/MultiValue.tsx +49 -0
  424. package/src/components/Select/SelectInfiniteScroll.tsx +82 -0
  425. package/src/components/Select/SelectSearch.tsx +195 -0
  426. package/src/components/Select/index.tsx +7 -0
  427. package/src/components/Select/types.ts +8 -0
  428. package/src/components/SelectionList.tsx +427 -0
  429. package/src/components/StatusCircle.tsx +67 -0
  430. package/src/components/Stepper/Navigation.tsx +97 -0
  431. package/src/components/Stepper/Step.tsx +30 -0
  432. package/src/components/Stepper/Stepper.tsx +113 -0
  433. package/src/components/Stepper/headers.tsx +64 -0
  434. package/src/components/Stepper/index.ts +3 -0
  435. package/src/components/Table/HeaderItem.tsx +52 -0
  436. package/src/components/Table/SettingsVerticalMenu.tsx +50 -0
  437. package/src/components/Table/StyledLinkTable.tsx +22 -0
  438. package/src/components/Table/TableData.tsx +251 -0
  439. package/src/components/Table/index.tsx +2 -0
  440. package/src/components/TimelineSection.tsx +66 -0
  441. package/src/components/error/ErrorFeedback.tsx +217 -0
  442. package/src/components/error/NotFound.tsx +24 -0
  443. package/src/components/error/UnderMaintenance.tsx +30 -0
  444. package/src/components/error/index.ts +4 -0
  445. package/src/components/form/Form/Form.tsx +101 -0
  446. package/src/components/form/Form/FormGroup.tsx +221 -0
  447. package/src/components/form/Form/index.ts +2 -0
  448. package/src/components/form/SearchInput.tsx +72 -0
  449. package/src/components/form/Select/CustomSelect.tsx +232 -0
  450. package/src/components/form/Select/DetailedSelect.tsx +85 -0
  451. package/src/components/form/Select/Select.tsx +67 -0
  452. package/src/components/form/Select/index.ts +4 -0
  453. package/src/components/form/Select/styled.ts +165 -0
  454. package/src/components/form/Select/types.ts +112 -0
  455. package/src/components/form/Select/utils.tsx +28 -0
  456. package/src/components/notification/NotificationComponent.tsx +340 -0
  457. package/src/components/notification/NotificationItem.tsx +353 -0
  458. package/src/components/notification/NotificationList.tsx +207 -0
  459. package/src/components/notification/types.ts +72 -0
  460. package/src/containers/NotificationsPage.tsx +121 -0
  461. package/src/context/anchor.tsx +37 -0
  462. package/src/context/loading.tsx +36 -0
  463. package/src/context/notification/LazyNotificationList.ts +103 -0
  464. package/src/context/notification/NotificationController.ts +119 -0
  465. package/src/context/notification/context.tsx +23 -0
  466. package/src/context/notification/hooks.ts +115 -0
  467. package/src/context/notification/types.ts +71 -0
  468. package/src/hooks/date.ts +68 -0
  469. package/src/hooks/keyboard.tsx +128 -0
  470. package/src/hooks/manual-render.tsx +10 -0
  471. package/src/hooks/service-now.tsx +64 -19
  472. package/src/hooks/text.tsx +30 -0
  473. package/src/hooks/title.tsx +13 -0
  474. package/src/index.ts +14 -6
  475. package/src/notifications.ts +11 -0
  476. package/src/svg/AI.tsx +41 -0
  477. package/src/svg/CS.tsx +48 -0
  478. package/src/svg/EDP.tsx +31 -0
  479. package/src/svg/Forbidden.tsx +22 -0
  480. package/src/svg/GenericPlaceholder.tsx +16 -0
  481. package/src/svg/GenericPlaceholderCentered.tsx +16 -0
  482. package/src/svg/HUB.tsx +48 -0
  483. package/src/svg/Logo.tsx +16 -0
  484. package/src/svg/MiniLogo.tsx +12 -0
  485. package/src/svg/NotFound.tsx +16 -0
  486. package/src/svg/ServerError.tsx +33 -0
  487. package/src/svg/Unauthenticated.tsx +16 -0
  488. package/src/svg/index.ts +14 -0
  489. package/src/utils/accessibility.ts +135 -0
  490. package/src/utils/cookie.ts +73 -0
  491. package/src/utils/promise.ts +5 -0
  492. package/src/utils/read-file.ts +16 -0
  493. package/tsconfig.json +1 -0
  494. package/dist/components/Login.d.ts +0 -26
  495. package/dist/components/Login.d.ts.map +0 -1
  496. package/dist/components/Login.js +0 -100
  497. package/dist/components/Login.js.map +0 -1
  498. package/dist/components/MiniLogo.d.ts +0 -6
  499. package/dist/components/MiniLogo.d.ts.map +0 -1
  500. package/dist/components/MiniLogo.js +0 -4
  501. package/dist/components/MiniLogo.js.map +0 -1
  502. package/dist/components/tour/StepContainer.d.ts +0 -13
  503. package/dist/components/tour/StepContainer.d.ts.map +0 -1
  504. package/dist/components/tour/StepContainer.js +0 -48
  505. package/dist/components/tour/StepContainer.js.map +0 -1
  506. package/dist/components/tour/StepNavigation.d.ts +0 -13
  507. package/dist/components/tour/StepNavigation.d.ts.map +0 -1
  508. package/dist/components/tour/StepNavigation.js +0 -20
  509. package/dist/components/tour/StepNavigation.js.map +0 -1
  510. package/dist/components/tour/StepTitle.d.ts +0 -7
  511. package/dist/components/tour/StepTitle.d.ts.map +0 -1
  512. package/dist/components/tour/StepTitle.js +0 -5
  513. package/dist/components/tour/StepTitle.js.map +0 -1
  514. package/dist/components/tour/context.d.ts +0 -17
  515. package/dist/components/tour/context.d.ts.map +0 -1
  516. package/dist/components/tour/context.js +0 -48
  517. package/dist/components/tour/context.js.map +0 -1
  518. package/dist/components/tour/index.d.ts +0 -9
  519. package/dist/components/tour/index.d.ts.map +0 -1
  520. package/dist/components/tour/index.js +0 -4
  521. package/dist/components/tour/index.js.map +0 -1
  522. package/dist/components/tour/utils.d.ts +0 -13
  523. package/dist/components/tour/utils.d.ts.map +0 -1
  524. package/dist/components/tour/utils.js +0 -43
  525. package/dist/components/tour/utils.js.map +0 -1
  526. package/src/components/Login.tsx +0 -157
  527. package/src/components/MiniLogo.tsx +0 -32
  528. package/src/components/tour/StepContainer.tsx +0 -67
  529. package/src/components/tour/StepNavigation.tsx +0 -32
  530. package/src/components/tour/StepTitle.tsx +0 -17
  531. package/src/components/tour/context.tsx +0 -56
  532. package/src/components/tour/index.ts +0 -7
  533. package/src/components/tour/utils.tsx +0 -65
@@ -0,0 +1,174 @@
1
+ import { listToClass } from '@stack-spot/portal-theme'
2
+ import { useCallback, useEffect, useLayoutEffect, useRef } from 'react'
3
+ import styled from 'styled-components'
4
+ import { useManualRender } from '../hooks/manual-render'
5
+
6
+ interface Props {
7
+ /**
8
+ * A header with fixed height.
9
+ */
10
+ header?: React.ReactElement,
11
+ /**
12
+ * The content. This may change its height whenever. When the height changes, the animation will play making a fluid transition from the
13
+ * previous height to the next.
14
+ */
15
+ children: React.ReactElement,
16
+ /**
17
+ * A footer with fixed height.
18
+ */
19
+ footer?: React.ReactElement,
20
+ /**
21
+ * Whether or not this panel is visible. Changing this value, animates the panel's height.
22
+ * @default true
23
+ */
24
+ visible?: boolean,
25
+ /**
26
+ * The duration of the animations in milliseconds.
27
+ * @default 300
28
+ */
29
+ duration?: number,
30
+ /**
31
+ * This component wraps its content in a div that changes its height from zero to the size of its content. It is not recommended to add
32
+ * styles to it, but if you need to, use this property.
33
+ */
34
+ outerStyle?: React.CSSProperties,
35
+ /**
36
+ * This component wraps its content in a div that changes its height from zero to the size of its content. It is not recommended to add
37
+ * classes to it, but if you need to, use this property.
38
+ */
39
+ outerClassName?: string,
40
+ /**
41
+ * The style to apply to the whole panel.
42
+ *
43
+ * Attention: this is not the outer-most div, use `outerStyle` if you need to style it.
44
+ */
45
+ style?: React.CSSProperties,
46
+ /**
47
+ * The class to apply to the whole panel.
48
+ *
49
+ * Attention: this is not the outer-most div, use `outerClassName` if you need to add a class to it.
50
+ */
51
+ className?: string,
52
+ }
53
+
54
+ interface Heights {
55
+ header: number,
56
+ content: number,
57
+ footer: number,
58
+ extra: number,
59
+ }
60
+
61
+ type ComponentStatus = 'initial' | 'hidden' | 'visible'
62
+
63
+ const Box = styled.div<{ $animationMs: number }>`
64
+ overflow-y: clip; // <-- do not use hidden, it's buggy in Chrome.
65
+ transition: height ease-in-out ${({ $animationMs }) => $animationMs / 1000}s;
66
+
67
+ .wrapper {
68
+ display: flex;
69
+ flex-direction: column;
70
+ }
71
+
72
+ &.initial {
73
+ opacity: 0;
74
+ pointer-events: none;
75
+ overflow: inherit;
76
+ transition: none;
77
+
78
+ &.content {
79
+ overflow: inherit;
80
+ transition: none;
81
+ }
82
+ }
83
+
84
+ .content {
85
+ overflow: hidden;
86
+ transition: height ease-in-out ${({ $animationMs }) => $animationMs / 1000}s;
87
+ }
88
+ `
89
+
90
+ function getActualContent(wrapper: HTMLElement) {
91
+ const firstChild = wrapper.firstChild
92
+ if (!firstChild || !('tagName' in firstChild)) throw new Error('AnimatedHeight could not find any content to animate')
93
+ return firstChild as HTMLElement
94
+ }
95
+
96
+ function onChangeHeight(element: HTMLElement, callback: (height: number) => void) {
97
+ const resizeObserver = new ResizeObserver((entries) => {
98
+ const entry = entries[0]
99
+ const newHeight = entry.borderBoxSize[0].blockSize
100
+ callback(newHeight)
101
+ })
102
+ resizeObserver.observe(element)
103
+ return () => resizeObserver.disconnect()
104
+ }
105
+
106
+ /**
107
+ * This is a generic component for animating the height of a panel whenever its content changes.
108
+ *
109
+ * You can provide a header and a footer with fixed height, these won't change during the animations and will always be visible.
110
+ *
111
+ * This panel can also be hidden or visible and transitions between these two state will be animated.
112
+ * @param props the React props for this component. {@link Props}.
113
+ */
114
+ export const AnimatedHeight = (
115
+ { children, footer, header, visible = true, duration = 300, className, style, outerClassName, outerStyle } : Props,
116
+ ) => {
117
+ const { repaint } = useManualRender()
118
+ const boxRef = useRef<HTMLDivElement>(null)
119
+ const wrapperRef = useRef<HTMLDivElement>(null)
120
+ const headerRef = useRef<HTMLDivElement>(null)
121
+ const contentRef = useRef<HTMLDivElement>(null)
122
+ const footerRef = useRef<HTMLDivElement>(null)
123
+ const heights = useRef<Heights>({ content: 0, footer: 0, header: 0, extra: 0 })
124
+ const status = useRef<ComponentStatus>('initial')
125
+
126
+ const updateHeight = useCallback(() => {
127
+ if (boxRef.current) {
128
+ boxRef.current.style.height = `${heights.current.content + heights.current.header + heights.current.footer + heights.current.extra}px`
129
+ }
130
+ if (contentRef.current) contentRef.current.style.height = `${heights.current.content}px`
131
+ }, [])
132
+
133
+ useLayoutEffect(() => {
134
+ let unsubscribe: (() => void) | undefined
135
+ if (headerRef.current) heights.current.header = headerRef.current.getBoundingClientRect().height
136
+ if (contentRef.current) {
137
+ heights.current.content = contentRef.current.getBoundingClientRect().height
138
+ unsubscribe = onChangeHeight(getActualContent(contentRef.current), (height) => {
139
+ heights.current.content = height
140
+ if (status.current === 'visible' && boxRef.current) updateHeight()
141
+ })
142
+ }
143
+ if (footerRef.current) heights.current.footer = footerRef.current.getBoundingClientRect().height
144
+ if (wrapperRef.current) heights.current.extra = wrapperRef.current.getBoundingClientRect().height
145
+ - heights.current.header
146
+ - heights.current.footer
147
+ - heights.current.content
148
+ status.current = visible ? 'visible' : 'hidden'
149
+ repaint()
150
+ return unsubscribe
151
+ }, [])
152
+
153
+ useEffect(() => {
154
+ if (status.current === 'initial') return
155
+ status.current = visible ? 'visible' : 'hidden'
156
+ if (visible) updateHeight()
157
+ else if (boxRef.current) boxRef.current.style.height = '0'
158
+ }, [visible])
159
+
160
+ return (
161
+ <Box
162
+ ref={boxRef}
163
+ $animationMs={duration}
164
+ className={listToClass([outerClassName, status.current === 'initial' && 'initial'])}
165
+ style={outerStyle}
166
+ >
167
+ <div ref={wrapperRef} className={listToClass(['wrapper', className])} style={style}>
168
+ {header && <div ref={headerRef}>{header}</div>}
169
+ <div ref={contentRef} className="content">{children}</div>
170
+ {footer && <div ref={footerRef}>{footer}</div>}
171
+ </div>
172
+ </Box>
173
+ )
174
+ }
@@ -0,0 +1,78 @@
1
+ import { Flex } from '@citric/core'
2
+ import { LoadingCircular } from '@citric/ui'
3
+ import { MutableRefObject, useEffect, useLayoutEffect } from 'react'
4
+
5
+ export interface ErrorProps {
6
+ /**
7
+ * The error component to be rendered in case of error. It should receive error props
8
+ */
9
+ errorComponent: React.FC<{ error: any }>,
10
+ /**
11
+ * The function to report the error.
12
+ */
13
+ reportError: (error: any) => void,
14
+ }
15
+
16
+ interface Props {
17
+ /**
18
+ * Whether or not to show the loading feedback.
19
+ */
20
+ loading: boolean,
21
+ /**
22
+ * A javascript error. Used to show error feedbacks.
23
+ */
24
+ error?: any,
25
+ /**
26
+ * If provided, this element will receive focus as soon as the content is loaded and has no errors.
27
+ * Can be either a React Ref Object or a query selector.
28
+ */
29
+ autofocus?: string | MutableRefObject<HTMLElement>,
30
+ /**
31
+ * The content to show if it's not loading or has errors.
32
+ */
33
+ children: React.ReactNode,
34
+ /**
35
+ * The error details component.
36
+ */
37
+ errorDetails: ErrorProps,
38
+ }
39
+
40
+ /**
41
+ * Renders a component that provides user feedback on async requests.
42
+ * It renders either a loading component, an error component (which is received as prop)
43
+ * or the received children props.
44
+ *
45
+ * @param options the props for rendering the component: {@link Props}.
46
+ */
47
+
48
+ export const AsyncContent = ({ loading, error, autofocus, children, errorDetails }: Props) => {
49
+ const ErrorComponent = errorDetails.errorComponent
50
+
51
+ useEffect(() => {
52
+ if (error) {
53
+ errorDetails.reportError(error)
54
+ // eslint-disable-next-line no-console
55
+ console.error(error)
56
+ }
57
+ }, [error])
58
+
59
+ useLayoutEffect(() => {
60
+ if (!loading && !error) {
61
+ typeof autofocus === 'string' ? (document.querySelector(autofocus) as HTMLElement)?.focus?.() : autofocus?.current?.focus()
62
+ }
63
+ }, [loading, error])
64
+
65
+ if (loading) {
66
+ return (
67
+ <Flex alignItems="center" justifyContent="center" flex={1} style={{ padding: '80px' }} data-test-hint="loading">
68
+ <LoadingCircular />
69
+ </Flex>
70
+ )
71
+ }
72
+
73
+ if (error) {
74
+ return <ErrorComponent error={error} />
75
+ }
76
+
77
+ return children
78
+ }
@@ -1,21 +1,91 @@
1
- import { Flex, IconBox, Text } from '@citric/core'
2
- import { ExclamationTriangle } from '@citric/icons'
1
+
2
+ import { Button, Flex, IconBox, SxProp, Text } from '@citric/core'
3
+ import { ExclamationTriangle, TimesCircleFill } from '@citric/icons'
3
4
  import { Alert } from '@citric/ui'
5
+ import { useState } from 'react'
6
+ import { getCookie, setCookie } from '../utils/cookie'
7
+
8
+ /**
9
+ * A styled and dismissible alert box for showing important warnings for the user.
10
+ *
11
+ * This renders a yellow box with an exclamation icon. The content passed as parameter is placed on the right of the icon.
12
+ * @param props an object containing the content (children) to show inside the alert box.
13
+ */
14
+ export const BannerWarning = ({ children, showCloseButton = true }:
15
+ { children: React.ReactNode, sx?: SxProp, showCloseButton?: boolean }) => {
16
+ const bannerKey = 'bannerClosed'
17
+
18
+ const [isVisible, setIsVisible] = useState(() => {
19
+ if (typeof window !== 'undefined') {
20
+ const isBannerClosed = getCookie(bannerKey) === 'true'
21
+ return !isBannerClosed
22
+ }
23
+ return false
24
+ })
25
+
26
+ const handleClose = () => {
27
+ setCookie(bannerKey, 'true')
28
+ setIsVisible(false)
29
+ }
30
+
31
+ if (!isVisible) {
32
+ return null
33
+ }
34
+
35
+ return (
36
+ <Flex sx={{ zIndex: '1', w: '12', mb: 7 }}>
37
+ <Alert
38
+ colorScheme="warning"
39
+ sx={{
40
+ position: 'relative',
41
+ px: 3,
42
+ py: 1,
43
+ alignItems: 'center',
44
+ display: 'flex',
45
+ justifyContent: 'space-between',
46
+ height: 'auto',
47
+ padding: `${showCloseButton ? '0.5rem' : '1rem'}`,
48
+ }}
49
+ >
50
+ <Flex
51
+ sx={{
52
+ alignItems: 'center',
53
+ flexWrap: 'nowrap',
54
+ }}
55
+ >
56
+ <IconBox
57
+ size="sm"
58
+ colorIcon="light.500"
59
+ >
60
+ <ExclamationTriangle />
61
+ </IconBox>
62
+ <Text
63
+ sx={{
64
+ ml: 5,
65
+ }}
66
+ appearance="body2"
67
+ colorScheme="warning.contrastText"
68
+ >
69
+ {children}
70
+ </Text>
71
+ </Flex>
4
72
 
5
- export const BannerWarning = ({ children }: { children: React.ReactNode }) => (
6
- <Flex sx={{ position: 'fixed', top: 0, zIndex: '999', w: 12, left: 0 }}>
7
- <Alert colorScheme="warning" sx={{ p: 2, w: 12, justifyContent: 'center', height: ['60px', '100px'] }}>
8
- <IconBox size="md" colorIcon="light.500" sx={{ display: ['block', 'none'] }}>
9
- <ExclamationTriangle />
10
- </IconBox>
11
- <Flex sx={{ py: [5, 3] }}>
12
- <Text sx={{ fontSize: ['16px', '14px'], whiteSpace: 'pre-line' }} colorScheme="warning.contrastText">
13
- {children}
14
- </Text>
15
- </Flex>
16
- <IconBox size="md" colorIcon="light.500" sx={{ display: ['block', 'none'] }}>
17
- <ExclamationTriangle />
18
- </IconBox>
19
- </Alert>
20
- </Flex>
21
- )
73
+ {showCloseButton && <Button
74
+ appearance={'text'}
75
+ onClick={handleClose}
76
+ sx={{
77
+ p: 0,
78
+ ml: 2,
79
+ }}
80
+ >
81
+ <IconBox
82
+ size="lg"
83
+ colorIcon="light.500"
84
+ >
85
+ <TimesCircleFill />
86
+ </IconBox>
87
+ </Button>}
88
+ </Alert>
89
+ </Flex>
90
+ )
91
+ }
@@ -2,6 +2,7 @@ import { Text } from '@citric/core'
2
2
  import { Skeleton } from '@citric/ui'
3
3
  import { last } from 'lodash'
4
4
  import { useEffect, useMemo } from 'react'
5
+ import { useAnchorTag } from '../../context/anchor'
5
6
  import { titleEffect } from '../../hooks/title'
6
7
  import { Box } from './styled'
7
8
 
@@ -20,10 +21,6 @@ interface BreadcrumbItem {
20
21
  * If this route is accessible, the link to it.
21
22
  */
22
23
  href?: string,
23
- /**
24
- * Anchor from Citron to be used
25
- */
26
- anchorTag?: AnchorComponent,
27
24
  }
28
25
 
29
26
  interface Props {
@@ -45,16 +42,20 @@ interface Props {
45
42
  */
46
43
  shouldUpdatePageTitle?: boolean,
47
44
  /**
48
- * Anchor from Citron to be used
45
+ * Key of the current page. If an item has this key, it won't be rendered as a link and will be marked as active.
49
46
  */
50
- anchorTag?: AnchorComponent,
47
+ currentPageKey?: string,
48
+ }
49
+
50
+ interface ItemProps extends Pick<Props, 'currentPageKey'> {
51
+ item: BreadcrumbItem,
51
52
  }
52
53
 
53
- const BreadcrumbItem = ({ label, href, anchorTag }: BreadcrumbItem) => {
54
+ const BreadcrumbItem = ({ item: { label, href, key }, currentPageKey }: ItemProps) => {
54
55
  const text = <Text appearance="breadcrumb">{label}</Text>
55
- const anchor: AnchorComponent = props => <a {...props} href={href}>{text}</a>
56
- const LinkAnchor = anchorTag ?? anchor
57
- return href ? <LinkAnchor href={href}>{text}</LinkAnchor> : text
56
+ const Link = useAnchorTag()
57
+ const shouldBeLink = href && currentPageKey != key
58
+ return <li>{shouldBeLink ? <Link href={href}>{text}</Link> : text}</li>
58
59
  }
59
60
 
60
61
  /**
@@ -62,9 +63,10 @@ const BreadcrumbItem = ({ label, href, anchorTag }: BreadcrumbItem) => {
62
63
  *
63
64
  * If the breadcrumb is obtained asynchronously, pass `isLoading = true` in order to show a loading feedback.
64
65
  */
65
- export const BreadcrumbList = ({ items, isLoading, shouldUpdatePageTitle, anchorTag }: Props) => {
66
- const listItems = useMemo(() => items.map(item =>
67
- <li key={item.key || item.label}><BreadcrumbItem anchorTag={anchorTag} {...item} /></li>), [items, anchorTag],
66
+ export const BreadcrumbList = ({ items, isLoading, shouldUpdatePageTitle, currentPageKey }: Props) => {
67
+ const listItems = useMemo(
68
+ () => items.map(item => <BreadcrumbItem key={item.key || item.label} item={item} currentPageKey={currentPageKey} />),
69
+ [items],
68
70
  )
69
71
  useEffect(() => {
70
72
  const title = last(items)?.label
@@ -2,7 +2,8 @@ import { getFontAppearance } from '@citric/core/dist/utils/theme'
2
2
  import { theme } from '@stack-spot/portal-theme'
3
3
  import { styled } from 'styled-components'
4
4
 
5
- export const Box = styled.nav`
5
+ // the type below should be inferred, but a bug in TS+PNPM prevents it: https://github.com/microsoft/TypeScript/issues/42873
6
+ export const Box: React.FC<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>> = styled.nav`
6
7
  margin-bottom: 24px;
7
8
 
8
9
  ul {
@@ -0,0 +1,29 @@
1
+ import { Button, Text } from '@citric/core'
2
+ import { ButtonProps } from '@citric/core/dist/Button'
3
+ import { LoadingCircular } from '@citric/ui'
4
+ import { ReactNode } from 'react'
5
+
6
+ interface Props extends ButtonProps {
7
+ isLoading?: boolean,
8
+ loadingSize?: 'sm' | 'md' | 'lg',
9
+ children: ReactNode,
10
+ onClick?: () => void,
11
+ }
12
+
13
+ export const ButtonLoading = ({ isLoading, loadingSize = 'sm', children, disabled, sx, ...props }: Props) => (
14
+ <Button
15
+ type="submit"
16
+ {...props}
17
+ disabled={isLoading || disabled}
18
+ sx={{ ...sx, position: 'relative' }}
19
+ >
20
+ <Text as="span" sx={{ visibility: isLoading ? 'hidden' : 'visible' }}>
21
+ {children}
22
+ </Text>
23
+ <LoadingCircular
24
+ colorScheme={props.colorScheme}
25
+ size={loadingSize}
26
+ sx={{ visibility: isLoading ? 'visible' : 'hidden', position: 'absolute' }}
27
+ />
28
+ </Button>
29
+ )
@@ -1,6 +1,6 @@
1
1
  import { Button, Flex, IconBox, Styles } from '@citric/core'
2
2
  import { QuestionAnswer, Times } from '@citric/icons'
3
- import { addOrRemoveServiceNowLauncher, getServiceNowLauncher } from '../hooks/service-now'
3
+ import { CHAT_BUTTON_ID, CHAT_BUTTON_WRAPPER_ID, getServiceNowLauncher, hideChatWindow, showChatWindow } from '../hooks/service-now'
4
4
 
5
5
  const styles: Styles = {
6
6
  content: {
@@ -44,24 +44,29 @@ const styles: Styles = {
44
44
  },
45
45
  }
46
46
 
47
+ /**
48
+ * A button for opening or closing the service-now chat window.
49
+ *
50
+ * This is a circular orange button with a chat icon if the chat window is closed or a close icon if the chat window is open.
51
+ */
47
52
  export const ChatBot = () => {
48
53
  const handleOpenChatBot = () => {
49
54
  const chatIframe = getServiceNowLauncher()
50
55
  if (chatIframe) {
51
- const isShow = chatIframe.classList.contains('show')
52
- if (isShow) {
53
- addOrRemoveServiceNowLauncher('remove')
56
+ const isVisible = chatIframe.classList.contains('show')
57
+ if (isVisible) {
58
+ hideChatWindow()
54
59
  } else {
55
- addOrRemoveServiceNowLauncher('add')
60
+ showChatWindow()
56
61
  }
57
62
  }
58
63
  }
59
64
 
60
65
  return (
61
- <Flex id="service-now-content" sx={styles.content}>
66
+ <Flex id={CHAT_BUTTON_WRAPPER_ID} sx={styles.content}>
62
67
  <Button
63
68
  onClick={handleOpenChatBot}
64
- id="service-now-button"
69
+ id={CHAT_BUTTON_ID}
65
70
  sx={styles.button}
66
71
  >
67
72
  <IconBox
@@ -0,0 +1,15 @@
1
+ import { PlaceholderResourceEmptySearch } from './Placeholder'
2
+
3
+ export const ContentValidateFilter = ({
4
+ searchText,
5
+ listLength,
6
+ children,
7
+ }: {
8
+ searchText?: string,
9
+ listLength: number,
10
+ children: React.ReactNode,
11
+ }) => {
12
+ if (!listLength && searchText) return <PlaceholderResourceEmptySearch />
13
+ return <>{children}</>
14
+ }
15
+