mod-arch-shared 0.1.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 (674) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +115 -0
  3. package/dist/__tests__/__mocks__/mockGenericResponse.d.ts +8 -0
  4. package/dist/__tests__/__mocks__/mockGenericResponse.d.ts.map +1 -0
  5. package/dist/__tests__/__mocks__/mockGenericResponse.js +9 -0
  6. package/dist/__tests__/__mocks__/mockGenericResponse.js.map +1 -0
  7. package/dist/__tests__/__mocks__/styleMock.d.ts +2 -0
  8. package/dist/__tests__/__mocks__/styleMock.d.ts.map +1 -0
  9. package/dist/__tests__/__mocks__/styleMock.js +3 -0
  10. package/dist/__tests__/__mocks__/styleMock.js.map +1 -0
  11. package/dist/__tests__/unit/jest.setup.d.ts +2 -0
  12. package/dist/__tests__/unit/jest.setup.d.ts.map +1 -0
  13. package/dist/__tests__/unit/jest.setup.js +57 -0
  14. package/dist/__tests__/unit/jest.setup.js.map +1 -0
  15. package/dist/__tests__/unit/testUtils/hooks.d.ts +80 -0
  16. package/dist/__tests__/unit/testUtils/hooks.d.ts.map +1 -0
  17. package/dist/__tests__/unit/testUtils/hooks.js +149 -0
  18. package/dist/__tests__/unit/testUtils/hooks.js.map +1 -0
  19. package/dist/__tests__/unit/testUtils/hooks.spec.d.ts +2 -0
  20. package/dist/__tests__/unit/testUtils/hooks.spec.d.ts.map +1 -0
  21. package/dist/__tests__/unit/testUtils/hooks.spec.js +227 -0
  22. package/dist/__tests__/unit/testUtils/hooks.spec.js.map +1 -0
  23. package/dist/api/__tests__/errorUtils.spec.d.ts +2 -0
  24. package/dist/api/__tests__/errorUtils.spec.d.ts.map +1 -0
  25. package/dist/api/__tests__/errorUtils.spec.js +60 -0
  26. package/dist/api/__tests__/errorUtils.spec.js.map +1 -0
  27. package/dist/api/apiUtils.d.ts +16 -0
  28. package/dist/api/apiUtils.d.ts.map +1 -0
  29. package/dist/api/apiUtils.js +117 -0
  30. package/dist/api/apiUtils.js.map +1 -0
  31. package/dist/api/errorUtils.d.ts +2 -0
  32. package/dist/api/errorUtils.d.ts.map +1 -0
  33. package/dist/api/errorUtils.js +24 -0
  34. package/dist/api/errorUtils.js.map +1 -0
  35. package/dist/api/index.d.ts +6 -0
  36. package/dist/api/index.d.ts.map +1 -0
  37. package/dist/api/index.js +7 -0
  38. package/dist/api/index.js.map +1 -0
  39. package/dist/api/k8s.d.ts +5 -0
  40. package/dist/api/k8s.d.ts.map +1 -0
  41. package/dist/api/k8s.js +24 -0
  42. package/dist/api/k8s.js.map +1 -0
  43. package/dist/api/types.d.ts +19 -0
  44. package/dist/api/types.d.ts.map +1 -0
  45. package/dist/api/types.js +2 -0
  46. package/dist/api/types.js.map +1 -0
  47. package/dist/api/useAPIState.d.ts +3 -0
  48. package/dist/api/useAPIState.d.ts.map +1 -0
  49. package/dist/api/useAPIState.js +23 -0
  50. package/dist/api/useAPIState.js.map +1 -0
  51. package/dist/components/ApplicationsPage.d.ts +23 -0
  52. package/dist/components/ApplicationsPage.d.ts.map +1 -0
  53. package/dist/components/ApplicationsPage.js +43 -0
  54. package/dist/components/ApplicationsPage.js.map +1 -0
  55. package/dist/components/DashboardDescriptionListGroup.d.ts +31 -0
  56. package/dist/components/DashboardDescriptionListGroup.d.ts.map +1 -0
  57. package/dist/components/DashboardDescriptionListGroup.js +26 -0
  58. package/dist/components/DashboardDescriptionListGroup.js.map +1 -0
  59. package/dist/components/DashboardDescriptionListGroup.scss +4 -0
  60. package/dist/components/DashboardEmptyTableView.d.ts +10 -0
  61. package/dist/components/DashboardEmptyTableView.d.ts.map +1 -0
  62. package/dist/components/DashboardEmptyTableView.js +13 -0
  63. package/dist/components/DashboardEmptyTableView.js.map +1 -0
  64. package/dist/components/DashboardHelpTooltip.d.ts +7 -0
  65. package/dist/components/DashboardHelpTooltip.d.ts.map +1 -0
  66. package/dist/components/DashboardHelpTooltip.js +10 -0
  67. package/dist/components/DashboardHelpTooltip.js.map +1 -0
  68. package/dist/components/DashboardModalFooter.d.ts +16 -0
  69. package/dist/components/DashboardModalFooter.d.ts.map +1 -0
  70. package/dist/components/DashboardModalFooter.js +19 -0
  71. package/dist/components/DashboardModalFooter.js.map +1 -0
  72. package/dist/components/DashboardSearchField.d.ts +29 -0
  73. package/dist/components/DashboardSearchField.d.ts.map +1 -0
  74. package/dist/components/DashboardSearchField.js +43 -0
  75. package/dist/components/DashboardSearchField.js.map +1 -0
  76. package/dist/components/EditableLabelsDescriptionListGroup.d.ts +12 -0
  77. package/dist/components/EditableLabelsDescriptionListGroup.d.ts.map +1 -0
  78. package/dist/components/EditableLabelsDescriptionListGroup.js +143 -0
  79. package/dist/components/EditableLabelsDescriptionListGroup.js.map +1 -0
  80. package/dist/components/EditableTextDescriptionListGroup.d.ts +12 -0
  81. package/dist/components/EditableTextDescriptionListGroup.d.ts.map +1 -0
  82. package/dist/components/EditableTextDescriptionListGroup.js +45 -0
  83. package/dist/components/EditableTextDescriptionListGroup.js.map +1 -0
  84. package/dist/components/EmptyStateErrorMessage.d.ts +9 -0
  85. package/dist/components/EmptyStateErrorMessage.d.ts.map +1 -0
  86. package/dist/components/EmptyStateErrorMessage.js +14 -0
  87. package/dist/components/EmptyStateErrorMessage.js.map +1 -0
  88. package/dist/components/FieldGroupHelpLabelIcon.d.ts +8 -0
  89. package/dist/components/FieldGroupHelpLabelIcon.d.ts.map +1 -0
  90. package/dist/components/FieldGroupHelpLabelIcon.js +11 -0
  91. package/dist/components/FieldGroupHelpLabelIcon.js.map +1 -0
  92. package/dist/components/FormFieldset.d.ts +9 -0
  93. package/dist/components/FormFieldset.d.ts.map +1 -0
  94. package/dist/components/FormFieldset.js +10 -0
  95. package/dist/components/FormFieldset.js.map +1 -0
  96. package/dist/components/InlineTruncatedClipboardCopy.d.ts +14 -0
  97. package/dist/components/InlineTruncatedClipboardCopy.d.ts.map +1 -0
  98. package/dist/components/InlineTruncatedClipboardCopy.js +19 -0
  99. package/dist/components/InlineTruncatedClipboardCopy.js.map +1 -0
  100. package/dist/components/InlineTruncatedClipboardCopy.scss +4 -0
  101. package/dist/components/KubeflowDocs.d.ts +10 -0
  102. package/dist/components/KubeflowDocs.d.ts.map +1 -0
  103. package/dist/components/KubeflowDocs.js +11 -0
  104. package/dist/components/KubeflowDocs.js.map +1 -0
  105. package/dist/components/MarkdownView.d.ts +12 -0
  106. package/dist/components/MarkdownView.d.ts.map +1 -0
  107. package/dist/components/MarkdownView.js +14 -0
  108. package/dist/components/MarkdownView.js.map +1 -0
  109. package/dist/components/MarkdownView.scss +88 -0
  110. package/dist/components/NavBar.d.ts +8 -0
  111. package/dist/components/NavBar.d.ts.map +1 -0
  112. package/dist/components/NavBar.js +48 -0
  113. package/dist/components/NavBar.js.map +1 -0
  114. package/dist/components/NavSidebar.d.ts +8 -0
  115. package/dist/components/NavSidebar.d.ts.map +1 -0
  116. package/dist/components/NavSidebar.js +31 -0
  117. package/dist/components/NavSidebar.js.map +1 -0
  118. package/dist/components/NotebookController.scss +113 -0
  119. package/dist/components/PopoverListContent.d.ts +10 -0
  120. package/dist/components/PopoverListContent.d.ts.map +1 -0
  121. package/dist/components/PopoverListContent.js +17 -0
  122. package/dist/components/PopoverListContent.js.map +1 -0
  123. package/dist/components/ResourceNameTooltip.d.ts +11 -0
  124. package/dist/components/ResourceNameTooltip.d.ts.map +1 -0
  125. package/dist/components/ResourceNameTooltip.js +26 -0
  126. package/dist/components/ResourceNameTooltip.js.map +1 -0
  127. package/dist/components/SimpleSelect.d.ts +37 -0
  128. package/dist/components/SimpleSelect.d.ts.map +1 -0
  129. package/dist/components/SimpleSelect.js +57 -0
  130. package/dist/components/SimpleSelect.js.map +1 -0
  131. package/dist/components/SimpleSelect.scss +9 -0
  132. package/dist/components/ToastNotification.d.ts +8 -0
  133. package/dist/components/ToastNotification.d.ts.map +1 -0
  134. package/dist/components/ToastNotification.js +32 -0
  135. package/dist/components/ToastNotification.js.map +1 -0
  136. package/dist/components/ToastNotifications.d.ts +4 -0
  137. package/dist/components/ToastNotifications.d.ts.map +1 -0
  138. package/dist/components/ToastNotifications.js +10 -0
  139. package/dist/components/ToastNotifications.js.map +1 -0
  140. package/dist/components/TruncatedText.d.ts +8 -0
  141. package/dist/components/TruncatedText.d.ts.map +1 -0
  142. package/dist/components/TruncatedText.js +27 -0
  143. package/dist/components/TruncatedText.js.map +1 -0
  144. package/dist/components/TypeaheadSelect.d.ts +53 -0
  145. package/dist/components/TypeaheadSelect.d.ts.map +1 -0
  146. package/dist/components/TypeaheadSelect.js +265 -0
  147. package/dist/components/TypeaheadSelect.js.map +1 -0
  148. package/dist/components/WhosMyAdministrator.d.ts +14 -0
  149. package/dist/components/WhosMyAdministrator.d.ts.map +1 -0
  150. package/dist/components/WhosMyAdministrator.js +12 -0
  151. package/dist/components/WhosMyAdministrator.js.map +1 -0
  152. package/dist/components/browserStorage/BrowserStorageContext.d.ts +25 -0
  153. package/dist/components/browserStorage/BrowserStorageContext.d.ts.map +1 -0
  154. package/dist/components/browserStorage/BrowserStorageContext.js +112 -0
  155. package/dist/components/browserStorage/BrowserStorageContext.js.map +1 -0
  156. package/dist/components/browserStorage/index.d.ts +2 -0
  157. package/dist/components/browserStorage/index.d.ts.map +1 -0
  158. package/dist/components/browserStorage/index.js +2 -0
  159. package/dist/components/browserStorage/index.js.map +1 -0
  160. package/dist/components/dashboard/DashboardPopupIconButton.d.ts +12 -0
  161. package/dist/components/dashboard/DashboardPopupIconButton.d.ts.map +1 -0
  162. package/dist/components/dashboard/DashboardPopupIconButton.js +12 -0
  163. package/dist/components/dashboard/DashboardPopupIconButton.js.map +1 -0
  164. package/dist/components/dashboard/index.d.ts +2 -0
  165. package/dist/components/dashboard/index.d.ts.map +1 -0
  166. package/dist/components/dashboard/index.js +2 -0
  167. package/dist/components/dashboard/index.js.map +1 -0
  168. package/dist/components/design/CollapsibleSection.d.ts +14 -0
  169. package/dist/components/design/CollapsibleSection.d.ts.map +1 -0
  170. package/dist/components/design/CollapsibleSection.js +30 -0
  171. package/dist/components/design/CollapsibleSection.js.map +1 -0
  172. package/dist/components/design/DividedGallery.d.ts +14 -0
  173. package/dist/components/design/DividedGallery.d.ts.map +1 -0
  174. package/dist/components/design/DividedGallery.js +18 -0
  175. package/dist/components/design/DividedGallery.js.map +1 -0
  176. package/dist/components/design/DividedGallery.scss +27 -0
  177. package/dist/components/design/DividedGalleryItem.d.ts +6 -0
  178. package/dist/components/design/DividedGalleryItem.d.ts.map +1 -0
  179. package/dist/components/design/DividedGalleryItem.js +10 -0
  180. package/dist/components/design/DividedGalleryItem.js.map +1 -0
  181. package/dist/components/design/HeaderIcon.d.ts +12 -0
  182. package/dist/components/design/HeaderIcon.d.ts.map +1 -0
  183. package/dist/components/design/HeaderIcon.js +20 -0
  184. package/dist/components/design/HeaderIcon.js.map +1 -0
  185. package/dist/components/design/InfoGalleryItem.d.ts +15 -0
  186. package/dist/components/design/InfoGalleryItem.d.ts.map +1 -0
  187. package/dist/components/design/InfoGalleryItem.js +30 -0
  188. package/dist/components/design/InfoGalleryItem.js.map +1 -0
  189. package/dist/components/design/ScrolledGallery.d.ts +8 -0
  190. package/dist/components/design/ScrolledGallery.d.ts.map +1 -0
  191. package/dist/components/design/ScrolledGallery.js +19 -0
  192. package/dist/components/design/ScrolledGallery.js.map +1 -0
  193. package/dist/components/design/TitleWithIcon.d.ts +11 -0
  194. package/dist/components/design/TitleWithIcon.d.ts.map +1 -0
  195. package/dist/components/design/TitleWithIcon.js +20 -0
  196. package/dist/components/design/TitleWithIcon.js.map +1 -0
  197. package/dist/components/design/TypeBorderCard.scss +141 -0
  198. package/dist/components/design/TypeBorderedCard.d.ts +13 -0
  199. package/dist/components/design/TypeBorderedCard.d.ts.map +1 -0
  200. package/dist/components/design/TypeBorderedCard.js +11 -0
  201. package/dist/components/design/TypeBorderedCard.js.map +1 -0
  202. package/dist/components/design/TypedObjectIcon.d.ts +11 -0
  203. package/dist/components/design/TypedObjectIcon.d.ts.map +1 -0
  204. package/dist/components/design/TypedObjectIcon.js +19 -0
  205. package/dist/components/design/TypedObjectIcon.js.map +1 -0
  206. package/dist/components/design/index.d.ts +11 -0
  207. package/dist/components/design/index.d.ts.map +1 -0
  208. package/dist/components/design/index.js +11 -0
  209. package/dist/components/design/index.js.map +1 -0
  210. package/dist/components/design/utils.d.ts +52 -0
  211. package/dist/components/design/utils.d.ts.map +1 -0
  212. package/dist/components/design/utils.js +336 -0
  213. package/dist/components/design/utils.js.map +1 -0
  214. package/dist/components/design/vars.scss +31 -0
  215. package/dist/components/index.d.ts +31 -0
  216. package/dist/components/index.d.ts.map +1 -0
  217. package/dist/components/index.js +33 -0
  218. package/dist/components/index.js.map +1 -0
  219. package/dist/components/notFound/NotFound.d.ts +4 -0
  220. package/dist/components/notFound/NotFound.d.ts.map +1 -0
  221. package/dist/components/notFound/NotFound.js +10 -0
  222. package/dist/components/notFound/NotFound.js.map +1 -0
  223. package/dist/components/notFound/index.d.ts +2 -0
  224. package/dist/components/notFound/index.d.ts.map +1 -0
  225. package/dist/components/notFound/index.js +2 -0
  226. package/dist/components/notFound/index.js.map +1 -0
  227. package/dist/components/pf-overrides/FormSection.d.ts +9 -0
  228. package/dist/components/pf-overrides/FormSection.d.ts.map +1 -0
  229. package/dist/components/pf-overrides/FormSection.js +13 -0
  230. package/dist/components/pf-overrides/FormSection.js.map +1 -0
  231. package/dist/components/pf-overrides/FormSection.scss +8 -0
  232. package/dist/components/pf-overrides/index.d.ts +2 -0
  233. package/dist/components/pf-overrides/index.d.ts.map +1 -0
  234. package/dist/components/pf-overrides/index.js +2 -0
  235. package/dist/components/pf-overrides/index.js.map +1 -0
  236. package/dist/components/table/CheckboxTd.d.ts +12 -0
  237. package/dist/components/table/CheckboxTd.d.ts.map +1 -0
  238. package/dist/components/table/CheckboxTd.js +14 -0
  239. package/dist/components/table/CheckboxTd.js.map +1 -0
  240. package/dist/components/table/Table.d.ts +14 -0
  241. package/dist/components/table/Table.d.ts.map +1 -0
  242. package/dist/components/table/Table.js +33 -0
  243. package/dist/components/table/Table.js.map +1 -0
  244. package/dist/components/table/TableBase.d.ts +43 -0
  245. package/dist/components/table/TableBase.d.ts.map +1 -0
  246. package/dist/components/table/TableBase.js +103 -0
  247. package/dist/components/table/TableBase.js.map +1 -0
  248. package/dist/components/table/TableRowTitleDescription.d.ts +11 -0
  249. package/dist/components/table/TableRowTitleDescription.d.ts.map +1 -0
  250. package/dist/components/table/TableRowTitleDescription.js +19 -0
  251. package/dist/components/table/TableRowTitleDescription.js.map +1 -0
  252. package/dist/components/table/__tests__/useCheckboxTable.spec.d.ts +2 -0
  253. package/dist/components/table/__tests__/useCheckboxTable.spec.d.ts.map +1 -0
  254. package/dist/components/table/__tests__/useCheckboxTable.spec.js +45 -0
  255. package/dist/components/table/__tests__/useCheckboxTable.spec.js.map +1 -0
  256. package/dist/components/table/const.d.ts +8 -0
  257. package/dist/components/table/const.d.ts.map +1 -0
  258. package/dist/components/table/const.js +19 -0
  259. package/dist/components/table/const.js.map +1 -0
  260. package/dist/components/table/index.d.ts +11 -0
  261. package/dist/components/table/index.d.ts.map +1 -0
  262. package/dist/components/table/index.js +10 -0
  263. package/dist/components/table/index.js.map +1 -0
  264. package/dist/components/table/types.d.ts +17 -0
  265. package/dist/components/table/types.d.ts.map +1 -0
  266. package/dist/components/table/types.js +2 -0
  267. package/dist/components/table/types.js.map +1 -0
  268. package/dist/components/table/useCheckboxTable.d.ts +12 -0
  269. package/dist/components/table/useCheckboxTable.d.ts.map +1 -0
  270. package/dist/components/table/useCheckboxTable.js +9 -0
  271. package/dist/components/table/useCheckboxTable.js.map +1 -0
  272. package/dist/components/table/useCheckboxTableBase.d.ts +19 -0
  273. package/dist/components/table/useCheckboxTableBase.d.ts.map +1 -0
  274. package/dist/components/table/useCheckboxTableBase.js +76 -0
  275. package/dist/components/table/useCheckboxTableBase.js.map +1 -0
  276. package/dist/components/table/useTableColumnSort.d.ts +26 -0
  277. package/dist/components/table/useTableColumnSort.d.ts.map +1 -0
  278. package/dist/components/table/useTableColumnSort.js +83 -0
  279. package/dist/components/table/useTableColumnSort.js.map +1 -0
  280. package/dist/config/stylePaths.d.ts +2 -0
  281. package/dist/config/stylePaths.d.ts.map +1 -0
  282. package/dist/config/stylePaths.js +17 -0
  283. package/dist/config/stylePaths.js.map +1 -0
  284. package/dist/config/transform.file.d.ts +2 -0
  285. package/dist/config/transform.file.d.ts.map +1 -0
  286. package/dist/config/transform.file.js +9 -0
  287. package/dist/config/transform.file.js.map +1 -0
  288. package/dist/config/transform.style.d.ts +2 -0
  289. package/dist/config/transform.style.d.ts.map +1 -0
  290. package/dist/config/transform.style.js +3 -0
  291. package/dist/config/transform.style.js.map +1 -0
  292. package/dist/context/DashboardScriptLoader.d.ts +7 -0
  293. package/dist/context/DashboardScriptLoader.d.ts.map +1 -0
  294. package/dist/context/DashboardScriptLoader.js +38 -0
  295. package/dist/context/DashboardScriptLoader.js.map +1 -0
  296. package/dist/context/NamespaceSelectorContext.d.ts +22 -0
  297. package/dist/context/NamespaceSelectorContext.d.ts.map +1 -0
  298. package/dist/context/NamespaceSelectorContext.js +58 -0
  299. package/dist/context/NamespaceSelectorContext.js.map +1 -0
  300. package/dist/context/NotificationContext.d.ts +15 -0
  301. package/dist/context/NotificationContext.d.ts.map +1 -0
  302. package/dist/context/NotificationContext.js +44 -0
  303. package/dist/context/NotificationContext.js.map +1 -0
  304. package/dist/context/ThemeContext.d.ts +14 -0
  305. package/dist/context/ThemeContext.d.ts.map +1 -0
  306. package/dist/context/ThemeContext.js +24 -0
  307. package/dist/context/ThemeContext.js.map +1 -0
  308. package/dist/context/__tests__/NamespaceSelectorContext.test.d.ts +2 -0
  309. package/dist/context/__tests__/NamespaceSelectorContext.test.d.ts.map +1 -0
  310. package/dist/context/__tests__/NamespaceSelectorContext.test.js +147 -0
  311. package/dist/context/__tests__/NamespaceSelectorContext.test.js.map +1 -0
  312. package/dist/context/index.d.ts +5 -0
  313. package/dist/context/index.d.ts.map +1 -0
  314. package/dist/context/index.js +6 -0
  315. package/dist/context/index.js.map +1 -0
  316. package/dist/hooks/index.d.ts +6 -0
  317. package/dist/hooks/index.d.ts.map +1 -0
  318. package/dist/hooks/index.js +7 -0
  319. package/dist/hooks/index.js.map +1 -0
  320. package/dist/hooks/useNamespaces.d.ts +5 -0
  321. package/dist/hooks/useNamespaces.d.ts.map +1 -0
  322. package/dist/hooks/useNamespaces.js +19 -0
  323. package/dist/hooks/useNamespaces.js.map +1 -0
  324. package/dist/hooks/useNotification.d.ts +18 -0
  325. package/dist/hooks/useNotification.d.ts.map +1 -0
  326. package/dist/hooks/useNotification.js +75 -0
  327. package/dist/hooks/useNotification.js.map +1 -0
  328. package/dist/hooks/useQueryParamNamespaces.d.ts +2 -0
  329. package/dist/hooks/useQueryParamNamespaces.d.ts.map +1 -0
  330. package/dist/hooks/useQueryParamNamespaces.js +9 -0
  331. package/dist/hooks/useQueryParamNamespaces.js.map +1 -0
  332. package/dist/hooks/useSettings.d.ts +9 -0
  333. package/dist/hooks/useSettings.d.ts.map +1 -0
  334. package/dist/hooks/useSettings.js +74 -0
  335. package/dist/hooks/useSettings.js.map +1 -0
  336. package/dist/hooks/useTimeBasedRefresh.d.ts +4 -0
  337. package/dist/hooks/useTimeBasedRefresh.d.ts.map +1 -0
  338. package/dist/hooks/useTimeBasedRefresh.js +33 -0
  339. package/dist/hooks/useTimeBasedRefresh.js.map +1 -0
  340. package/dist/images/Icon-Layered_A_Black-RGB.svg +66 -0
  341. package/dist/images/Icon-Storage-A-Black-RGB.svg +3 -0
  342. package/dist/images/Icon-Sys_admin-A-Black-RGB.svg +8 -0
  343. package/dist/images/UI_icon-Branch-RGB.svg +1 -0
  344. package/dist/images/UI_icon-Connected-RGB.svg +1 -0
  345. package/dist/images/UI_icon-Cubes-RGB.svg +1 -0
  346. package/dist/images/UI_icon-Double_arrow_right-RGB.svg +1 -0
  347. package/dist/images/UI_icon-Folder-RGB.svg +1 -0
  348. package/dist/images/UI_icon-Notebook-Images-RGB.svg +9 -0
  349. package/dist/images/UI_icon-Server-RGB.svg +1 -0
  350. package/dist/images/UI_icon-Server_upload-RGB.svg +1 -0
  351. package/dist/images/UI_icon-Shared_workspace-RGB.svg +8 -0
  352. package/dist/images/UI_icon-Storage-RGB.svg +1 -0
  353. package/dist/images/UI_icon-User-RGB.svg +1 -0
  354. package/dist/images/UI_icon-Wrench-RGB.svg +1 -0
  355. package/dist/images/empty-state-cluster-storage.svg +472 -0
  356. package/dist/images/empty-state-data-connections.svg +299 -0
  357. package/dist/images/empty-state-model-registries.svg +9 -0
  358. package/dist/images/empty-state-model-serving.svg +249 -0
  359. package/dist/images/empty-state-notebooks.svg +392 -0
  360. package/dist/images/empty-state-pipelines.svg +393 -0
  361. package/dist/images/empty-state-project-overview.svg +482 -0
  362. package/dist/images/empty-state-projects-color.svg +275 -0
  363. package/dist/images/empty-state-storage-classes.svg +56 -0
  364. package/dist/images/icons/AcceleratorProfileIcon.d.ts +3 -0
  365. package/dist/images/icons/AcceleratorProfileIcon.d.ts.map +1 -0
  366. package/dist/images/icons/AcceleratorProfileIcon.js +11 -0
  367. package/dist/images/icons/AcceleratorProfileIcon.js.map +1 -0
  368. package/dist/images/icons/AcceleratorProfileIcon.ts +13 -0
  369. package/dist/images/icons/ArtifactIcon.d.ts +3 -0
  370. package/dist/images/icons/ArtifactIcon.d.ts.map +1 -0
  371. package/dist/images/icons/ArtifactIcon.js +11 -0
  372. package/dist/images/icons/ArtifactIcon.js.map +1 -0
  373. package/dist/images/icons/ArtifactIcon.ts +13 -0
  374. package/dist/images/icons/BuildIcon.d.ts +3 -0
  375. package/dist/images/icons/BuildIcon.d.ts.map +1 -0
  376. package/dist/images/icons/BuildIcon.js +11 -0
  377. package/dist/images/icons/BuildIcon.js.map +1 -0
  378. package/dist/images/icons/BuildIcon.ts +13 -0
  379. package/dist/images/icons/ClusterSettingsIcon.d.ts +3 -0
  380. package/dist/images/icons/ClusterSettingsIcon.d.ts.map +1 -0
  381. package/dist/images/icons/ClusterSettingsIcon.js +11 -0
  382. package/dist/images/icons/ClusterSettingsIcon.js.map +1 -0
  383. package/dist/images/icons/ClusterSettingsIcon.ts +13 -0
  384. package/dist/images/icons/ConfigurationIcon.d.ts +3 -0
  385. package/dist/images/icons/ConfigurationIcon.d.ts.map +1 -0
  386. package/dist/images/icons/ConfigurationIcon.js +11 -0
  387. package/dist/images/icons/ConfigurationIcon.js.map +1 -0
  388. package/dist/images/icons/ConfigurationIcon.ts +13 -0
  389. package/dist/images/icons/CreateAndTrainIcon.d.ts +3 -0
  390. package/dist/images/icons/CreateAndTrainIcon.d.ts.map +1 -0
  391. package/dist/images/icons/CreateAndTrainIcon.js +11 -0
  392. package/dist/images/icons/CreateAndTrainIcon.js.map +1 -0
  393. package/dist/images/icons/CreateAndTrainIcon.ts +13 -0
  394. package/dist/images/icons/DataConnectionIcon.d.ts +3 -0
  395. package/dist/images/icons/DataConnectionIcon.d.ts.map +1 -0
  396. package/dist/images/icons/DataConnectionIcon.js +11 -0
  397. package/dist/images/icons/DataConnectionIcon.js.map +1 -0
  398. package/dist/images/icons/DataConnectionIcon.ts +13 -0
  399. package/dist/images/icons/DeployedModelIcon.d.ts +3 -0
  400. package/dist/images/icons/DeployedModelIcon.d.ts.map +1 -0
  401. package/dist/images/icons/DeployedModelIcon.js +11 -0
  402. package/dist/images/icons/DeployedModelIcon.js.map +1 -0
  403. package/dist/images/icons/DeployedModelIcon.ts +13 -0
  404. package/dist/images/icons/DistributedWorkloadIcon.d.ts +3 -0
  405. package/dist/images/icons/DistributedWorkloadIcon.d.ts.map +1 -0
  406. package/dist/images/icons/DistributedWorkloadIcon.js +11 -0
  407. package/dist/images/icons/DistributedWorkloadIcon.js.map +1 -0
  408. package/dist/images/icons/DistributedWorkloadIcon.ts +13 -0
  409. package/dist/images/icons/EnabledApplicationsIcon.d.ts +3 -0
  410. package/dist/images/icons/EnabledApplicationsIcon.d.ts.map +1 -0
  411. package/dist/images/icons/EnabledApplicationsIcon.js +11 -0
  412. package/dist/images/icons/EnabledApplicationsIcon.js.map +1 -0
  413. package/dist/images/icons/EnabledApplicationsIcon.ts +13 -0
  414. package/dist/images/icons/ExperimentIcon.d.ts +3 -0
  415. package/dist/images/icons/ExperimentIcon.d.ts.map +1 -0
  416. package/dist/images/icons/ExperimentIcon.js +11 -0
  417. package/dist/images/icons/ExperimentIcon.js.map +1 -0
  418. package/dist/images/icons/ExperimentIcon.ts +13 -0
  419. package/dist/images/icons/ExploreApplicationsIcon.d.ts +3 -0
  420. package/dist/images/icons/ExploreApplicationsIcon.d.ts.map +1 -0
  421. package/dist/images/icons/ExploreApplicationsIcon.js +11 -0
  422. package/dist/images/icons/ExploreApplicationsIcon.js.map +1 -0
  423. package/dist/images/icons/ExploreApplicationsIcon.ts +13 -0
  424. package/dist/images/icons/GroupIcon.d.ts +3 -0
  425. package/dist/images/icons/GroupIcon.d.ts.map +1 -0
  426. package/dist/images/icons/GroupIcon.js +11 -0
  427. package/dist/images/icons/GroupIcon.js.map +1 -0
  428. package/dist/images/icons/GroupIcon.ts +13 -0
  429. package/dist/images/icons/ModelIcon.d.ts +3 -0
  430. package/dist/images/icons/ModelIcon.d.ts.map +1 -0
  431. package/dist/images/icons/ModelIcon.js +11 -0
  432. package/dist/images/icons/ModelIcon.js.map +1 -0
  433. package/dist/images/icons/ModelIcon.ts +13 -0
  434. package/dist/images/icons/ModelRegistryIcon.d.ts +3 -0
  435. package/dist/images/icons/ModelRegistryIcon.d.ts.map +1 -0
  436. package/dist/images/icons/ModelRegistryIcon.js +11 -0
  437. package/dist/images/icons/ModelRegistryIcon.js.map +1 -0
  438. package/dist/images/icons/ModelRegistryIcon.ts +13 -0
  439. package/dist/images/icons/ModelServerIcon.d.ts +3 -0
  440. package/dist/images/icons/ModelServerIcon.d.ts.map +1 -0
  441. package/dist/images/icons/ModelServerIcon.js +11 -0
  442. package/dist/images/icons/ModelServerIcon.js.map +1 -0
  443. package/dist/images/icons/ModelServerIcon.ts +13 -0
  444. package/dist/images/icons/MultiModelIcon.d.ts +3 -0
  445. package/dist/images/icons/MultiModelIcon.d.ts.map +1 -0
  446. package/dist/images/icons/MultiModelIcon.js +11 -0
  447. package/dist/images/icons/MultiModelIcon.js.map +1 -0
  448. package/dist/images/icons/MultiModelIcon.ts +13 -0
  449. package/dist/images/icons/NotebookIcon.d.ts +3 -0
  450. package/dist/images/icons/NotebookIcon.d.ts.map +1 -0
  451. package/dist/images/icons/NotebookIcon.js +11 -0
  452. package/dist/images/icons/NotebookIcon.js.map +1 -0
  453. package/dist/images/icons/NotebookIcon.ts +13 -0
  454. package/dist/images/icons/NotebookImageIcon.d.ts +3 -0
  455. package/dist/images/icons/NotebookImageIcon.d.ts.map +1 -0
  456. package/dist/images/icons/NotebookImageIcon.js +11 -0
  457. package/dist/images/icons/NotebookImageIcon.js.map +1 -0
  458. package/dist/images/icons/NotebookImageIcon.ts +13 -0
  459. package/dist/images/icons/PermissionsIcon.d.ts +3 -0
  460. package/dist/images/icons/PermissionsIcon.d.ts.map +1 -0
  461. package/dist/images/icons/PermissionsIcon.js +11 -0
  462. package/dist/images/icons/PermissionsIcon.js.map +1 -0
  463. package/dist/images/icons/PermissionsIcon.ts +13 -0
  464. package/dist/images/icons/PipelineExecutionIcon.d.ts +3 -0
  465. package/dist/images/icons/PipelineExecutionIcon.d.ts.map +1 -0
  466. package/dist/images/icons/PipelineExecutionIcon.js +11 -0
  467. package/dist/images/icons/PipelineExecutionIcon.js.map +1 -0
  468. package/dist/images/icons/PipelineExecutionIcon.ts +13 -0
  469. package/dist/images/icons/PipelineIcon.d.ts +3 -0
  470. package/dist/images/icons/PipelineIcon.d.ts.map +1 -0
  471. package/dist/images/icons/PipelineIcon.js +11 -0
  472. package/dist/images/icons/PipelineIcon.js.map +1 -0
  473. package/dist/images/icons/PipelineIcon.ts +13 -0
  474. package/dist/images/icons/PipelineRunIcon.d.ts +3 -0
  475. package/dist/images/icons/PipelineRunIcon.d.ts.map +1 -0
  476. package/dist/images/icons/PipelineRunIcon.js +11 -0
  477. package/dist/images/icons/PipelineRunIcon.js.map +1 -0
  478. package/dist/images/icons/PipelineRunIcon.ts +13 -0
  479. package/dist/images/icons/ProjectIcon.d.ts +3 -0
  480. package/dist/images/icons/ProjectIcon.d.ts.map +1 -0
  481. package/dist/images/icons/ProjectIcon.js +11 -0
  482. package/dist/images/icons/ProjectIcon.js.map +1 -0
  483. package/dist/images/icons/ProjectIcon.ts +13 -0
  484. package/dist/images/icons/RegisteredModelIcon.d.ts +3 -0
  485. package/dist/images/icons/RegisteredModelIcon.d.ts.map +1 -0
  486. package/dist/images/icons/RegisteredModelIcon.js +11 -0
  487. package/dist/images/icons/RegisteredModelIcon.js.map +1 -0
  488. package/dist/images/icons/RegisteredModelIcon.ts +13 -0
  489. package/dist/images/icons/ResourcesIcon.d.ts +3 -0
  490. package/dist/images/icons/ResourcesIcon.d.ts.map +1 -0
  491. package/dist/images/icons/ResourcesIcon.js +11 -0
  492. package/dist/images/icons/ResourcesIcon.js.map +1 -0
  493. package/dist/images/icons/ResourcesIcon.ts +13 -0
  494. package/dist/images/icons/ServingRuntimeIcon.d.ts +3 -0
  495. package/dist/images/icons/ServingRuntimeIcon.d.ts.map +1 -0
  496. package/dist/images/icons/ServingRuntimeIcon.js +11 -0
  497. package/dist/images/icons/ServingRuntimeIcon.js.map +1 -0
  498. package/dist/images/icons/ServingRuntimeIcon.ts +13 -0
  499. package/dist/images/icons/SingleModelIcon.d.ts +3 -0
  500. package/dist/images/icons/SingleModelIcon.d.ts.map +1 -0
  501. package/dist/images/icons/SingleModelIcon.js +11 -0
  502. package/dist/images/icons/SingleModelIcon.js.map +1 -0
  503. package/dist/images/icons/SingleModelIcon.ts +13 -0
  504. package/dist/images/icons/StorageClassIcon.d.ts +3 -0
  505. package/dist/images/icons/StorageClassIcon.d.ts.map +1 -0
  506. package/dist/images/icons/StorageClassIcon.js +11 -0
  507. package/dist/images/icons/StorageClassIcon.js.map +1 -0
  508. package/dist/images/icons/StorageClassIcon.ts +13 -0
  509. package/dist/images/icons/StorageIcon.d.ts +3 -0
  510. package/dist/images/icons/StorageIcon.d.ts.map +1 -0
  511. package/dist/images/icons/StorageIcon.js +11 -0
  512. package/dist/images/icons/StorageIcon.js.map +1 -0
  513. package/dist/images/icons/StorageIcon.ts +13 -0
  514. package/dist/images/icons/UserIcon.d.ts +3 -0
  515. package/dist/images/icons/UserIcon.d.ts.map +1 -0
  516. package/dist/images/icons/UserIcon.js +11 -0
  517. package/dist/images/icons/UserIcon.js.map +1 -0
  518. package/dist/images/icons/UserIcon.ts +13 -0
  519. package/dist/images/icons/index.d.ts +32 -0
  520. package/dist/images/icons/index.d.ts.map +1 -0
  521. package/dist/images/icons/index.js +32 -0
  522. package/dist/images/icons/index.js.map +1 -0
  523. package/dist/images/icons/index.ts +31 -0
  524. package/dist/images/index.d.ts +29 -0
  525. package/dist/images/index.d.ts.map +1 -0
  526. package/dist/images/index.js +33 -0
  527. package/dist/images/index.js.map +1 -0
  528. package/dist/images/index.ts +62 -0
  529. package/dist/images/logo-dark-theme.svg +43 -0
  530. package/dist/images/logo-light-theme.svg +43 -0
  531. package/dist/images/no-models-model-registry.svg +180 -0
  532. package/dist/images/no-versions-model-registry.svg +149 -0
  533. package/dist/index.d.ts +11 -0
  534. package/dist/index.d.ts.map +1 -0
  535. package/dist/index.js +20 -0
  536. package/dist/index.js.map +1 -0
  537. package/dist/jest.config.d.ts +21 -0
  538. package/dist/jest.config.d.ts.map +1 -0
  539. package/dist/jest.config.js +41 -0
  540. package/dist/jest.config.js.map +1 -0
  541. package/dist/style/MUI-theme.scss +971 -0
  542. package/dist/style/index.d.ts +2 -0
  543. package/dist/style/index.d.ts.map +1 -0
  544. package/dist/style/index.js +7 -0
  545. package/dist/style/index.js.map +1 -0
  546. package/dist/style/index.ts +8 -0
  547. package/dist/types/common.d.ts +188 -0
  548. package/dist/types/common.d.ts.map +1 -0
  549. package/dist/types/common.js +25 -0
  550. package/dist/types/common.js.map +1 -0
  551. package/dist/types/index.d.ts +4 -0
  552. package/dist/types/index.d.ts.map +1 -0
  553. package/dist/types/index.js +6 -0
  554. package/dist/types/index.js.map +1 -0
  555. package/dist/types/k8sTypes.d.ts +237 -0
  556. package/dist/types/k8sTypes.d.ts.map +1 -0
  557. package/dist/types/k8sTypes.js +12 -0
  558. package/dist/types/k8sTypes.js.map +1 -0
  559. package/dist/types/typeHelpers.d.ts +147 -0
  560. package/dist/types/typeHelpers.d.ts.map +1 -0
  561. package/dist/types/typeHelpers.js +2 -0
  562. package/dist/types/typeHelpers.js.map +1 -0
  563. package/dist/utilities/appUtils.d.ts +2 -0
  564. package/dist/utilities/appUtils.d.ts.map +1 -0
  565. package/dist/utilities/appUtils.js +5 -0
  566. package/dist/utilities/appUtils.js.map +1 -0
  567. package/dist/utilities/const.d.ts +32 -0
  568. package/dist/utilities/const.d.ts.map +1 -0
  569. package/dist/utilities/const.js +43 -0
  570. package/dist/utilities/const.js.map +1 -0
  571. package/dist/utilities/index.d.ts +12 -0
  572. package/dist/utilities/index.d.ts.map +1 -0
  573. package/dist/utilities/index.js +13 -0
  574. package/dist/utilities/index.js.map +1 -0
  575. package/dist/utilities/markdown.d.ts +4 -0
  576. package/dist/utilities/markdown.d.ts.map +1 -0
  577. package/dist/utilities/markdown.js +50 -0
  578. package/dist/utilities/markdown.js.map +1 -0
  579. package/dist/utilities/time.d.ts +2 -0
  580. package/dist/utilities/time.d.ts.map +1 -0
  581. package/dist/utilities/time.js +72 -0
  582. package/dist/utilities/time.js.map +1 -0
  583. package/dist/utilities/useDebounceCallback.d.ts +3 -0
  584. package/dist/utilities/useDebounceCallback.d.ts.map +1 -0
  585. package/dist/utilities/useDebounceCallback.js +8 -0
  586. package/dist/utilities/useDebounceCallback.js.map +1 -0
  587. package/dist/utilities/useDeepCompareMemoize.d.ts +2 -0
  588. package/dist/utilities/useDeepCompareMemoize.d.ts.map +1 -0
  589. package/dist/utilities/useDeepCompareMemoize.js +10 -0
  590. package/dist/utilities/useDeepCompareMemoize.js.map +1 -0
  591. package/dist/utilities/useEventListener.d.ts +2 -0
  592. package/dist/utilities/useEventListener.d.ts.map +1 -0
  593. package/dist/utilities/useEventListener.js +10 -0
  594. package/dist/utilities/useEventListener.js.map +1 -0
  595. package/dist/utilities/useFetchState.d.ts +92 -0
  596. package/dist/utilities/useFetchState.d.ts.map +1 -0
  597. package/dist/utilities/useFetchState.js +165 -0
  598. package/dist/utilities/useFetchState.js.map +1 -0
  599. package/dist/utilities/useGenericObjectState.d.ts +9 -0
  600. package/dist/utilities/useGenericObjectState.d.ts.map +1 -0
  601. package/dist/utilities/useGenericObjectState.js +18 -0
  602. package/dist/utilities/useGenericObjectState.js.map +1 -0
  603. package/dist/utilities/useMakeFetchObject.d.ts +4 -0
  604. package/dist/utilities/useMakeFetchObject.d.ts.map +1 -0
  605. package/dist/utilities/useMakeFetchObject.js +7 -0
  606. package/dist/utilities/useMakeFetchObject.js.map +1 -0
  607. package/dist/utilities/utils.d.ts +3 -0
  608. package/dist/utilities/utils.d.ts.map +1 -0
  609. package/dist/utilities/utils.js +18 -0
  610. package/dist/utilities/utils.js.map +1 -0
  611. package/images/Icon-Layered_A_Black-RGB.svg +66 -0
  612. package/images/Icon-Storage-A-Black-RGB.svg +3 -0
  613. package/images/Icon-Sys_admin-A-Black-RGB.svg +8 -0
  614. package/images/UI_icon-Branch-RGB.svg +1 -0
  615. package/images/UI_icon-Connected-RGB.svg +1 -0
  616. package/images/UI_icon-Cubes-RGB.svg +1 -0
  617. package/images/UI_icon-Double_arrow_right-RGB.svg +1 -0
  618. package/images/UI_icon-Folder-RGB.svg +1 -0
  619. package/images/UI_icon-Notebook-Images-RGB.svg +9 -0
  620. package/images/UI_icon-Server-RGB.svg +1 -0
  621. package/images/UI_icon-Server_upload-RGB.svg +1 -0
  622. package/images/UI_icon-Shared_workspace-RGB.svg +8 -0
  623. package/images/UI_icon-Storage-RGB.svg +1 -0
  624. package/images/UI_icon-User-RGB.svg +1 -0
  625. package/images/UI_icon-Wrench-RGB.svg +1 -0
  626. package/images/empty-state-cluster-storage.svg +472 -0
  627. package/images/empty-state-data-connections.svg +299 -0
  628. package/images/empty-state-model-registries.svg +9 -0
  629. package/images/empty-state-model-serving.svg +249 -0
  630. package/images/empty-state-notebooks.svg +392 -0
  631. package/images/empty-state-pipelines.svg +393 -0
  632. package/images/empty-state-project-overview.svg +482 -0
  633. package/images/empty-state-projects-color.svg +275 -0
  634. package/images/empty-state-storage-classes.svg +56 -0
  635. package/images/icons/AcceleratorProfileIcon.ts +13 -0
  636. package/images/icons/ArtifactIcon.ts +13 -0
  637. package/images/icons/BuildIcon.ts +13 -0
  638. package/images/icons/ClusterSettingsIcon.ts +13 -0
  639. package/images/icons/ConfigurationIcon.ts +13 -0
  640. package/images/icons/CreateAndTrainIcon.ts +13 -0
  641. package/images/icons/DataConnectionIcon.ts +13 -0
  642. package/images/icons/DeployedModelIcon.ts +13 -0
  643. package/images/icons/DistributedWorkloadIcon.ts +13 -0
  644. package/images/icons/EnabledApplicationsIcon.ts +13 -0
  645. package/images/icons/ExperimentIcon.ts +13 -0
  646. package/images/icons/ExploreApplicationsIcon.ts +13 -0
  647. package/images/icons/GroupIcon.ts +13 -0
  648. package/images/icons/ModelIcon.ts +13 -0
  649. package/images/icons/ModelRegistryIcon.ts +13 -0
  650. package/images/icons/ModelServerIcon.ts +13 -0
  651. package/images/icons/MultiModelIcon.ts +13 -0
  652. package/images/icons/NotebookIcon.ts +13 -0
  653. package/images/icons/NotebookImageIcon.ts +13 -0
  654. package/images/icons/PermissionsIcon.ts +13 -0
  655. package/images/icons/PipelineExecutionIcon.ts +13 -0
  656. package/images/icons/PipelineIcon.ts +13 -0
  657. package/images/icons/PipelineRunIcon.ts +13 -0
  658. package/images/icons/ProjectIcon.ts +13 -0
  659. package/images/icons/RegisteredModelIcon.ts +13 -0
  660. package/images/icons/ResourcesIcon.ts +13 -0
  661. package/images/icons/ServingRuntimeIcon.ts +13 -0
  662. package/images/icons/SingleModelIcon.ts +13 -0
  663. package/images/icons/StorageClassIcon.ts +13 -0
  664. package/images/icons/StorageIcon.ts +13 -0
  665. package/images/icons/UserIcon.ts +13 -0
  666. package/images/icons/index.ts +31 -0
  667. package/images/index.ts +62 -0
  668. package/images/logo-dark-theme.svg +43 -0
  669. package/images/logo-light-theme.svg +43 -0
  670. package/images/no-models-model-registry.svg +180 -0
  671. package/images/no-versions-model-registry.svg +149 -0
  672. package/package.json +108 -0
  673. package/style/MUI-theme.scss +971 -0
  674. package/style/index.ts +8 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,115 @@
1
+ # Modular Architecture Shared Library
2
+
3
+ ## Overview
4
+
5
+ `mod-arch-shared` is a shared library providing common UI components and utilities for micro-frontend projects following a modular architecture. This library follows a modular design to ensure reusability and maintainability across various projects. The library is versioned to facilitate consistent updates and integration.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install mod-arch-shared
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ Import components and utilities as needed:
16
+
17
+ ```jsx
18
+ import { DashboardSearchField, useNamespaces, ToastNotification } from 'mod-arch-shared';
19
+
20
+ const MyComponent = () => {
21
+ const { namespaces, loading } = useNamespaces();
22
+
23
+ return (
24
+ <>
25
+ <DashboardSearchField onChange={handleSearch} />
26
+ {/* Your component code */}
27
+ <ToastNotification title="Success" type="success" message="Operation completed" />
28
+ </>
29
+ );
30
+ };
31
+ ```
32
+
33
+ ## Using Styles and Images
34
+
35
+ This library exports both style files and image assets that can be imported and used in your application.
36
+
37
+ ### Importing Styles
38
+
39
+ You can import specific styles or all styles at once:
40
+
41
+ ```javascript
42
+ // Import all styles
43
+ import { style } from 'mod-arch-shared';
44
+
45
+ // Or import specific style components directly
46
+ import 'mod-arch-shared/style';
47
+ ```
48
+
49
+ ### Importing Images
50
+
51
+ Images can be imported in several ways:
52
+
53
+ ```javascript
54
+ // Import specific images
55
+ import { emptyStateNotebooks, iconRedHatStorage } from 'mod-arch-shared/images';
56
+
57
+ // Or import all images as a namespace
58
+ import * as Images from 'mod-arch-shared/images';
59
+
60
+ // Then use them in your components
61
+ <img src={emptyStateNotebooks} alt="Empty state notebooks" />
62
+ ```
63
+
64
+ ## Folder Structure
65
+
66
+ The repository contains the following modules:
67
+
68
+ - **api**: API utilities for making service calls and handling errors
69
+ - **components**: Reusable UI components
70
+ - **hooks**: Custom React hooks
71
+ - **utilities**: Utility functions
72
+ - **context**: Context providers
73
+ - **style**: Global styles
74
+ - **types**: TypeScript type definitions
75
+
76
+ ## Development
77
+
78
+ ### Prerequisites
79
+
80
+ - Node.js >= 20.17
81
+ - npm >= 10.8
82
+
83
+ ### Setup
84
+
85
+ ```bash
86
+ git clone <repository-url>
87
+ cd mod-arch-shared
88
+ npm install
89
+ ```
90
+
91
+ ### Building
92
+
93
+ ```bash
94
+ npm run build
95
+ ```
96
+
97
+ ### Testing
98
+
99
+ ```bash
100
+ npm test
101
+ ```
102
+
103
+ ### Linting
104
+
105
+ ```bash
106
+ npm run lint
107
+ ```
108
+
109
+ ## Contributing
110
+
111
+ We welcome contributions to the project. Please see the [CONTRIBUTING.md](CONTRIBUTING.md) file for more information.
112
+
113
+ ## License
114
+
115
+ This project is licensed under the Apache License 2.0. See the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,8 @@
1
+ type MockGenericResponse = {
2
+ id?: string;
3
+ name?: string;
4
+ description?: string;
5
+ };
6
+ export declare const mockGenericResponse: ({ name, description, id, }: MockGenericResponse) => MockGenericResponse;
7
+ export {};
8
+ //# sourceMappingURL=mockGenericResponse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mockGenericResponse.d.ts","sourceRoot":"","sources":["../../../__tests__/__mocks__/mockGenericResponse.ts"],"names":[],"mappings":"AAAA,KAAK,mBAAmB,GAAG;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,4BAIjC,mBAAmB,KAAG,mBAIvB,CAAC"}
@@ -0,0 +1,9 @@
1
+ export var mockGenericResponse = function (_a) {
2
+ var _b = _a.name, name = _b === void 0 ? 'test' : _b, _c = _a.description, description = _c === void 0 ? 'test' : _c, _d = _a.id, id = _d === void 0 ? '1' : _d;
3
+ return ({
4
+ name: name,
5
+ description: description,
6
+ id: id,
7
+ });
8
+ };
9
+ //# sourceMappingURL=mockGenericResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mockGenericResponse.js","sourceRoot":"","sources":["../../../__tests__/__mocks__/mockGenericResponse.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,IAAM,mBAAmB,GAAG,UAAC,EAId;QAHpB,YAAa,EAAb,IAAI,mBAAG,MAAM,KAAA,EACb,mBAAoB,EAApB,WAAW,mBAAG,MAAM,KAAA,EACpB,UAAQ,EAAR,EAAE,mBAAG,GAAG,KAAA;IACsC,OAAA,CAAC;QAC/C,IAAI,MAAA;QACJ,WAAW,aAAA;QACX,EAAE,IAAA;KACH,CAAC;AAJ8C,CAI9C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=styleMock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styleMock.d.ts","sourceRoot":"","sources":["../../../__tests__/__mocks__/styleMock.js"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ module.exports = {};
3
+ //# sourceMappingURL=styleMock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styleMock.js","sourceRoot":"","sources":["../../../__tests__/__mocks__/styleMock.js"],"names":[],"mappings":";AAAA,MAAM,CAAC,OAAO,GAAG,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ import 'core-js/actual/array/to-sorted';
2
+ //# sourceMappingURL=jest.setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jest.setup.d.ts","sourceRoot":"","sources":["../../../__tests__/unit/jest.setup.ts"],"names":[],"mappings":"AAEA,OAAO,gCAAgC,CAAC"}
@@ -0,0 +1,57 @@
1
+ import { __assign } from "tslib";
2
+ import { TextEncoder } from 'util';
3
+ import 'core-js/actual/array/to-sorted';
4
+ import { createComparativeValue, } from '../../__tests__/unit/testUtils/hooks';
5
+ global.TextEncoder = TextEncoder;
6
+ var tryExpect = function (expectFn) {
7
+ try {
8
+ expectFn();
9
+ }
10
+ catch (e) {
11
+ var matcherResult_1 = e.matcherResult;
12
+ if (matcherResult_1) {
13
+ return __assign(__assign({}, matcherResult_1), { message: function () { return matcherResult_1.message; } });
14
+ }
15
+ throw e;
16
+ }
17
+ return {
18
+ pass: true,
19
+ message: function () { return ''; },
20
+ };
21
+ };
22
+ expect.extend({
23
+ // custom asymmetric matchers
24
+ /**
25
+ * Checks that a value is what you expect.
26
+ * It uses Object.is to check strict equality.
27
+ *
28
+ * Usage:
29
+ * expect.isIdentifyEqual(...)
30
+ */
31
+ isIdentityEqual: function (actual, expected) { return ({
32
+ pass: Object.is(actual, expected),
33
+ message: function () { return "expected ".concat(actual, " to be identity equal to ").concat(expected); },
34
+ }); },
35
+ // hook related custom matchers
36
+ hookToBe: function (actual, expected) {
37
+ return tryExpect(function () { return expect(actual.result.current).toBe(expected); });
38
+ },
39
+ hookToStrictEqual: function (actual, expected) {
40
+ return tryExpect(function () { return expect(actual.result.current).toStrictEqual(expected); });
41
+ },
42
+ hookToHaveUpdateCount: function (actual, expected) {
43
+ return tryExpect(function () { return expect(actual.getUpdateCount()).toBe(expected); });
44
+ },
45
+ hookToBeStable: function (actual, expected) {
46
+ if (actual.getUpdateCount() <= 1) {
47
+ throw new Error('Cannot assert stability as the hook has not run at least 2 times.');
48
+ }
49
+ if (typeof expected === 'undefined') {
50
+ return tryExpect(function () { return expect(actual.result.current).toBe(actual.getPreviousResult()); });
51
+ }
52
+ return tryExpect(function () {
53
+ return expect(actual.result.current).toStrictEqual(createComparativeValue(actual.getPreviousResult(), expected));
54
+ });
55
+ },
56
+ });
57
+ //# sourceMappingURL=jest.setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jest.setup.js","sourceRoot":"","sources":["../../../__tests__/unit/jest.setup.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAEnC,OAAO,gCAAgC,CAAC;AACxC,OAAO,EAGL,sBAAsB,GACvB,MAAM,kCAAkC,CAAC;AAE1C,MAAM,CAAC,WAAW,GAAG,WAAW,CAAC;AAEjC,IAAM,SAAS,GAAG,UAAC,QAAoB;IACrC,IAAI,CAAC;QACH,QAAQ,EAAE,CAAC;IACb,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACH,IAAA,eAAa,GAAK,CAAuB,cAA5B,CAA6B;QAClD,IAAI,eAAa,EAAE,CAAC;YAClB,6BAAY,eAAa,KAAE,OAAO,EAAE,cAAM,OAAA,eAAa,CAAC,OAAO,EAArB,CAAqB,IAAG;QACpE,CAAC;QACD,MAAM,CAAC,CAAC;IACV,CAAC;IACD,OAAO;QACL,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,cAAM,OAAA,EAAE,EAAF,CAAE;KAClB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,CAAC;IACZ,6BAA6B;IAE7B;;;;;;OAMG;IACH,eAAe,EAAE,UAAC,MAAM,EAAE,QAAQ,IAAK,OAAA,CAAC;QACtC,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;QACjC,OAAO,EAAE,cAAM,OAAA,mBAAY,MAAM,sCAA4B,QAAQ,CAAE,EAAxD,CAAwD;KACxE,CAAC,EAHqC,CAGrC;IAEF,+BAA+B;IAC/B,QAAQ,EAAE,UAAC,MAA6C,EAAE,QAAQ;QAChE,OAAA,SAAS,CAAC,cAAM,OAAA,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAA5C,CAA4C,CAAC;IAA7D,CAA6D;IAE/D,iBAAiB,EAAE,UAAC,MAA6C,EAAE,QAAQ;QACzE,OAAA,SAAS,CAAC,cAAM,OAAA,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,EAArD,CAAqD,CAAC;IAAtE,CAAsE;IAExE,qBAAqB,EAAE,UAAC,MAA6C,EAAE,QAAgB;QACrF,OAAA,SAAS,CAAC,cAAM,OAAA,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAA9C,CAA8C,CAAC;IAA/D,CAA+D;IAEjE,cAAc,EAAE,UAAI,MAAuC,EAAE,QAA2B;QACtF,IAAI,MAAM,CAAC,cAAc,EAAE,IAAI,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;QACvF,CAAC;QACD,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;YACpC,OAAO,SAAS,CAAC,cAAM,OAAA,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC,EAA9D,CAA8D,CAAC,CAAC;QACzF,CAAC;QACD,OAAO,SAAS,CAAC;YACf,OAAA,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,aAAa,CACzC,sBAAsB,CAAC,MAAM,CAAC,iBAAiB,EAAE,EAAE,QAAQ,CAAC,CAC7D;QAFD,CAEC,CACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,80 @@
1
+ import { RenderHookOptions, RenderHookResult, waitForOptions } from '@testing-library/react';
2
+ import { queries, Queries } from '@testing-library/dom';
3
+ export type BooleanValues<T> = T extends boolean | number | null | undefined | Function ? boolean | undefined : boolean | undefined | {
4
+ [K in keyof T]?: BooleanValues<T[K]>;
5
+ };
6
+ /**
7
+ * Extension of RTL RenderHookResult providing functions used query the current state of the result.
8
+ */
9
+ export type RenderHookResultExt<Result, Props> = RenderHookResult<Result, Props> & {
10
+ /**
11
+ * Returns the previous result.
12
+ */
13
+ getPreviousResult: () => Result;
14
+ /**
15
+ * Get the update count for how many times the hook has been rendered.
16
+ * An update occurs initially on render, subsequently when re-rendered, and also whenever the hook itself triggers a re-render.
17
+ * eg. An `useEffect` triggering a state update.
18
+ */
19
+ getUpdateCount: () => number;
20
+ /**
21
+ * Returns a Promise that resolves the next time the hook renders, commonly when state is updated as the result of an asynchronous update.
22
+ *
23
+ * Since `waitForNextUpdate` works using interval checks (backed by `waitFor`), it's possible that multiple updates may occur while waiting.
24
+ */
25
+ waitForNextUpdate: (options?: Pick<waitForOptions, 'interval' | 'timeout'>) => Promise<void>;
26
+ };
27
+ /**
28
+ * Wrapper on top of RTL `renderHook` returning a result that implements the `RenderHookResultExt` interface.
29
+ *
30
+ * `renderHook` provides full control over the rendering of your hook including the ability to wrap the test component.
31
+ * This is usually used to add context providers from `React.createContext` for the hook to access with `useContext`.
32
+ * `initialProps` and props subsequently set by `rerender` will be provided to the wrapper.
33
+ *
34
+ * ```
35
+ * const renderResult = renderHook(({ who }: { who: string }) => useSayHello(who), { initialProps: { who: 'world' }});
36
+ * expect(renderResult).hookToBe('Hello world!');
37
+ * renderResult.rerender({ who: 'there' });
38
+ * expect(renderResult).hookToBe('Hello there!');
39
+ * ```
40
+ */
41
+ export declare const renderHook: <Result, Props, Q extends Queries = typeof queries, Container extends Element | DocumentFragment = HTMLElement, BaseElement extends Element | DocumentFragment = Container>(render: (initialProps: Props) => Result, options?: RenderHookOptions<Props, Q, Container, BaseElement>) => RenderHookResultExt<Result, Props>;
42
+ /**
43
+ * Lightweight API for testing a single hook.
44
+ *
45
+ * Prefer this method of testing over `renderHook` for simplicity.
46
+ *
47
+ * ```
48
+ * const renderResult = testHook(useSayHello)('world');
49
+ * expectHook(renderResult).toBe('Hello world!');
50
+ * renderResult.rerender('there');
51
+ * expectHook(renderResult).toBe('Hello there!');
52
+ * ```
53
+ */
54
+ export declare const testHook: <Result, P extends unknown[]>(hook: (...params: P) => Result) => (...initialParams: P) => Omit<RenderHookResultExt<Result, {
55
+ $params: typeof initialParams;
56
+ }>, "rerender"> & {
57
+ rerender: (...params: typeof initialParams) => void;
58
+ };
59
+ /**
60
+ * A helper function for asserting the return value of hooks based on `useFetchState`.
61
+ *
62
+ * eg.
63
+ * ```
64
+ * expectHook(renderResult).isStrictEqual(standardUseFetchState('test value', true))
65
+ * ```
66
+ * is equivalent to:
67
+ * ```
68
+ * expectHook(renderResult).isStrictEqual(['test value', true, undefined, expect.any(Function)])
69
+ * ```
70
+ */
71
+ export declare const standardUseFetchState: <D>(data: D, loaded?: boolean, error?: Error) => [data: D, loaded: boolean, loadError: Error | undefined, refresh: () => Promise<D | undefined>];
72
+ /**
73
+ * Extracts a subset of values from the source that can be used to compare equality.
74
+ *
75
+ * Recursively traverses the `booleanTarget`. For every property or array index equal to `true`,
76
+ * adds the value of the source to the result wrapped in custom matcher `expect.isIdentityEqual`.
77
+ * If the entry is `false` or `undefined`, add an everything matcher to the result.
78
+ */
79
+ export declare const createComparativeValue: <T>(source: T, booleanTarget: BooleanValues<T>) => unknown;
80
+ //# sourceMappingURL=hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../../__tests__/unit/testUtils/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EACjB,gBAAgB,EAEhB,cAAc,EACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAGxD,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,QAAQ,GACnF,OAAO,GAAG,SAAS,GACnB,OAAO,GAAG,SAAS,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAEnE;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,MAAM,EAAE,KAAK,IAAI,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG;IACjF;;OAEG;IACH,iBAAiB,EAAE,MAAM,MAAM,CAAC;IAEhC;;;;OAIG;IACH,cAAc,EAAE,MAAM,MAAM,CAAC;IAE7B;;;;OAIG;IACH,iBAAiB,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,SAAS,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9F,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,UAAU,GACrB,MAAM,EACN,KAAK,EACL,CAAC,SAAS,OAAO,GAAG,OAAO,OAAO,EAClC,SAAS,SAAS,OAAO,GAAG,gBAAgB,GAAG,WAAW,EAC1D,WAAW,SAAS,OAAO,GAAG,gBAAgB,GAAG,SAAS,EAE1D,QAAQ,CAAC,YAAY,EAAE,KAAK,KAAK,MAAM,EACvC,UAAU,iBAAiB,CAAC,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,WAAW,CAAC,KAC5D,mBAAmB,CAAC,MAAM,EAAE,KAAK,CA8BnC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,QAAQ,GAClB,MAAM,EAAE,CAAC,SAAS,OAAO,EAAE,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE,CAAC,KAAK,MAAM,MAG1D,GAAG,eAAe,CAAC,KAClB,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,OAAO,aAAa,CAAA;CAAE,CAAC,EAAE,UAAU,CAAC,GAAG;IACpF,QAAQ,EAAE,CAAC,GAAG,MAAM,EAAE,OAAO,aAAa,KAAK,IAAI,CAAC;CAerD,CAAC;AAEJ;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,GAAI,CAAC,EACrC,MAAM,CAAC,EACP,gBAAc,EACd,QAAQ,KAAK,KACZ,CACD,IAAI,EAAE,CAAC,EACP,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,KAAK,GAAG,SAAS,EAC5B,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CACS,CAAC;AASjD;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,GAAI,CAAC,EAAE,QAAQ,CAAC,EAAE,eAAe,aAAa,CAAC,CAAC,CAAC,KAAG,OAC/B,CAAC"}
@@ -0,0 +1,149 @@
1
+ import { __assign, __awaiter, __generator, __read, __spreadArray } from "tslib";
2
+ import { renderHook as renderHookRTL, waitFor, } from '@testing-library/react';
3
+ /**
4
+ * Wrapper on top of RTL `renderHook` returning a result that implements the `RenderHookResultExt` interface.
5
+ *
6
+ * `renderHook` provides full control over the rendering of your hook including the ability to wrap the test component.
7
+ * This is usually used to add context providers from `React.createContext` for the hook to access with `useContext`.
8
+ * `initialProps` and props subsequently set by `rerender` will be provided to the wrapper.
9
+ *
10
+ * ```
11
+ * const renderResult = renderHook(({ who }: { who: string }) => useSayHello(who), { initialProps: { who: 'world' }});
12
+ * expect(renderResult).hookToBe('Hello world!');
13
+ * renderResult.rerender({ who: 'there' });
14
+ * expect(renderResult).hookToBe('Hello there!');
15
+ * ```
16
+ */
17
+ export var renderHook = function (render, options) {
18
+ var updateCount = 0;
19
+ var prevResult;
20
+ var currentResult;
21
+ var renderResult = renderHookRTL(function (props) {
22
+ updateCount++;
23
+ prevResult = currentResult;
24
+ currentResult = render(props);
25
+ return currentResult;
26
+ }, options);
27
+ var renderResultExt = __assign(__assign({}, renderResult), { getPreviousResult: function () { return (updateCount > 1 ? prevResult : renderResult.result.current); }, getUpdateCount: function () { return updateCount; }, waitForNextUpdate: function (currentOptions) { return __awaiter(void 0, void 0, void 0, function () {
28
+ var expected, _a;
29
+ return __generator(this, function (_b) {
30
+ switch (_b.label) {
31
+ case 0:
32
+ expected = updateCount;
33
+ _b.label = 1;
34
+ case 1:
35
+ _b.trys.push([1, 3, , 4]);
36
+ return [4 /*yield*/, waitFor(function () { return expect(updateCount).toBeGreaterThan(expected); }, currentOptions)];
37
+ case 2:
38
+ _b.sent();
39
+ return [3 /*break*/, 4];
40
+ case 3:
41
+ _a = _b.sent();
42
+ throw new Error('waitForNextUpdate timed out');
43
+ case 4: return [2 /*return*/];
44
+ }
45
+ });
46
+ }); } });
47
+ return renderResultExt;
48
+ };
49
+ /**
50
+ * Lightweight API for testing a single hook.
51
+ *
52
+ * Prefer this method of testing over `renderHook` for simplicity.
53
+ *
54
+ * ```
55
+ * const renderResult = testHook(useSayHello)('world');
56
+ * expectHook(renderResult).toBe('Hello world!');
57
+ * renderResult.rerender('there');
58
+ * expectHook(renderResult).toBe('Hello there!');
59
+ * ```
60
+ */
61
+ export var testHook = function (hook) {
62
+ // not ideal to nest functions in terms of API but cannot find a better way to infer P from hook and not initialParams
63
+ return function () {
64
+ var initialParams = [];
65
+ for (var _i = 0; _i < arguments.length; _i++) {
66
+ initialParams[_i] = arguments[_i];
67
+ }
68
+ var renderResult = renderHook(function (_a) {
69
+ var $params = _a.$params;
70
+ return hook.apply(void 0, __spreadArray([], __read($params), false));
71
+ }, {
72
+ initialProps: {
73
+ $params: initialParams,
74
+ },
75
+ });
76
+ return __assign(__assign({}, renderResult), { rerender: function () {
77
+ var params = [];
78
+ for (var _i = 0; _i < arguments.length; _i++) {
79
+ params[_i] = arguments[_i];
80
+ }
81
+ return renderResult.rerender({ $params: params });
82
+ } });
83
+ };
84
+ };
85
+ /**
86
+ * A helper function for asserting the return value of hooks based on `useFetchState`.
87
+ *
88
+ * eg.
89
+ * ```
90
+ * expectHook(renderResult).isStrictEqual(standardUseFetchState('test value', true))
91
+ * ```
92
+ * is equivalent to:
93
+ * ```
94
+ * expectHook(renderResult).isStrictEqual(['test value', true, undefined, expect.any(Function)])
95
+ * ```
96
+ */
97
+ export var standardUseFetchState = function (data, loaded, error) {
98
+ if (loaded === void 0) { loaded = false; }
99
+ return [data, loaded, error, expect.any(Function)];
100
+ };
101
+ // create a new asymmetric matcher that matches everything
102
+ var everything = function () {
103
+ var r = expect.anything();
104
+ r.asymmetricMatch = function () { return true; };
105
+ return r;
106
+ };
107
+ /**
108
+ * Extracts a subset of values from the source that can be used to compare equality.
109
+ *
110
+ * Recursively traverses the `booleanTarget`. For every property or array index equal to `true`,
111
+ * adds the value of the source to the result wrapped in custom matcher `expect.isIdentityEqual`.
112
+ * If the entry is `false` or `undefined`, add an everything matcher to the result.
113
+ */
114
+ export var createComparativeValue = function (source, booleanTarget) {
115
+ return createComparativeValueRecursive(source, booleanTarget);
116
+ };
117
+ var createComparativeValueRecursive = function (source,
118
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
119
+ booleanTarget) {
120
+ if (typeof booleanTarget === 'boolean') {
121
+ return booleanTarget ? expect.isIdentityEqual(source) : everything();
122
+ }
123
+ if (Array.isArray(booleanTarget)) {
124
+ if (Array.isArray(source)) {
125
+ var r_1 = new Array(source.length).fill(everything());
126
+ booleanTarget.forEach(function (b, i) {
127
+ if (b != null) {
128
+ r_1[i] = createComparativeValueRecursive(source[i], b);
129
+ }
130
+ });
131
+ return r_1;
132
+ }
133
+ return undefined;
134
+ }
135
+ if (source == null ||
136
+ typeof source === 'string' ||
137
+ typeof source === 'number' ||
138
+ typeof source === 'function') {
139
+ return source;
140
+ }
141
+ var obj = {};
142
+ var btObj = booleanTarget;
143
+ Object.keys(btObj).forEach(function (key) {
144
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
145
+ obj[key] = createComparativeValueRecursive(source[key], btObj[key]);
146
+ });
147
+ return expect.objectContaining(obj);
148
+ };
149
+ //# sourceMappingURL=hooks.js.map