@redocly/theme 0.1.5 → 0.1.8

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 (376) hide show
  1. package/Footer/Footer.d.ts +3 -0
  2. package/Footer/Footer.js +34 -0
  3. package/Footer/FooterColumn.d.ts +7 -0
  4. package/Footer/FooterColumn.js +38 -0
  5. package/Footer/FooterColumns.d.ts +7 -0
  6. package/Footer/FooterColumns.js +44 -0
  7. package/Footer/FooterCopyright.d.ts +5 -0
  8. package/Footer/FooterCopyright.js +29 -0
  9. package/Footer/index.d.ts +4 -0
  10. package/Footer/index.js +14 -0
  11. package/JsonViewer/JsonViewer.js +1 -1
  12. package/JsonViewer/index.d.ts +1 -0
  13. package/JsonViewer/index.js +1 -0
  14. package/LICENSE +1 -0
  15. package/Layout/PageLayout.d.ts +6 -0
  16. package/Layout/PageLayout.js +30 -0
  17. package/Layout/RootLayout.d.ts +7 -0
  18. package/Layout/RootLayout.js +31 -0
  19. package/Layout/index.d.ts +2 -0
  20. package/Layout/index.js +10 -0
  21. package/Logo/Logo.d.ts +1 -6
  22. package/Markdown/Admonition/Admonition.d.ts +9 -0
  23. package/Markdown/Admonition/Admonition.js +39 -0
  24. package/Markdown/CodeSample/CodeSample.d.ts +8 -0
  25. package/Markdown/CodeSample/CodeSample.js +30 -0
  26. package/Markdown/CodeSample/styled.d.ts +5 -0
  27. package/Markdown/CodeSample/styled.js +109 -0
  28. package/Markdown/CodeSample/types.d.ts +9 -0
  29. package/Markdown/CodeSample/types.js +2 -0
  30. package/Markdown/ContentWrapper.d.ts +5 -0
  31. package/Markdown/ContentWrapper.js +21 -0
  32. package/Markdown/Heading/Heading.d.ts +5 -0
  33. package/Markdown/Heading/Heading.js +23 -0
  34. package/Markdown/MarkdownLayout.d.ts +7 -0
  35. package/Markdown/MarkdownLayout.js +23 -0
  36. package/Markdown/Mermaid/Mermaid.d.ts +6 -0
  37. package/Markdown/Mermaid/Mermaid.js +19 -0
  38. package/Markdown/PageWrapper.d.ts +3 -0
  39. package/Markdown/PageWrapper.js +15 -0
  40. package/Markdown/StyledMarkdown.d.ts +8 -0
  41. package/Markdown/StyledMarkdown.js +54 -0
  42. package/Markdown/Tabs/Tab.d.ts +8 -0
  43. package/Markdown/Tabs/Tab.js +35 -0
  44. package/Markdown/Tabs/Tabs.d.ts +10 -0
  45. package/Markdown/Tabs/Tabs.js +43 -0
  46. package/Navbar/Navbar.d.ts +1 -0
  47. package/Navbar/Navbar.js +7 -1
  48. package/Navbar/NavbarItem.js +1 -1
  49. package/Navbar/NavbarMenu.js +4 -1
  50. package/OperationBadge/OperationBadge.d.ts +5 -0
  51. package/OperationBadge/OperationBadge.js +15 -0
  52. package/OperationBadge/index.d.ts +1 -0
  53. package/OperationBadge/index.js +17 -0
  54. package/PageNavigation/NextPageLink.d.ts +2 -0
  55. package/PageNavigation/NextPageLink.js +25 -0
  56. package/PageNavigation/PageNavigation.d.ts +2 -0
  57. package/PageNavigation/PageNavigation.js +31 -0
  58. package/PageNavigation/PreviousPageLink.d.ts +2 -0
  59. package/PageNavigation/PreviousPageLink.js +25 -0
  60. package/Panel/CodePanel.js +6 -6
  61. package/Panel/ContentPanel.js +4 -4
  62. package/Panel/Panel.d.ts +1 -1
  63. package/Panel/Panel.js +3 -3
  64. package/Panel/PanelComponent.d.ts +1 -1
  65. package/Panel/PanelComponent.js +3 -3
  66. package/Panel/index.d.ts +1 -0
  67. package/Panel/index.js +1 -0
  68. package/Search/Autocomplete.d.ts +13 -0
  69. package/Search/Autocomplete.js +79 -0
  70. package/Search/ClearIcon.d.ts +2 -0
  71. package/Search/ClearIcon.js +29 -0
  72. package/Search/Input.d.ts +3 -0
  73. package/Search/Input.js +15 -0
  74. package/Search/Parameters.d.ts +7 -0
  75. package/Search/Parameters.js +42 -0
  76. package/Search/Popover.d.ts +3 -0
  77. package/Search/Popover.js +15 -0
  78. package/Search/Search.d.ts +2 -0
  79. package/Search/Search.js +39 -0
  80. package/Search/SearchIcon.d.ts +2 -0
  81. package/Search/SearchIcon.js +29 -0
  82. package/Search/SearchItem.d.ts +7 -0
  83. package/Search/SearchItem.js +47 -0
  84. package/Search/utils.d.ts +2 -0
  85. package/Search/utils.js +21 -0
  86. package/Sidebar/ApiCallItem.d.ts +8 -0
  87. package/Sidebar/ApiCallItem.js +35 -0
  88. package/Sidebar/ArrowBack.d.ts +5 -0
  89. package/Sidebar/ArrowBack.js +28 -0
  90. package/Sidebar/BackButton.d.ts +6 -0
  91. package/Sidebar/BackButton.js +30 -0
  92. package/Sidebar/Drilldown.d.ts +8 -0
  93. package/Sidebar/Drilldown.js +45 -0
  94. package/Sidebar/DrilldownMenu.d.ts +3 -0
  95. package/Sidebar/DrilldownMenu.js +57 -0
  96. package/Sidebar/DrilldownMenuItem.d.ts +3 -0
  97. package/Sidebar/DrilldownMenuItem.js +31 -0
  98. package/Sidebar/ExternalIcon.d.ts +5 -0
  99. package/Sidebar/ExternalIcon.js +28 -0
  100. package/Sidebar/Menu.d.ts +4 -0
  101. package/Sidebar/Menu.js +14 -0
  102. package/Sidebar/MenuContainer.d.ts +2 -0
  103. package/Sidebar/MenuContainer.js +12 -0
  104. package/Sidebar/MenuGroup.d.ts +9 -0
  105. package/Sidebar/MenuGroup.js +37 -0
  106. package/Sidebar/MenuItem.d.ts +3 -0
  107. package/Sidebar/MenuItem.js +33 -0
  108. package/Sidebar/MenuItemLabel.d.ts +6 -0
  109. package/Sidebar/MenuItemLabel.js +18 -0
  110. package/Sidebar/MenuLink.d.ts +6 -0
  111. package/Sidebar/MenuLink.js +15 -0
  112. package/Sidebar/MenuLinkItem.d.ts +3 -0
  113. package/Sidebar/MenuLinkItem.js +30 -0
  114. package/Sidebar/MobileSidebarButton.d.ts +6 -0
  115. package/Sidebar/MobileSidebarButton.js +20 -0
  116. package/Sidebar/Separator.d.ts +3 -0
  117. package/Sidebar/Separator.js +31 -0
  118. package/Sidebar/SeparatorItem.d.ts +6 -0
  119. package/Sidebar/SeparatorItem.js +13 -0
  120. package/Sidebar/SeparatorLine.d.ts +4 -0
  121. package/Sidebar/SeparatorLine.js +14 -0
  122. package/Sidebar/Sidebar.d.ts +8 -0
  123. package/Sidebar/Sidebar.js +23 -0
  124. package/Sidebar/SidebarLayout.d.ts +7 -0
  125. package/Sidebar/SidebarLayout.js +35 -0
  126. package/Sidebar/types/DrilldownMenuProps.d.ts +6 -0
  127. package/Sidebar/types/DrilldownMenuProps.js +2 -0
  128. package/Sidebar/types/ItemState.d.ts +9 -0
  129. package/Sidebar/types/ItemState.js +2 -0
  130. package/Sidebar/types/MenuItemProps.d.ts +5 -0
  131. package/Sidebar/types/MenuItemProps.js +2 -0
  132. package/Sidebar/types/MenuStyle.d.ts +3 -0
  133. package/Sidebar/types/MenuStyle.js +8 -0
  134. package/Sidebar/types/NavItem.d.ts +26 -0
  135. package/Sidebar/types/NavItem.js +2 -0
  136. package/SourceCode/SourceCode.js +2 -2
  137. package/TableOfContent/TableOfContent.d.ts +9 -0
  138. package/TableOfContent/TableOfContent.js +64 -0
  139. package/globalStyle.js +1 -1
  140. package/hooks/index.d.ts +4 -0
  141. package/hooks/index.js +4 -0
  142. package/hooks/useActiveHeading.d.ts +2 -0
  143. package/hooks/useActiveHeading.js +34 -0
  144. package/hooks/useActiveSectionId.d.ts +3 -0
  145. package/hooks/useActiveSectionId.js +48 -0
  146. package/hooks/useFullHeight.d.ts +2 -0
  147. package/hooks/useFullHeight.js +47 -0
  148. package/hooks/useMobileMenu.d.ts +2 -0
  149. package/hooks/useMobileMenu.js +13 -0
  150. package/hooks/useNavbarHeight.d.ts +3 -0
  151. package/hooks/useNavbarHeight.js +20 -0
  152. package/icons/ShelfIcon/ShelfIcon.js +2 -2
  153. package/index.d.ts +1 -0
  154. package/index.js +1 -0
  155. package/mocks/hooks/usePageData.d.ts +5 -0
  156. package/mocks/hooks/usePageData.js +7 -0
  157. package/mocks/models.d.ts +3 -0
  158. package/mocks/models.js +2 -0
  159. package/mocks/search.d.ts +22 -0
  160. package/mocks/search.js +13 -0
  161. package/mocks/types/index.d.ts +1 -0
  162. package/mocks/types/index.js +2 -0
  163. package/mocks/usePreloadHistory.d.ts +3 -0
  164. package/mocks/usePreloadHistory.js +12 -0
  165. package/package.json +6 -2
  166. package/src/Button/Button.stories.tsx +1 -1
  167. package/src/Button/__tests__/Button.test.tsx +1 -1
  168. package/src/CodeBlock/__tests__/CodeBlock.test.tsx +1 -1
  169. package/src/CopyButton/CopyButton.stories.tsx +1 -1
  170. package/src/CopyButton/CopyButton.tsx +1 -1
  171. package/src/CopyButton/CopyButtonWrapper.tsx +4 -4
  172. package/src/CopyButton/__tests__/CopyButton.test.tsx +1 -1
  173. package/src/CopyButton/__tests__/CopyButtonWrapper.test.tsx +2 -1
  174. package/src/Footer/Footer.tsx +34 -0
  175. package/src/Footer/FooterColumn.tsx +62 -0
  176. package/src/Footer/FooterColumns.tsx +51 -0
  177. package/src/Footer/FooterCopyright.tsx +26 -0
  178. package/src/Footer/index.tsx +4 -0
  179. package/src/Headings/Headings.stories.tsx +1 -1
  180. package/src/Headings/Headings.ts +1 -1
  181. package/src/Headings/__tests__/Headings.test.tsx +1 -1
  182. package/src/JsonViewer/JsonViewer.stories.tsx +1 -1
  183. package/src/JsonViewer/JsonViewer.tsx +6 -7
  184. package/src/JsonViewer/__tests__/JsonViewer.test.tsx +2 -1
  185. package/src/JsonViewer/index.ts +1 -0
  186. package/src/Layout/PageLayout.tsx +34 -0
  187. package/src/Layout/RootLayout.tsx +24 -0
  188. package/src/Layout/index.tsx +2 -0
  189. package/src/Logo/Logo.tsx +1 -7
  190. package/src/Markdown/Admonition/Admonition.tsx +64 -0
  191. package/src/Markdown/CodeSample/CodeSample.tsx +39 -0
  192. package/src/Markdown/CodeSample/styled.ts +289 -0
  193. package/src/Markdown/CodeSample/types.ts +40 -0
  194. package/src/Markdown/ContentWrapper.tsx +20 -0
  195. package/src/Markdown/Heading/Heading.tsx +35 -0
  196. package/src/Markdown/MarkdownLayout.tsx +25 -0
  197. package/src/Markdown/Mermaid/Mermaid.tsx +23 -0
  198. package/src/Markdown/PageWrapper.tsx +9 -0
  199. package/src/Markdown/StyledMarkdown.tsx +312 -0
  200. package/src/Markdown/Tabs/Tab.tsx +37 -0
  201. package/src/Markdown/Tabs/Tabs.tsx +45 -0
  202. package/src/Navbar/Navbar.stories.tsx +1 -11
  203. package/src/Navbar/Navbar.tsx +19 -25
  204. package/src/Navbar/NavbarItem.tsx +1 -1
  205. package/src/Navbar/NavbarMenu.tsx +4 -4
  206. package/src/OperationBadge/OperationBadge.stories.tsx +35 -0
  207. package/src/OperationBadge/OperationBadge.ts +59 -0
  208. package/src/OperationBadge/__tests__/OperationBadge.test.tsx +59 -0
  209. package/src/OperationBadge/__tests__/__snapshots__/OperationBadge.test.tsx.snap +651 -0
  210. package/src/OperationBadge/index.ts +1 -0
  211. package/src/PageNavigation/NextPageLink.tsx +22 -0
  212. package/src/PageNavigation/PageNavigation.tsx +20 -0
  213. package/src/PageNavigation/PreviousPageLink.tsx +22 -0
  214. package/src/Panel/CodePanel.stories.tsx +1 -2
  215. package/src/Panel/CodePanel.ts +8 -7
  216. package/src/Panel/ContentPanel.stories.tsx +1 -2
  217. package/src/Panel/ContentPanel.ts +5 -6
  218. package/src/Panel/Panel.stories.tsx +1 -3
  219. package/src/Panel/Panel.ts +3 -3
  220. package/src/Panel/PanelComponent.tsx +4 -5
  221. package/src/Panel/__tests__/CodePanel.test.tsx +1 -1
  222. package/src/Panel/__tests__/ContentPanel.test.tsx +1 -1
  223. package/src/Panel/__tests__/Panel.test.tsx +1 -2
  224. package/src/Panel/__tests__/__snapshots__/CodePanel.test.tsx.snap +8 -8
  225. package/src/Panel/__tests__/__snapshots__/ContentPanel.test.tsx.snap +22 -22
  226. package/src/Panel/__tests__/__snapshots__/Panel.test.tsx.snap +16 -16
  227. package/src/Panel/index.ts +1 -0
  228. package/src/SamplesPanelControls/SamplesControlButton.stories.tsx +1 -1
  229. package/src/SamplesPanelControls/SamplesPanelControls.ts +1 -1
  230. package/src/Search/Autocomplete.tsx +128 -0
  231. package/src/Search/ClearIcon.tsx +31 -0
  232. package/src/Search/Input.tsx +19 -0
  233. package/src/Search/Parameters.tsx +62 -0
  234. package/src/Search/Popover.tsx +20 -0
  235. package/src/Search/Search.tsx +52 -0
  236. package/src/Search/SearchIcon.tsx +32 -0
  237. package/src/Search/SearchItem.tsx +85 -0
  238. package/src/Search/utils.tsx +19 -0
  239. package/src/Sidebar/ApiCallItem.tsx +33 -0
  240. package/src/Sidebar/ArrowBack.tsx +22 -0
  241. package/src/Sidebar/BackButton.tsx +44 -0
  242. package/src/Sidebar/Drilldown.tsx +46 -0
  243. package/src/Sidebar/DrilldownMenu.tsx +58 -0
  244. package/src/Sidebar/DrilldownMenuItem.tsx +40 -0
  245. package/src/Sidebar/ExternalIcon.tsx +37 -0
  246. package/src/Sidebar/Menu.tsx +11 -0
  247. package/src/Sidebar/MenuContainer.tsx +8 -0
  248. package/src/Sidebar/MenuGroup.tsx +55 -0
  249. package/src/Sidebar/MenuItem.tsx +25 -0
  250. package/src/Sidebar/MenuItemLabel.tsx +41 -0
  251. package/src/Sidebar/MenuLink.tsx +14 -0
  252. package/src/Sidebar/MenuLinkItem.tsx +24 -0
  253. package/src/Sidebar/MobileSidebarButton.tsx +44 -0
  254. package/src/Sidebar/Separator.tsx +17 -0
  255. package/src/Sidebar/SeparatorItem.tsx +14 -0
  256. package/src/Sidebar/SeparatorLine.tsx +9 -0
  257. package/src/Sidebar/Sidebar.tsx +54 -0
  258. package/src/Sidebar/SidebarLayout.tsx +30 -0
  259. package/src/Sidebar/types/DrilldownMenuProps.ts +7 -0
  260. package/src/Sidebar/types/ItemState.ts +11 -0
  261. package/src/Sidebar/types/MenuItemProps.ts +6 -0
  262. package/src/Sidebar/types/MenuStyle.ts +4 -0
  263. package/src/Sidebar/types/NavItem.ts +27 -0
  264. package/src/SidebarLogo/SidebarLogo.stories.tsx +1 -1
  265. package/src/SidebarLogo/__tests__/SidebarLogo.test.tsx +1 -1
  266. package/src/SourceCode/SourceCode.stories.tsx +1 -1
  267. package/src/SourceCode/SourceCode.tsx +7 -3
  268. package/src/SourceCode/__tests__/SourceCode.test.tsx +2 -1
  269. package/src/TableOfContent/TableOfContent.tsx +112 -0
  270. package/src/Tooltip/Tooltip.stories.tsx +1 -1
  271. package/src/Tooltip/Tooltip.tsx +1 -1
  272. package/src/Tooltip/__tests__/Tooltip.test.tsx +1 -1
  273. package/src/globalStyle.ts +10 -73
  274. package/src/hooks/index.ts +4 -0
  275. package/src/hooks/useActiveHeading.ts +46 -0
  276. package/src/hooks/useActiveSectionId.ts +53 -0
  277. package/src/hooks/useFullHeight.ts +47 -0
  278. package/src/hooks/useMobileMenu.ts +11 -0
  279. package/src/hooks/useNavbarHeight.ts +24 -0
  280. package/src/icons/ShelfIcon/ShelfIcon.stories.tsx +1 -1
  281. package/src/icons/ShelfIcon/ShelfIcon.tsx +1 -1
  282. package/src/icons/ShelfIcon/__tests__/ShelfIcon.test.tsx +1 -1
  283. package/src/index.ts +1 -0
  284. package/src/mocks/hooks/usePageData.ts +8 -0
  285. package/src/mocks/models.ts +3 -0
  286. package/src/mocks/search.ts +31 -0
  287. package/src/mocks/types/index.ts +1 -0
  288. package/src/mocks/usePreloadHistory.ts +9 -0
  289. package/src/types/portal/index.d.ts +6 -0
  290. package/src/types/portal/src/client/app/Sidebar/types.d.ts +50 -0
  291. package/src/types/portal/src/client/app/media-css.d.ts +7 -0
  292. package/src/types/portal/src/client/styling/default.d.ts +407 -0
  293. package/src/types/portal/src/client/styling/index.d.ts +14 -0
  294. package/src/types/portal/src/client/styling/resolve.d.ts +1 -0
  295. package/src/types/portal/src/server/constants.d.ts +11 -0
  296. package/src/types/portal/src/server/plugins/markdown/types.d.ts +28 -0
  297. package/src/types/portal/src/server/plugins/nav-utils.d.ts +19 -0
  298. package/src/types/portal/src/server/plugins/portal-config/types.d.ts +23 -0
  299. package/src/types/portal/src/server/plugins/sidebars/index.d.ts +16 -0
  300. package/src/types/portal/src/server/plugins/versions/index.d.ts +15 -0
  301. package/src/types/portal/src/server/plugins/versions/types.d.ts +23 -0
  302. package/src/types/portal/src/server/plugins/versions/utils.d.ts +10 -0
  303. package/src/types/portal/src/server/store.d.ts +101 -0
  304. package/src/types/portal/src/server/utils/async.d.ts +5 -0
  305. package/src/types/portal/src/server/utils/crypto.d.ts +3 -0
  306. package/src/types/portal/src/server/utils/fs.d.ts +3 -0
  307. package/src/types/portal/src/server/utils/index.d.ts +6 -0
  308. package/src/types/portal/src/server/utils/paths.d.ts +16 -0
  309. package/src/types/portal/src/server/utils/reporter/formatter.d.ts +11 -0
  310. package/src/types/portal/src/server/utils/reporter/reporter.d.ts +17 -0
  311. package/src/types/portal/src/server/utils/watcher.d.ts +16 -0
  312. package/src/types/portal/src/server/utils/yaml.d.ts +1 -0
  313. package/src/types/portal/src/shared/constants.d.ts +8 -0
  314. package/src/types/portal/src/shared/types.d.ts +77 -0
  315. package/src/types/portal/src/shared/urls.d.ts +7 -0
  316. package/src/types/portal/src/shared/utils.d.ts +10 -0
  317. package/src/ui/AlertIcon.tsx +110 -0
  318. package/src/ui/Arrow/Arrow.tsx +36 -0
  319. package/src/ui/Background.tsx +16 -0
  320. package/src/ui/Box.tsx +39 -0
  321. package/src/ui/Button.tsx +19 -0
  322. package/src/ui/Dropdown.tsx +132 -0
  323. package/src/ui/Flex.tsx +21 -0
  324. package/src/ui/Jumbotron.tsx +57 -0
  325. package/src/ui/Tiles/ThinTile.tsx +151 -0
  326. package/src/ui/Tiles/TileHeader.ts +13 -0
  327. package/src/ui/Tiles/TileText.tsx +12 -0
  328. package/src/ui/Tiles/WideTile.tsx +138 -0
  329. package/src/ui/Typography.tsx +167 -0
  330. package/src/ui/UniversalLink.tsx +100 -0
  331. package/src/ui/index.tsx +12 -0
  332. package/src/utils/__tests__/ClipboardService.test.ts +1 -1
  333. package/src/utils/__tests__/css-variables.test.ts +1 -1
  334. package/src/utils/__tests__/highlight.test.ts +1 -1
  335. package/src/utils/__tests__/jsonToHtml.test.ts +1 -1
  336. package/src/utils/__tests__/media-css.test.ts +1 -1
  337. package/src/utils/__tests__/theme-helpers.test.ts +1 -1
  338. package/src/utils/getNavbarElement.ts +10 -0
  339. package/src/utils/isUrl.ts +42 -0
  340. package/src/utils/replaceHashInColor.ts +3 -0
  341. package/ui/AlertIcon.d.ts +9 -0
  342. package/ui/AlertIcon.js +45 -0
  343. package/ui/Arrow/Arrow.d.ts +7 -0
  344. package/ui/Arrow/Arrow.js +42 -0
  345. package/ui/Background.d.ts +7 -0
  346. package/ui/Background.js +16 -0
  347. package/ui/Box.d.ts +6 -0
  348. package/ui/Box.js +16 -0
  349. package/ui/Button.d.ts +7 -0
  350. package/ui/Button.js +27 -0
  351. package/ui/Dropdown.d.ts +8 -0
  352. package/ui/Dropdown.js +54 -0
  353. package/ui/Flex.d.ts +10 -0
  354. package/ui/Flex.js +31 -0
  355. package/ui/Jumbotron.d.ts +18 -0
  356. package/ui/Jumbotron.js +44 -0
  357. package/ui/Tiles/ThinTile.d.ts +21 -0
  358. package/ui/Tiles/ThinTile.js +98 -0
  359. package/ui/Tiles/TileHeader.d.ts +5 -0
  360. package/ui/Tiles/TileHeader.js +15 -0
  361. package/ui/Tiles/TileText.d.ts +5 -0
  362. package/ui/Tiles/TileText.js +15 -0
  363. package/ui/Tiles/WideTile.d.ts +7 -0
  364. package/ui/Tiles/WideTile.js +93 -0
  365. package/ui/Typography.d.ts +110 -0
  366. package/ui/Typography.js +137 -0
  367. package/ui/UniversalLink.d.ts +17 -0
  368. package/ui/UniversalLink.js +62 -0
  369. package/ui/index.d.ts +10 -0
  370. package/ui/index.js +30 -0
  371. package/utils/getNavbarElement.d.ts +1 -0
  372. package/utils/getNavbarElement.js +14 -0
  373. package/utils/isUrl.d.ts +12 -0
  374. package/utils/isUrl.js +35 -0
  375. package/utils/replaceHashInColor.d.ts +1 -0
  376. package/utils/replaceHashInColor.js +6 -0
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { render } from '@testing-library/react';
3
3
 
4
- import { ShelfIcon } from '../ShelfIcon';
4
+ import { ShelfIcon } from '@theme/icons/ShelfIcon';
5
5
 
6
6
  describe('ShelfIcon', () => {
7
7
  it('renders right', () => {
package/src/index.ts CHANGED
@@ -12,3 +12,4 @@ export * from './icons';
12
12
  export * from './hooks';
13
13
  export * from './utils';
14
14
  export * from './globalStyle';
15
+ export * from './OperationBadge';
@@ -0,0 +1,8 @@
1
+ import type { ResolvedNavLinkItem } from '@theme/types/portal';
2
+
3
+ export function usePageData(): {
4
+ prevPage: ResolvedNavLinkItem | null;
5
+ nextPage: ResolvedNavLinkItem | null;
6
+ } {
7
+ return { prevPage: null, nextPage: null };
8
+ }
@@ -0,0 +1,3 @@
1
+ export type ActiveItem<T> = T;
2
+ export type SearchDocument = any;
3
+ export type OperationParameter = any;
@@ -0,0 +1,31 @@
1
+ interface OperationParameter {
2
+ name: string | string[];
3
+ description: string | string[];
4
+ place: string;
5
+ path?: string[];
6
+ }
7
+
8
+ interface SearchDocument {
9
+ id: string;
10
+ url: string;
11
+ title: string | string[];
12
+ text: string | string[];
13
+ path?: string[];
14
+ httpVerb?: string;
15
+ pathName?: string | string[];
16
+ parameters?: OperationParameter[];
17
+ }
18
+
19
+ export function useFuseSearch(): {
20
+ query: string;
21
+ setQuery: (val: string) => void;
22
+ items: SearchDocument[];
23
+ } {
24
+ return {
25
+ query: '',
26
+ setQuery(val: string) {
27
+ this.query = val;
28
+ },
29
+ items: [],
30
+ };
31
+ }
@@ -0,0 +1 @@
1
+ export type ResolvedNavLinkItem = any;
@@ -0,0 +1,9 @@
1
+ export function usePreloadHistory(): { push: (url: string) => void } {
2
+ const history = [];
3
+
4
+ return {
5
+ push: (url: string): void => {
6
+ history.push(url);
7
+ },
8
+ };
9
+ }
@@ -0,0 +1,6 @@
1
+ export * from './src/client/styling';
2
+ export * from './src/client/app/Sidebar/types';
3
+ export * from './src/server/plugins/portal-config/types';
4
+ export * from './src/shared/types';
5
+ export * from './src/server/plugins/versions/types';
6
+ export type { MdHeading } from './src/server/plugins/markdown/types';
@@ -0,0 +1,50 @@
1
+ import { Location } from 'history';
2
+ import { MenuStyle } from '../../../shared/types';
3
+ import type { Version } from '../../../server/plugins/versions/types';
4
+ export interface SidebarNavItem {
5
+ label?: string;
6
+ sublabel?: string;
7
+ icon?: string;
8
+ link?: string;
9
+ type?: string;
10
+ httpVerb?: string;
11
+ expanded?: string;
12
+ selectFirstItemOnExpand?: boolean;
13
+ pageId?: string;
14
+ redocPrevLink?: string;
15
+ redocPrevLabel?: string;
16
+ redocNextLink?: string;
17
+ redocNextLabel?: string;
18
+ redocFakePage?: boolean;
19
+ redocInfoPageId?: string;
20
+ target?: string;
21
+ external?: boolean;
22
+ items?: SidebarNavItem[];
23
+ permission?: string;
24
+ menuStyle?: MenuStyle;
25
+ separatorLine?: boolean;
26
+ version?: string;
27
+ default?: boolean;
28
+ }
29
+ export interface ItemState extends SidebarNavItem {
30
+ items: ItemState[];
31
+ active: boolean;
32
+ hasActiveSubItem: boolean;
33
+ menuStyle?: MenuStyle | null;
34
+ }
35
+ export interface MenuProps {
36
+ items: SidebarNavItem[];
37
+ location: Location;
38
+ pageId: string;
39
+ versions?: Version[];
40
+ }
41
+ export declare enum MenuType {
42
+ Separator = 'separator',
43
+ DrillDown = 'drilldown',
44
+ Group = 'group',
45
+ Operation = 'operation',
46
+ }
47
+ export interface MenuItemProps {
48
+ item: ItemState;
49
+ activeItem?: ItemState;
50
+ }
@@ -0,0 +1,7 @@
1
+ export declare const breakpoints: {
2
+ small: string;
3
+ medium: string;
4
+ large: string;
5
+ };
6
+ export declare const mediaQueries: import('@theme/utils/media-css').MediaQueries;
7
+ export type { MediaQueries } from '@theme/utils/media-css';
@@ -0,0 +1,407 @@
1
+ export declare const defaultTheme: {
2
+ spacing: {
3
+ unit: number;
4
+ sectionHorizontal: ({ spacing }: { spacing: any }) => number;
5
+ sectionVertical: ({ spacing }: { spacing: any }) => number;
6
+ };
7
+ components: {
8
+ buttons: {
9
+ borderRadius: ({ shape }: { shape: any }) => any;
10
+ hoverStyle: string;
11
+ fontWeight: ({ typography }: { typography: any }) => any;
12
+ boxShadow: string;
13
+ hoverBoxShadow: string;
14
+ fontFamily: string;
15
+ sizes: {
16
+ small: {
17
+ fontSize: string;
18
+ padding: string;
19
+ minWidth: string;
20
+ };
21
+ medium: {
22
+ fontSize: string;
23
+ padding: string;
24
+ minWidth: string;
25
+ };
26
+ large: {
27
+ fontSize: string;
28
+ padding: string;
29
+ minWidth: string;
30
+ };
31
+ xlarge: {
32
+ fontSize: string;
33
+ padding: string;
34
+ minWidth: string;
35
+ };
36
+ };
37
+ };
38
+ search: {
39
+ icon: string;
40
+ iconColor: ({ colors }: { colors: any }) => any;
41
+ };
42
+ alert: {
43
+ marginHorizontal: string;
44
+ marginVertical: ({ spacing }: { spacing: any }) => string;
45
+ paddingHorizontal: ({ spacing }: { spacing: any }) => string;
46
+ paddingVertical: ({ spacing }: { spacing: any }) => string;
47
+ borderRadius: string;
48
+ iconSize: string;
49
+ fontSize: string;
50
+ fontWeight: string;
51
+ lineHeight: string;
52
+ heading: {
53
+ fontSize: string;
54
+ fontWeight: string;
55
+ lineHeight: string;
56
+ letterSpacing: string;
57
+ transform: string;
58
+ };
59
+ variants: {
60
+ info: {
61
+ backgroundColor: string;
62
+ textColor: ({ colors }: { colors: any }) => any;
63
+ headingColor: ({ colors }: { colors: any }) => any;
64
+ iconColor: ({ colors }: { colors: any }) => any;
65
+ icon: string;
66
+ };
67
+ attention: {
68
+ backgroundColor: ({ colors }: { colors: any }) => any;
69
+ textColor: ({ colors }: { colors: any }) => any;
70
+ headingColor: ({ colors }: { colors: any }) => any;
71
+ iconColor: ({ colors }: { colors: any }) => any;
72
+ icon: string;
73
+ };
74
+ warning: {
75
+ backgroundColor: ({ colors }: { colors: any }) => any;
76
+ textColor: ({ colors }: { colors: any }) => any;
77
+ headingColor: ({ colors }: { colors: any }) => any;
78
+ iconColor: ({ colors }: { colors: any }) => any;
79
+ icon: string;
80
+ };
81
+ danger: {
82
+ backgroundColor: ({ colors }: { colors: any }) => any;
83
+ textColor: ({ colors }: { colors: any }) => any;
84
+ headingColor: ({ colors }: { colors: any }) => any;
85
+ iconColor: ({ colors }: { colors: any }) => any;
86
+ icon: string;
87
+ };
88
+ success: {
89
+ backgroundColor: ({ colors }: { colors: any }) => any;
90
+ textColor: ({ colors }: { colors: any }) => any;
91
+ headingColor: ({ colors }: { colors: any }) => any;
92
+ iconColor: ({ colors }: { colors: any }) => any;
93
+ icon: string;
94
+ };
95
+ };
96
+ };
97
+ panels: {
98
+ borderRadius: string;
99
+ };
100
+ shape: {
101
+ borderRadius: string;
102
+ };
103
+ blockquote: {
104
+ marginHorizontal: string;
105
+ marginVertical: string;
106
+ paddingHorizontal: ({ spacing }: { spacing: any }) => string;
107
+ paddingVertical: string;
108
+ backgroundColor: string;
109
+ borderRadius: string;
110
+ borderLeft: ({ colors }: { colors: any }) => string;
111
+ color: ({ colors }: { colors: any }) => any;
112
+ };
113
+ contentWrapper: {
114
+ maxWidth: string;
115
+ paddingHorizontal: string;
116
+ paddingVertical: string;
117
+ };
118
+ login: {
119
+ avatarBorderRadius: ({ navbar }: { navbar: any }) => any;
120
+ avatarBgColor: string;
121
+ };
122
+ layoutControls: {
123
+ top: string;
124
+ };
125
+ httpBadges: {
126
+ borderRadius: string;
127
+ fontFamily: ({ typography }: { typography: any }) => any;
128
+ fontWeight: ({ typography }: { typography: any }) => any;
129
+ color: ({ colors }: { colors: any }) => any;
130
+ sizes: {
131
+ medium: {
132
+ fontSize: string;
133
+ lineHeight: string;
134
+ };
135
+ small: {
136
+ fontSize: string;
137
+ lineHeight: string;
138
+ };
139
+ };
140
+ };
141
+ tryItButton: {
142
+ fullWidth: boolean;
143
+ };
144
+ tryItSendButton: {
145
+ fullWidth: boolean;
146
+ };
147
+ };
148
+ breakpoints: {
149
+ small: string;
150
+ medium: string;
151
+ large: string;
152
+ };
153
+ shape: {
154
+ borderRadius: string;
155
+ };
156
+ colors: {
157
+ background: string;
158
+ tonalOffset: number;
159
+ primary: {
160
+ main: string;
161
+ light: ({ colors }: { colors: any }) => string;
162
+ dark: ({ colors }: { colors: any }) => string;
163
+ contrastText: ({ colors }: { colors: any }) => string;
164
+ };
165
+ secondary: {
166
+ main: string;
167
+ light: string;
168
+ dark: string;
169
+ contrastText: string;
170
+ };
171
+ accent: {
172
+ main: string;
173
+ light: string;
174
+ dark: string;
175
+ contrastText: string;
176
+ };
177
+ success: {
178
+ main: string;
179
+ light: ({ colors }: { colors: any }) => string;
180
+ dark: ({ colors }: { colors: any }) => string;
181
+ contrastText: ({ colors }: { colors: any }) => string;
182
+ };
183
+ error: {
184
+ main: string;
185
+ light: ({ colors }: { colors: any }) => string;
186
+ dark: ({ colors }: { colors: any }) => string;
187
+ contrastText: ({ colors }: { colors: any }) => string;
188
+ };
189
+ warning: {
190
+ main: string;
191
+ light: ({ colors }: { colors: any }) => string;
192
+ dark: ({ colors }: { colors: any }) => string;
193
+ contrastText: ({ colors }: { colors: any }) => string;
194
+ };
195
+ info: {
196
+ main: string;
197
+ light: ({ colors }: { colors: any }) => string;
198
+ dark: ({ colors }: { colors: any }) => string;
199
+ contrastText: ({ colors }: { colors: any }) => string;
200
+ };
201
+ text: {
202
+ primary: string;
203
+ secondary: string;
204
+ light: string;
205
+ };
206
+ border: {
207
+ dark: string;
208
+ light: string;
209
+ };
210
+ responses: {
211
+ success: {
212
+ color: ({ colors }: { colors: any }) => any;
213
+ backgroundColor: ({ colors }: { colors: any }) => string;
214
+ };
215
+ error: {
216
+ color: ({ colors }: { colors: any }) => any;
217
+ backgroundColor: ({ colors }: { colors: any }) => string;
218
+ };
219
+ redirect: {
220
+ color: ({ colors }: { colors: any }) => any;
221
+ backgroundColor: ({ colors }: { colors: any }) => string;
222
+ };
223
+ info: {
224
+ color: ({ colors }: { colors: any }) => any;
225
+ backgroundColor: ({ colors }: { colors: any }) => string;
226
+ };
227
+ };
228
+ http: {
229
+ get: string;
230
+ post: string;
231
+ put: string;
232
+ options: string;
233
+ patch: string;
234
+ delete: string;
235
+ basic: string;
236
+ link: string;
237
+ head: string;
238
+ };
239
+ navbar: {
240
+ main: ({ colors }: { colors: any }) => any;
241
+ gradient: ({ colors }: { colors: any }) => string;
242
+ contrastText: ({ colors }: { colors: any }) => string;
243
+ };
244
+ footer: {
245
+ main: ({ colors }: { colors: any }) => any;
246
+ contrastText: ({ colors }: { colors: any }) => any;
247
+ };
248
+ };
249
+ sidebar: {
250
+ showAtBreakpoint: string;
251
+ backgroundColor: string;
252
+ width: string;
253
+ textColor: string;
254
+ textColorSecondary: string;
255
+ activeTextColor: ({ sidebar }: { sidebar: any }) => any;
256
+ activeBgColor: string;
257
+ separatorLineColor: string;
258
+ rightLineColor: string;
259
+ separatorLabelColor: ({ sidebar }: { sidebar: any }) => any;
260
+ caretColor: ({ sidebar }: { sidebar: any }) => any;
261
+ caretSize: ({ sidebar }: { sidebar: any }) => any;
262
+ spacing: {
263
+ unit: number;
264
+ paddingHorizontal: ({ sidebar }: { sidebar: any }) => any;
265
+ paddingVertical: ({ sidebar }: { sidebar: any }) => any;
266
+ offsetTop: ({ sidebar }: { sidebar: any }) => number;
267
+ offsetLeft: ({ sidebar }: { sidebar: any }) => number;
268
+ offsetNesting: ({ sidebar }: { sidebar: any }) => number;
269
+ };
270
+ borderRadius: string;
271
+ fontFamily: ({ typography }: { typography: any }) => any;
272
+ fontSize: ({ typography }: { typography: any }) => any;
273
+ };
274
+ navbar: {
275
+ height: string;
276
+ borderRadius: string;
277
+ marginHorizontal: string;
278
+ marginVertical: string;
279
+ activeTextColor: ({ colors }: { colors: any }) => any;
280
+ activeBgColor: ({ colors }: { colors: any }) => string;
281
+ activeTextDecoration: string;
282
+ fontWeight: number;
283
+ fontSize: string;
284
+ };
285
+ tocPanel: {
286
+ width: string;
287
+ };
288
+ logo: {
289
+ maxWidth: string;
290
+ maxHeight: string;
291
+ height: string;
292
+ margin: ({ sidebar }: { sidebar: any }) => string;
293
+ };
294
+ typography: {
295
+ fontSize: string;
296
+ lineHeight: string;
297
+ fontWeightRegular: string;
298
+ fontWeightBold: string;
299
+ fontWeightLight: string;
300
+ fontFamily: string;
301
+ headings: {
302
+ fontFamily: string;
303
+ fontWeight: string;
304
+ };
305
+ fieldName: {
306
+ fontSize: ({ typography }: { typography: any }) => any;
307
+ fontFamily: ({ typography }: { typography: any }) => any;
308
+ fontWeight: ({ typography }: { typography: any }) => any;
309
+ };
310
+ heading1: {
311
+ fontSize: string;
312
+ fontWeight: string;
313
+ fontFamily: ({ typography }: { typography: any }) => any;
314
+ lineHeight: ({ typography }: { typography: any }) => any;
315
+ color: ({ colors }: { colors: any }) => any;
316
+ capitalize: boolean;
317
+ marginTop: string;
318
+ marginBottom: string;
319
+ };
320
+ heading2: {
321
+ fontSize: string;
322
+ fontWeight: string;
323
+ color: ({ colors }: { colors: any }) => any;
324
+ fontFamily: ({ typography }: { typography: any }) => any;
325
+ lineHeight: ({ typography }: { typography: any }) => any;
326
+ capitalize: boolean;
327
+ marginTop: string;
328
+ marginBottom: string;
329
+ };
330
+ heading3: {
331
+ fontSize: string;
332
+ fontWeight: string;
333
+ color: ({ colors }: { colors: any }) => any;
334
+ fontFamily: ({ typography }: { typography: any }) => any;
335
+ lineHeight: ({ typography }: { typography: any }) => any;
336
+ capitalize: boolean;
337
+ marginTop: string;
338
+ marginBottom: string;
339
+ };
340
+ heading4: {};
341
+ heading5: {};
342
+ heading6: {};
343
+ rightPanelHeading: {};
344
+ code: {
345
+ fontSize: string;
346
+ fontFamily: string;
347
+ fontWeight: ({ typography }: { typography: any }) => any;
348
+ color: string;
349
+ backgroundColor: string;
350
+ wrap: boolean;
351
+ };
352
+ links: {
353
+ color: ({ colors }: { colors: any }) => any;
354
+ visited: ({ typography }: { typography: any }) => any;
355
+ hover: ({ typography }: { typography: any }) => string;
356
+ textDecoration: string;
357
+ };
358
+ };
359
+ rightPanel: {
360
+ showAtBreakpoint: string;
361
+ backgroundColor: string;
362
+ width: string;
363
+ textColor: string;
364
+ panelBackgroundColor: string;
365
+ panelControlsBackgroundColor: string;
366
+ };
367
+ schema: {
368
+ linesColor: (theme: any) => any;
369
+ defaultDetailsWidth: string;
370
+ typeNameColor: (theme: any) => any;
371
+ typeTitleColor: (theme: any) => any;
372
+ requireLabelColor: string;
373
+ labelsTextSize: string;
374
+ nestingSpacing: string;
375
+ nestedBackground: (theme: any) => any;
376
+ caretColor: ({ colors }: { colors: any }) => any;
377
+ caretSize: string;
378
+ };
379
+ codeBlock: {
380
+ backgroundColor: ({ rightPanel }: { rightPanel: any }) => any;
381
+ copyButton: {
382
+ visibleText: ({ codeBlock }: { codeBlock: any }) => string;
383
+ contrastText: ({ codeBlock }: { codeBlock: any }) => string;
384
+ background: ({ codeBlock }: { codeBlock: any }) => string;
385
+ };
386
+ tokens: {};
387
+ };
388
+ layout: {
389
+ showDarkRightPanel: boolean;
390
+ stacked: {
391
+ maxWidth: {
392
+ _: string;
393
+ small: string;
394
+ medium: string;
395
+ large: string;
396
+ };
397
+ };
398
+ 'three-panel': {
399
+ maxWidth: {
400
+ _: string;
401
+ small: string;
402
+ medium: string;
403
+ large: string;
404
+ };
405
+ };
406
+ };
407
+ };
@@ -0,0 +1,14 @@
1
+ import type { MediaQueries } from './../app/media-css';
2
+ import { defaultTheme } from './default.js';
3
+ export declare const theme: AppTheme;
4
+ declare type InferDeep<T extends object> = {
5
+ [k in keyof T]: T[k] extends (...args: any) => any
6
+ ? ReturnType<T[k]>
7
+ : T[k] extends object
8
+ ? InferDeep<T[k]>
9
+ : T[k];
10
+ };
11
+ export declare type AppTheme = InferDeep<typeof defaultTheme> & {
12
+ mediaQueries: MediaQueries;
13
+ };
14
+ export {};
@@ -0,0 +1 @@
1
+ export declare function resolveTheme(theme: any): any;
@@ -0,0 +1,11 @@
1
+ export declare enum cliCommandNames {
2
+ BUILD = 'build',
3
+ DEVELOP = 'develop',
4
+ }
5
+ export declare const VERSION_SEPARATOR = '@';
6
+ export declare const DEFAULT_VERSION_NAME = 'default';
7
+ export declare enum PageType {
8
+ MARKDOWN = 'Markdown',
9
+ REFERENCE_DOCS = 'ReferenceDocs',
10
+ REACT = 'React',
11
+ }
@@ -0,0 +1,28 @@
1
+ import { Config, RenderNodes } from '@markdoc/markdoc/dist/src/types';
2
+ import type { Page } from '../../store';
3
+ import type { VersionsConfigType } from '../versions/types';
4
+ export declare type MarkdownOptions = {
5
+ contentDir: string;
6
+ version?: string;
7
+ versionsConfig: Map<string, VersionsConfigType>;
8
+ pages: Map<string, Page>;
9
+ allPagesPaths: string[];
10
+ outdir: string;
11
+ };
12
+ export interface MdHeading {
13
+ id: string;
14
+ value: string;
15
+ depth: number;
16
+ }
17
+ export interface MdCompilationResult {
18
+ result: RenderNodes;
19
+ headings: MdHeading[];
20
+ }
21
+ export declare type MdCompilationContext = {
22
+ absolutePath: string;
23
+ content: string;
24
+ contentHash: string;
25
+ } & MarkdownOptions;
26
+ export interface ExtendedMarkdocConfig extends Config {
27
+ currentProcessedPage?: string;
28
+ }
@@ -0,0 +1,19 @@
1
+ import { Page, Store } from '../store.js';
2
+ import type { ResolvedNavItem, NavItem, RawNavItem } from '../../shared/types.js';
3
+ export declare function normalizeItems(items: RawNavItem[]): NavItem[];
4
+ export declare function resolveVersionItems(
5
+ items: RawNavItem[],
6
+ store: Store,
7
+ versions?: any,
8
+ ): RawNavItem[];
9
+ export declare function resolvePage(pagePath: string, fromFile: string, store: Store): Page;
10
+ export declare function resolveItems(
11
+ items: NavItem[],
12
+ fromFile: string,
13
+ store: Store,
14
+ ): Promise<ResolvedNavItem[]>;
15
+ export declare function resolveItem(
16
+ item: NavItem,
17
+ fromFile: string,
18
+ store: Store,
19
+ ): Promise<ResolvedNavItem | ResolvedNavItem[]>;
@@ -0,0 +1,23 @@
1
+ import { LogoConfig, RawNavItem, ResolvedNavItem } from '../../../shared/types.js';
2
+ export interface PortalConfig extends Record<string, any> {
3
+ nav?: RawNavItem[];
4
+ logo?: LogoConfig;
5
+ themes?: CustomTheme[];
6
+ footer?: FooterConfig;
7
+ }
8
+ export interface CustomTheme {
9
+ name: string;
10
+ settings?: any;
11
+ themeStyles?: string;
12
+ }
13
+ export interface FooterConfig {
14
+ copyrightText?: string;
15
+ columns?: FooterColumn[];
16
+ }
17
+ export interface FooterColumn {
18
+ group: string;
19
+ label?: string;
20
+ items: ResolvedNavItem[];
21
+ }
22
+ export declare type CustomEntryPropertyType = Record<string, string | boolean>;
23
+ export declare type ScriptOrStylesheetConfig = string | CustomEntryPropertyType;
@@ -0,0 +1,16 @@
1
+ import type { NavItem, RawNavItem, ResolvedNavItem } from '../../../shared/types.js';
2
+ import { Page, Store } from '../../store.js';
3
+ import { Watcher } from '../../utils/index.js';
4
+ export declare function sidebarsPlugin(watcher: Watcher, store: Store): void;
5
+ export declare class Sidebar {
6
+ absolutePath: string;
7
+ id: string;
8
+ store: Store;
9
+ hash: string;
10
+ dirname: string;
11
+ items: NavItem[];
12
+ constructor(absolutePath: string, items: RawNavItem[], id: string, store: Store);
13
+ resolve(): Promise<ResolvedNavItem[]>;
14
+ getDependentPages(): Set<Page>;
15
+ private collectDependentPages;
16
+ }
@@ -0,0 +1,15 @@
1
+ import type { AllFilesType } from './types.js';
2
+ import { Watcher } from '../../utils/index.js';
3
+ import type { Store } from '../../store.js';
4
+ export declare function allFilesPaths(): AllFilesType;
5
+ export declare const existingVersionPages: Set<string>;
6
+ export declare function initVersionPlugin(
7
+ contentDir: string,
8
+ store: Store,
9
+ allFiles: AllFilesType,
10
+ ): void;
11
+ export declare function versionsPlugin(
12
+ watcher: Watcher,
13
+ store: Store,
14
+ allFiles: AllFilesType,
15
+ ): void;