@redocly/theme 0.1.8 → 0.1.11

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 (322) hide show
  1. package/Button/index.d.ts +1 -1
  2. package/Button/index.js +1 -1
  3. package/CodeBlock/index.d.ts +1 -1
  4. package/CodeBlock/index.js +1 -1
  5. package/CopyButton/index.d.ts +2 -2
  6. package/CopyButton/index.js +2 -2
  7. package/Footer/Footer.d.ts +2 -2
  8. package/Footer/Footer.js +6 -5
  9. package/Footer/FooterColumn.d.ts +1 -1
  10. package/Footer/FooterColumn.js +8 -7
  11. package/Footer/FooterColumns.d.ts +3 -3
  12. package/Footer/FooterColumns.js +4 -4
  13. package/Footer/FooterCopyright.d.ts +3 -3
  14. package/Footer/FooterCopyright.js +3 -2
  15. package/Footer/index.d.ts +4 -4
  16. package/Footer/index.js +17 -11
  17. package/Headings/index.d.ts +1 -1
  18. package/Headings/index.js +1 -1
  19. package/JsonViewer/index.d.ts +2 -2
  20. package/JsonViewer/index.js +2 -2
  21. package/Layout/PageLayout.d.ts +1 -1
  22. package/Layout/PageLayout.js +2 -1
  23. package/Layout/RootLayout.d.ts +1 -1
  24. package/Layout/RootLayout.js +2 -1
  25. package/Layout/index.d.ts +2 -2
  26. package/Layout/index.js +15 -7
  27. package/Markdown/{Admonition/Admonition.d.ts → Admonition.d.ts} +0 -0
  28. package/Markdown/{Admonition/Admonition.js → Admonition.js} +5 -5
  29. package/Markdown/CodeSample/index.d.ts +3 -0
  30. package/Markdown/CodeSample/index.js +19 -0
  31. package/Markdown/{Heading/Heading.d.ts → Heading.d.ts} +0 -0
  32. package/Markdown/{Heading/Heading.js → Heading.js} +1 -1
  33. package/Markdown/MarkdownLayout.d.ts +2 -2
  34. package/Markdown/{Mermaid/Mermaid.d.ts → Mermaid.d.ts} +0 -0
  35. package/Markdown/{Mermaid/Mermaid.js → Mermaid.js} +0 -0
  36. package/Markdown/StyledMarkdown.js +2 -2
  37. package/Markdown/Tabs/index.d.ts +2 -0
  38. package/Markdown/Tabs/index.js +18 -0
  39. package/Markdown/index.d.ts +9 -0
  40. package/Markdown/index.js +25 -0
  41. package/Navbar/Navbar.d.ts +1 -2
  42. package/Navbar/Navbar.js +3 -3
  43. package/Navbar/NavbarItem.d.ts +1 -1
  44. package/Navbar/NavbarItem.js +3 -3
  45. package/Navbar/NavbarMenu.d.ts +1 -1
  46. package/Navbar/NavbarMenu.js +5 -4
  47. package/Navbar/index.d.ts +3 -0
  48. package/Navbar/index.js +19 -0
  49. package/NavbarLogo/NavbarLogo.d.ts +6 -0
  50. package/{Logo/Logo.js → NavbarLogo/NavbarLogo.js} +8 -5
  51. package/NavbarLogo/index.d.ts +1 -0
  52. package/NavbarLogo/index.js +17 -0
  53. package/OperationBadge/index.d.ts +1 -1
  54. package/OperationBadge/index.js +1 -1
  55. package/PageNavigation/index.d.ts +3 -0
  56. package/PageNavigation/index.js +19 -0
  57. package/Panel/index.d.ts +8 -8
  58. package/Panel/index.js +8 -8
  59. package/REAMDE.md +1 -0
  60. package/SamplesPanelControls/index.d.ts +1 -1
  61. package/SamplesPanelControls/index.js +1 -1
  62. package/Search/Autocomplete.js +1 -1
  63. package/Search/ClearIcon.js +1 -1
  64. package/Search/Parameters.js +2 -2
  65. package/Search/SearchIcon.js +1 -1
  66. package/Search/SearchItem.js +2 -2
  67. package/Search/index.d.ts +9 -0
  68. package/Search/index.js +25 -0
  69. package/Search/utils.js +1 -1
  70. package/Sidebar/ApiCallItem.d.ts +2 -2
  71. package/Sidebar/ApiCallItem.js +6 -6
  72. package/Sidebar/ArrowBack.d.ts +1 -2
  73. package/Sidebar/ArrowBack.js +2 -1
  74. package/Sidebar/BackButton.d.ts +1 -1
  75. package/Sidebar/BackButton.js +5 -4
  76. package/Sidebar/Drilldown.d.ts +2 -2
  77. package/Sidebar/Drilldown.js +8 -7
  78. package/Sidebar/DrilldownMenu.d.ts +2 -2
  79. package/Sidebar/DrilldownMenu.js +5 -7
  80. package/Sidebar/DrilldownMenuItem.d.ts +2 -2
  81. package/Sidebar/DrilldownMenuItem.js +5 -4
  82. package/Sidebar/ExternalIcon.d.ts +1 -2
  83. package/Sidebar/ExternalIcon.js +2 -1
  84. package/Sidebar/Menu.d.ts +1 -2
  85. package/Sidebar/Menu.js +3 -2
  86. package/Sidebar/MenuContainer.d.ts +1 -2
  87. package/Sidebar/MenuContainer.js +2 -1
  88. package/Sidebar/MenuGroup.d.ts +1 -1
  89. package/Sidebar/MenuGroup.js +6 -6
  90. package/Sidebar/MenuItem.d.ts +2 -2
  91. package/Sidebar/MenuItem.js +7 -6
  92. package/Sidebar/MenuItemLabel.d.ts +1 -2
  93. package/Sidebar/MenuItemLabel.js +4 -3
  94. package/Sidebar/MenuLink.d.ts +1 -2
  95. package/Sidebar/MenuLink.js +3 -2
  96. package/Sidebar/MenuLinkItem.d.ts +2 -2
  97. package/Sidebar/MenuLinkItem.js +4 -3
  98. package/Sidebar/MobileSidebarButton.d.ts +1 -2
  99. package/Sidebar/MobileSidebarButton.js +3 -2
  100. package/Sidebar/Separator.d.ts +2 -2
  101. package/Sidebar/Separator.js +5 -4
  102. package/Sidebar/SeparatorItem.d.ts +1 -2
  103. package/Sidebar/SeparatorItem.js +3 -2
  104. package/Sidebar/SeparatorLine.d.ts +1 -2
  105. package/Sidebar/SeparatorLine.js +2 -1
  106. package/Sidebar/Sidebar.d.ts +2 -2
  107. package/Sidebar/Sidebar.js +3 -2
  108. package/Sidebar/SidebarLayout.d.ts +1 -1
  109. package/Sidebar/SidebarLayout.js +6 -5
  110. package/Sidebar/index.d.ts +19 -0
  111. package/Sidebar/index.js +35 -0
  112. package/Sidebar/types/DrilldownMenuProps.d.ts +2 -2
  113. package/Sidebar/types/ItemState.d.ts +2 -3
  114. package/Sidebar/types/MenuItemProps.d.ts +2 -2
  115. package/Sidebar/types/NavItem.d.ts +1 -1
  116. package/Sidebar/types/index.d.ts +5 -0
  117. package/Sidebar/types/index.js +21 -0
  118. package/SidebarLogo/index.d.ts +1 -1
  119. package/SidebarLogo/index.js +1 -1
  120. package/SourceCode/index.d.ts +1 -1
  121. package/SourceCode/index.js +1 -1
  122. package/TableOfContent/TableOfContent.d.ts +1 -1
  123. package/TableOfContent/TableOfContent.js +9 -9
  124. package/TableOfContent/index.d.ts +1 -0
  125. package/TableOfContent/index.js +17 -0
  126. package/Tooltip/index.d.ts +1 -1
  127. package/Tooltip/index.js +1 -1
  128. package/globalStyle.d.ts +1 -0
  129. package/globalStyle.js +7 -3
  130. package/hooks/index.d.ts +7 -7
  131. package/hooks/index.js +7 -7
  132. package/hooks/useActiveSectionId.d.ts +2 -2
  133. package/hooks/useActiveSectionId.js +1 -0
  134. package/icons/ShelfIcon/index.d.ts +2 -2
  135. package/icons/ShelfIcon/index.js +1 -1
  136. package/icons/index.d.ts +1 -1
  137. package/icons/index.js +1 -1
  138. package/index.d.ts +1 -0
  139. package/index.js +1 -0
  140. package/mocks/Link.js +4 -1
  141. package/mocks/hooks/usePageData.js +4 -1
  142. package/package.json +1 -1
  143. package/src/Button/Button.stories.tsx +1 -1
  144. package/src/Button/index.ts +1 -1
  145. package/src/CodeBlock/index.ts +1 -1
  146. package/src/CopyButton/CopyButton.stories.tsx +1 -1
  147. package/src/CopyButton/index.ts +2 -2
  148. package/src/DesignTokens/borders.stories.mdx +20 -0
  149. package/src/DesignTokens/colors.stories.mdx +24 -0
  150. package/src/DesignTokens/page-layout.stories.mdx +12 -0
  151. package/src/DesignTokens/tokens-generated.scss +610 -0
  152. package/src/DesignTokens/typography.stories.mdx +36 -0
  153. package/src/Footer/Footer.stories.tsx +57 -0
  154. package/src/Footer/Footer.tsx +7 -10
  155. package/src/Footer/FooterColumn.tsx +8 -8
  156. package/src/Footer/FooterColumns.tsx +5 -3
  157. package/src/Footer/FooterCopyright.tsx +6 -4
  158. package/src/Footer/__tests__/Footer.test.tsx +55 -0
  159. package/src/Footer/__tests__/__snapshots__/Footer.test.tsx.snap +253 -0
  160. package/src/Footer/index.ts +4 -0
  161. package/src/Headings/index.ts +1 -1
  162. package/src/JsonViewer/JsonViewer.stories.tsx +1 -1
  163. package/src/JsonViewer/index.ts +2 -2
  164. package/src/Layout/PageLayout.tsx +1 -1
  165. package/src/Layout/RootLayout.tsx +1 -1
  166. package/src/Layout/__tests__/PageLayout.test.tsx +17 -0
  167. package/src/Layout/__tests__/RootLayout.test.tsx +17 -0
  168. package/src/Layout/__tests__/__snapshots__/PageLayout.test.tsx.snap +38 -0
  169. package/src/Layout/__tests__/__snapshots__/RootLayout.test.tsx.snap +18 -0
  170. package/src/Layout/index.ts +2 -0
  171. package/src/Markdown/{Admonition/Admonition.tsx → Admonition.tsx} +15 -15
  172. package/src/Markdown/CodeSample/index.ts +3 -0
  173. package/src/Markdown/{Heading/Heading.tsx → Heading.tsx} +4 -1
  174. package/src/Markdown/MarkdownLayout.tsx +2 -2
  175. package/src/Markdown/{Mermaid/Mermaid.tsx → Mermaid.tsx} +0 -0
  176. package/src/Markdown/StyledMarkdown.tsx +27 -27
  177. package/src/Markdown/Tabs/index.ts +2 -0
  178. package/src/Markdown/index.ts +9 -0
  179. package/src/Navbar/Navbar.stories.tsx +10 -6
  180. package/src/Navbar/Navbar.tsx +3 -4
  181. package/src/Navbar/NavbarItem.tsx +2 -2
  182. package/src/Navbar/NavbarMenu.tsx +3 -3
  183. package/src/Navbar/__tests__/Navbar.test.tsx +55 -0
  184. package/src/Navbar/__tests__/__snapshots__/Navbar.test.tsx.snap +256 -0
  185. package/src/Navbar/index.ts +3 -0
  186. package/src/NavbarLogo/NavbarLogo.stories.tsx +20 -0
  187. package/src/NavbarLogo/NavbarLogo.tsx +24 -0
  188. package/src/NavbarLogo/__tests__/NavbarLogo.test.tsx +47 -0
  189. package/src/NavbarLogo/__tests__/__snapshots__/NavbarLogo.test.tsx.snap +38 -0
  190. package/src/NavbarLogo/index.ts +1 -0
  191. package/src/OperationBadge/OperationBadge.stories.tsx +1 -1
  192. package/src/OperationBadge/index.ts +1 -1
  193. package/src/PageNavigation/PageNavigation.stories.tsx +21 -0
  194. package/src/PageNavigation/__tests__/NextPageLink.test.tsx +29 -0
  195. package/src/PageNavigation/__tests__/PageNavigation.test.tsx +54 -0
  196. package/src/PageNavigation/__tests__/PreviousPageLink.test.tsx +29 -0
  197. package/src/PageNavigation/__tests__/__snapshots__/NextPageLink.test.tsx.snap +67 -0
  198. package/src/PageNavigation/__tests__/__snapshots__/PageNavigation.test.tsx.snap +275 -0
  199. package/src/PageNavigation/__tests__/__snapshots__/PreviousPageLink.test.tsx.snap +67 -0
  200. package/src/PageNavigation/index.ts +3 -0
  201. package/src/Panel/index.ts +8 -8
  202. package/src/SamplesPanelControls/SamplesControlButton.stories.tsx +1 -1
  203. package/src/SamplesPanelControls/index.ts +1 -1
  204. package/src/Search/Autocomplete.tsx +1 -1
  205. package/src/Search/ClearIcon.tsx +11 -12
  206. package/src/Search/Parameters.tsx +2 -2
  207. package/src/Search/SearchIcon.tsx +11 -12
  208. package/src/Search/SearchItem.tsx +2 -2
  209. package/src/Search/__tests__/Input.test.tsx +13 -0
  210. package/src/Search/__tests__/__snapshots__/Input.test.tsx.snap +36 -0
  211. package/src/Search/index.ts +9 -0
  212. package/src/Search/utils.tsx +1 -1
  213. package/src/Sidebar/ApiCallItem.tsx +5 -5
  214. package/src/Sidebar/ArrowBack.tsx +1 -1
  215. package/src/Sidebar/BackButton.tsx +4 -4
  216. package/src/Sidebar/Drilldown.tsx +6 -6
  217. package/src/Sidebar/DrilldownMenu.tsx +4 -4
  218. package/src/Sidebar/DrilldownMenuItem.tsx +6 -6
  219. package/src/Sidebar/ExternalIcon.tsx +1 -1
  220. package/src/Sidebar/Menu.tsx +2 -2
  221. package/src/Sidebar/MenuContainer.tsx +1 -1
  222. package/src/Sidebar/MenuGroup.tsx +5 -5
  223. package/src/Sidebar/MenuItem.tsx +6 -6
  224. package/src/Sidebar/MenuItemLabel.tsx +5 -5
  225. package/src/Sidebar/MenuLink.tsx +2 -2
  226. package/src/Sidebar/MenuLinkItem.tsx +3 -3
  227. package/src/Sidebar/MobileSidebarButton.tsx +3 -3
  228. package/src/Sidebar/Separator.tsx +4 -4
  229. package/src/Sidebar/SeparatorItem.tsx +2 -2
  230. package/src/Sidebar/SeparatorLine.tsx +1 -1
  231. package/src/Sidebar/Sidebar.tsx +2 -2
  232. package/src/Sidebar/SidebarLayout.tsx +4 -4
  233. package/src/Sidebar/index.ts +19 -0
  234. package/src/Sidebar/types/DrilldownMenuProps.ts +2 -2
  235. package/src/Sidebar/types/ItemState.ts +2 -4
  236. package/src/Sidebar/types/MenuItemProps.ts +2 -2
  237. package/src/Sidebar/types/NavItem.ts +1 -1
  238. package/src/Sidebar/types/index.ts +5 -0
  239. package/src/SidebarLogo/SidebarLogo.stories.tsx +1 -1
  240. package/src/SidebarLogo/index.ts +1 -1
  241. package/src/SourceCode/SourceCode.stories.tsx +1 -1
  242. package/src/SourceCode/index.ts +1 -1
  243. package/src/TableOfContent/TableOfContent.stories.tsx +37 -0
  244. package/src/TableOfContent/TableOfContent.tsx +13 -11
  245. package/src/TableOfContent/__tests__/TableOfContent.test.tsx +61 -0
  246. package/src/TableOfContent/__tests__/__snapshots__/TableOfContent.test.tsx.snap +153 -0
  247. package/src/TableOfContent/index.ts +1 -0
  248. package/src/Tooltip/Tooltip.stories.tsx +1 -1
  249. package/src/Tooltip/index.ts +1 -1
  250. package/src/Welcome.stories.mdx +7 -0
  251. package/src/globalStyle.ts +333 -144
  252. package/src/hooks/index.ts +7 -7
  253. package/src/hooks/useActiveSectionId.ts +3 -3
  254. package/src/icons/ShelfIcon/index.ts +2 -2
  255. package/src/icons/index.ts +1 -1
  256. package/src/index.ts +1 -0
  257. package/src/mocks/Link.tsx +5 -2
  258. package/src/mocks/hooks/usePageData.ts +4 -1
  259. package/src/types/portal/index.d.ts +0 -1
  260. package/src/types/portal/src/client/app/Sidebar/types.d.ts +32 -41
  261. package/src/types/portal/src/client/app/media-css.d.ts +4 -4
  262. package/src/types/portal/src/client/styling/default.d.ts +585 -391
  263. package/src/types/portal/src/client/styling/index.d.ts +2 -6
  264. package/src/types/portal/src/server/constants.d.ts +5 -9
  265. package/src/types/portal/src/server/plugins/markdown/types.d.ts +14 -19
  266. package/src/types/portal/src/server/plugins/portal-config/types.d.ts +12 -12
  267. package/src/types/portal/src/server/plugins/types.d.ts +55 -0
  268. package/src/types/portal/src/server/store.d.ts +49 -97
  269. package/src/types/portal/src/server/utils/async.d.ts +1 -5
  270. package/src/types/portal/src/server/utils/content-provider.d.ts +51 -0
  271. package/src/types/portal/src/server/utils/index.d.ts +1 -1
  272. package/src/types/portal/src/server/utils/paths.d.ts +10 -13
  273. package/src/types/portal/src/server/utils/reporter/formatter.d.ts +8 -8
  274. package/src/types/portal/src/server/utils/reporter/reporter.d.ts +15 -15
  275. package/src/types/portal/src/server/version-store.d.ts +35 -0
  276. package/src/types/portal/src/shared/constants.d.ts +6 -6
  277. package/src/types/portal/src/shared/types.d.ts +97 -58
  278. package/src/types/portal/src/shared/urls.d.ts +2 -1
  279. package/src/ui/AlertIcon.tsx +8 -7
  280. package/src/ui/{Arrow/Arrow.tsx → Arrow.tsx} +0 -0
  281. package/src/ui/Background.tsx +3 -3
  282. package/src/ui/Dropdown.tsx +5 -5
  283. package/src/ui/Jumbotron.tsx +3 -3
  284. package/src/ui/Tiles/TileHeader.ts +1 -1
  285. package/src/ui/Tiles/TileText.tsx +2 -2
  286. package/src/ui/Tiles/index.ts +4 -0
  287. package/src/ui/Typography.tsx +22 -22
  288. package/src/ui/UniversalLink.tsx +2 -2
  289. package/src/ui/index.tsx +8 -3
  290. package/src/utils/isUrl.ts +1 -1
  291. package/src/utils/replaceHashInColor.ts +1 -1
  292. package/ui/AlertIcon.d.ts +3 -2
  293. package/ui/AlertIcon.js +2 -2
  294. package/ui/{Arrow/Arrow.d.ts → Arrow.d.ts} +0 -0
  295. package/ui/{Arrow/Arrow.js → Arrow.js} +0 -0
  296. package/ui/Background.js +1 -1
  297. package/ui/Dropdown.d.ts +1 -1
  298. package/ui/Dropdown.js +5 -4
  299. package/ui/Jumbotron.js +3 -3
  300. package/ui/Tiles/TileHeader.js +1 -1
  301. package/ui/Tiles/TileText.js +1 -1
  302. package/ui/Tiles/index.d.ts +4 -0
  303. package/ui/Tiles/index.js +20 -0
  304. package/ui/Typography.js +20 -20
  305. package/ui/UniversalLink.js +4 -4
  306. package/ui/index.d.ts +7 -3
  307. package/ui/index.js +7 -3
  308. package/utils/isUrl.d.ts +1 -1
  309. package/utils/isUrl.js +2 -1
  310. package/utils/replaceHashInColor.d.ts +1 -1
  311. package/utils/replaceHashInColor.js +2 -1
  312. package/Logo/Logo.d.ts +0 -5
  313. package/src/Footer/index.tsx +0 -4
  314. package/src/Introduction.stories.mdx +0 -7
  315. package/src/Layout/index.tsx +0 -2
  316. package/src/Logo/Logo.tsx +0 -17
  317. package/src/types/portal/src/server/plugins/nav-utils.d.ts +0 -19
  318. package/src/types/portal/src/server/plugins/sidebars/index.d.ts +0 -16
  319. package/src/types/portal/src/server/plugins/versions/index.d.ts +0 -15
  320. package/src/types/portal/src/server/plugins/versions/types.d.ts +0 -23
  321. package/src/types/portal/src/server/plugins/versions/utils.d.ts +0 -10
  322. package/src/types/portal/src/server/utils/watcher.d.ts +0 -16
@@ -1,118 +1,174 @@
1
- import { createGlobalStyle } from 'styled-components';
1
+ import { createGlobalStyle, css } from 'styled-components';
2
2
 
3
- export const GlobalStyle = createGlobalStyle`
4
- /*
5
- * Static classnames that can be used to override styles for components:
6
- * download-specification-button, next-section-button, button-base
3
+ const baseColors = css`
4
+ /* === Palette === */
5
+
6
+ /**
7
+ * @tokens Base Colors
8
+ * @presenter Color
9
+ */
10
+ --color-primary-100: #62a1ff;
11
+ --color-primary-200: #4892ff;
12
+ --color-primary-300: #2f83ff;
13
+ --color-primary-400: #1573ff;
14
+ --color-primary-500: #0065fb;
15
+ --color-primary-600: #005be2;
16
+ --color-primary-700: #0050c8;
17
+ --color-primary-800: #0046af;
18
+ --color-primary-900: #003c95;
19
+
20
+ --color-secondary-100: #ffffff;
21
+ --color-secondary-200: #f5f7fa;
22
+ --color-secondary-300: #f3f4f6;
23
+ --color-secondary-400: #e4e7eb;
24
+ --color-secondary-500: #d5dae0;
25
+ --color-secondary-600: #c7cdd5;
26
+ --color-secondary-700: #b8c0ca;
27
+ --color-secondary-800: #a9b3c0;
28
+ --color-secondary-900: #9ba6b5;
29
+
30
+ --color-emphasis-100: #ffffff;
31
+ --color-emphasis-200: #e9eaec;
32
+ --color-emphasis-300: #cdd0d5;
33
+ --color-emphasis-400: #b2b6bd;
34
+ --color-emphasis-500: #969ca6;
35
+ --color-emphasis-600: #7a828f;
36
+ --color-emphasis-700: #626974;
37
+ --color-emphasis-800: #4b5058;
38
+ --color-emphasis-900: #1c1e21;
39
+
40
+ --color-accent-100: #b3dcf3;
41
+ --color-accent-200: #a6dfff;
42
+ --color-accent-300: #8cd5ff;
43
+ --color-accent-400: #73ccff;
44
+ --color-accent-500: #59c3ff;
45
+ --color-accent-600: #40baff;
46
+ --color-accent-700: #26b1ff;
47
+ --color-accent-800: #0da7ff;
48
+ --color-accent-900: #009bf2;
49
+
50
+ --color-success-100: #98eda0;
51
+ --color-success-200: #82e98c;
52
+ --color-success-300: #6ce678;
53
+ --color-success-400: #57e264;
54
+ --color-success-500: #41de50;
55
+ --color-success-600: #2bda3c;
56
+ --color-success-700: #23c933;
57
+ --color-success-800: #1fb32d;
58
+ --color-success-900: #1b9e28;
59
+
60
+ --color-warning-100: #ffc966;
61
+ --color-warning-200: #ffc04d;
62
+ --color-warning-300: #ffb733;
63
+ --color-warning-400: #ffae1a;
64
+ --color-warning-500: #ffa500;
65
+ --color-warning-600: #e69400;
66
+ --color-warning-700: #cc8400;
67
+ --color-warning-800: #b37300;
68
+ --color-warning-900: #996300;
69
+
70
+ --color-error-100: #ffc7c7;
71
+ --color-error-200: #ffaeae;
72
+ --color-error-300: #ff9494;
73
+ --color-error-400: #ff7b7b;
74
+ --color-error-500: #ff6161;
75
+ --color-error-600: #ff4747;
76
+ --color-error-700: #ff2e2e;
77
+ --color-error-800: #ff1414;
78
+ --color-error-900: #ff0000;
79
+
80
+ // @tokens Other
81
+ `;
82
+
83
+ const typography = css`
84
+ /* === Typography === */
85
+
86
+ /**
87
+ * @tokens Typography Colors
88
+ * @presenter Color
89
+ */
90
+ --color-content: #1f2933;
91
+ --color-content-inverse: var(--color-secondary-200);
92
+ --color-content-secondary: #7b8794;
93
+
94
+ /**
95
+ * @tokens Font Sizes
96
+ * @presenter FontSize
97
+ */
98
+ --font-size-base: 14px;
99
+ --font-size-small: 12px;
100
+
101
+ /**
102
+ * @tokens Line Heights
103
+ * @presenter LineHeight
104
+ */
105
+ --line-height-base: 1.5em;
106
+
107
+ /**
108
+ * @tokens Font Weights
109
+ * @presenter FontWeight
110
+ */
111
+ --font-weight-regular: 400;
112
+ --font-weight-bold: 600;
113
+ --font-weight-bolder: 700;
114
+
115
+ /**
116
+ * @tokens Font Families
117
+ * @presenter FontFamily
118
+ */
119
+ --font-family-base: Source Sans Pro, sans-serif;
120
+ --font-family-monospaced: Source Code Pro, monospace;
121
+
122
+ /**
123
+ * @tokens Rendering
7
124
  */
8
- :root {
9
- /* === Palette === */
125
+ --smoothing: antialiased; // text-smoothing
126
+ --text-rendering: optimizeSpeed; // text-rendering
10
127
 
11
- /*
12
- * Color palette
128
+ /**
129
+ * @tokens Spacings
130
+ * @presenter Spacing
131
+ */
132
+ --spacing-unit: 5px;
133
+ --spacing-horizontal: calc(var(--spacing-unit) * 8);
134
+ --spacing-vertical: calc(var(--spacing-unit) * 4);
135
+
136
+ // @tokens Other
137
+ `;
138
+
139
+ const borders = css`
140
+ /**
141
+ * @tokens Borders
142
+ * @presenter Border
13
143
  */
14
- --color-primary-100: #62a1ff;
15
- --color-primary-200: #4892ff;
16
- --color-primary-300: #2f83ff;
17
- --color-primary-400: #1573ff;
18
- --color-primary-500: #0065fb;
19
- --color-primary-600: #005be2;
20
- --color-primary-700: #0050c8;
21
- --color-primary-800: #0046af;
22
- --color-primary-900: #003c95;
23
-
24
- --color-secondary-100: #ffffff;
25
- --color-secondary-200: #f5f7fa;
26
- --color-secondary-300: #f3f4f6;
27
- --color-secondary-400: #e4e7eb;
28
- --color-secondary-500: #d5dae0;
29
- --color-secondary-600: #c7cdd5;
30
- --color-secondary-700: #b8c0ca;
31
- --color-secondary-800: #a9b3c0;
32
- --color-secondary-900: #9ba6b5;
33
-
34
- --color-emphasis-100: #ffffff;
35
- --color-emphasis-200: #e9eaec;
36
- --color-emphasis-300: #cdd0d5;
37
- --color-emphasis-400: #b2b6bd;
38
- --color-emphasis-500: #969ca6;
39
- --color-emphasis-600: #7a828f;
40
- --color-emphasis-700: #626974;
41
- --color-emphasis-800: #4b5058;
42
- --color-emphasis-900: #1c1e21;
43
-
44
- --color-accent-100: #b3dcf3;
45
- --color-accent-200: #a6dfff;
46
- --color-accent-300: #8cd5ff;
47
- --color-accent-400: #73ccff;
48
- --color-accent-500: #59c3ff;
49
- --color-accent-600: #40baff;
50
- --color-accent-700: #26b1ff;
51
- --color-accent-800: #0da7ff;
52
- --color-accent-900: #009bf2;
53
-
54
- --color-success-100: #98eda0;
55
- --color-success-200: #82e98c;
56
- --color-success-300: #6ce678;
57
- --color-success-400: #57e264;
58
- --color-success-500: #41de50;
59
- --color-success-600: #2bda3c;
60
- --color-success-700: #23c933;
61
- --color-success-800: #1fb32d;
62
- --color-success-900: #1b9e28;
63
-
64
- --color-warning-100: #ffc966;
65
- --color-warning-200: #ffc04d;
66
- --color-warning-300: #ffb733;
67
- --color-warning-400: #ffae1a;
68
- --color-warning-500: #ffa500;
69
- --color-warning-600: #e69400;
70
- --color-warning-700: #cc8400;
71
- --color-warning-800: #b37300;
72
- --color-warning-900: #996300;
73
-
74
- --color-error-100: #ffc7c7;
75
- --color-error-200: #ffaeae;
76
- --color-error-300: #ff9494;
77
- --color-error-400: #ff7b7b;
78
- --color-error-500: #ff6161;
79
- --color-error-600: #ff4747;
80
- --color-error-700: #ff2e2e;
81
- --color-error-800: #ff1414;
82
- --color-error-900: #ff0000;
83
-
84
- /* === Typography === */
85
-
86
- --color-content: #1f2933;
87
- --color-content-inverse: var(--color-secondary-200);
88
- --color-content-secondary: #7b8794;
89
-
90
- --font-size-base: 14px;
91
- --line-height-base: 1.5em;
92
- --font-weight-regular: 400;
93
- --font-weight-bold: 600;
94
- --font-weight-bolder: 700;
95
- --font-family-base: Source Sans Pro, sans-serif;
96
- --font-family-monospaced: Source Code Pro, monospace;
97
-
98
- --smoothing: antialiased; // text-smoothing
99
- --text-rendering: optimizeSpeed; // text-rendering
144
+ --global-border-width: 1px;
100
145
 
101
- /*
102
- * Spacing
146
+ /**
147
+ * @tokens Border Radius
148
+ * @presenter BorderRadius
103
149
  */
104
- --spacing-unit: 5px;
105
- --spacing-horizontal: calc(var(--spacing-unit) * 8);
106
- --spacing-vertical: calc(var(--spacing-unit) * 4);
150
+ --global-border-radius: 4px;
107
151
 
108
- /*
109
- * Global
152
+ /**
153
+ * @tokens Border Colors
154
+ * @presenter Color
110
155
  */
111
- --global-border-radius: 4px;
112
- --global-border-width: 1px;
113
- --global-border-color: var(--color-secondary-400);
114
- --global-border-color-secondary: #616e7c;
115
- --global-background-color: transparent;
156
+ --global-border-color: var(--color-secondary-400);
157
+ --global-border-color-secondary: #616e7c;
158
+ --global-background-color: transparent;
159
+
160
+ // @tokens Other
161
+ `;
162
+
163
+ export const styles = css`
164
+ /*
165
+ * Static classnames that can be used to override styles for components:
166
+ * download-specification-button, next-section-button, button-base
167
+ */
168
+ :root {
169
+ ${baseColors}
170
+ ${typography}
171
+ ${borders}
116
172
 
117
173
  /* === Page layout === */
118
174
  //TBD
@@ -122,40 +178,48 @@ export const GlobalStyle = createGlobalStyle`
122
178
 
123
179
  /* === Menu (sidebar) === */
124
180
 
181
+ /**
182
+ * @tokens Sidebar
183
+ */
125
184
  --sidebar-width: 285px;
126
- --sidebar-background-color: #fff;
127
- --sidebar-right-line-color: var(--global-border-color);
128
- --sidebar-spacing-unit: 8px;
129
- --sidebar-spacing-horizontal: var(--sidebar-spacing-unit);
130
- --sidebar-spacing-vertical: var(--sidebar-spacing-unit);
185
+ --sidebar-background-color: #fff; // @presenter Color
186
+ --sidebar-right-line-color: var(--global-border-color); // @presenter Color
187
+ --sidebar-spacing-unit: 8px; // @presenter Spacing
188
+ --sidebar-spacing-horizontal: var(--sidebar-spacing-unit); // @presenter Spacing
189
+ --sidebar-spacing-vertical: var(--sidebar-spacing-unit); // @presenter Spacing
131
190
 
132
- --sidebar-margin-left: calc(var(--sidebar-spacing-unit) * 2);
133
- --sidebar-spacing-offset-top: calc(var(--sidebar-spacing-unit) * 2);
134
- --sidebar-spacing-offset-left: calc(var(--sidebar-spacing-unit) * 2);
135
- --sidebar-spacing-offset-nesting: calc(var(--sidebar-spacing-unit) * 2);
191
+ --sidebar-margin-left: calc(var(--sidebar-spacing-unit) * 2); // @presenter Spacing
192
+ --sidebar-spacing-offset-top: calc(var(--sidebar-spacing-unit) * 2); // @presenter Spacing
193
+ --sidebar-spacing-offset-left: calc(var(--sidebar-spacing-unit) * 2); // @presenter Spacing
194
+ --sidebar-spacing-offset-nesting: calc(var(--sidebar-spacing-unit) * 2); // @presenter Spacing
136
195
 
137
196
  --sidebar-word-break: 'inherit';
138
- --sidebar-separator-label-color: var(--sidebar-item-color);
139
- --sidebar-separator-line-color: #dadada;
140
- --sidebar-chevron-color: var(--sidebar-item-color);
141
- --sidebar-chevron-size: var(--sidebar-spacing-unit);
142
-
143
- --sidebar-item-spacing-offset-top: calc(var(--sidebar-spacing-unit) * 2);
144
- --sidebar-item-spacing-offset-left: calc(var(--sidebar-spacing-unit) * 2);
145
- --sidebar-item-spacing-offset-nesting: calc(var(--sidebar-spacing-unit) * 2);
146
- --sidebar-item-border-radius: 4px;
147
- --sidebar-item-font-family: var(--font-family-base);
148
- --sidebar-item-font-size: var(--font-size-base);
149
- --sidebar-item-color: var(--color-content);
150
- --sidebar-item-active-color: var(--color-content);
151
- --sidebar-item-background-color: #fff;
152
- --sidebar-item-active-background-color: var(--global-border-color);
197
+ --sidebar-separator-label-color: var(--sidebar-item-color); // @presenter Color
198
+ --sidebar-separator-line-color: #dadada; // @presenter Color
199
+ --sidebar-chevron-color: var(--sidebar-item-color); // @presenter Color
200
+ --sidebar-chevron-size: var(--sidebar-spacing-unit); // @presenter Spacing
201
+
202
+ --sidebar-item-spacing-offset-top: calc(var(--sidebar-spacing-unit) * 2); // @presenter Spacing
203
+ --sidebar-item-spacing-offset-left: calc(var(--sidebar-spacing-unit) * 2); // @presenter Spacing
204
+ --sidebar-item-spacing-offset-nesting: calc(
205
+ var(--sidebar-spacing-unit) * 2
206
+ ); // @presenter Spacing
207
+ --sidebar-item-border-radius: 4px; // @presenter BorderRadius
208
+ --sidebar-item-font-family: var(--font-family-base); // @presenter FontFamily
209
+ --sidebar-item-font-size: var(--font-size-base); // @presenter FontSize
210
+ --sidebar-item-color: var(--color-content); // @presenter Color
211
+ --sidebar-item-active-color: var(--color-content); // @presenter Color
212
+ --sidebar-item-background-color: #fff; // @presenter Color
213
+ --sidebar-item-active-background-color: var(--global-border-color); // @presenter Color
153
214
 
154
215
  //TBD
155
216
  /* === Footer === */
156
217
  //TBD
157
218
  /* === Table of contents === */
158
219
  //TBD
220
+
221
+ // @tokens Other
222
+
159
223
  /* === Various components: buttons, inputs, alerts, tooltip === */
160
224
 
161
225
  /*
@@ -274,8 +338,9 @@ export const GlobalStyle = createGlobalStyle`
274
338
  --logo-max-width: 285px;
275
339
  --logo-padding: 2px;
276
340
 
277
- /*
278
- * Http colors
341
+ /**
342
+ * @tokens HTTP Colors
343
+ * @presenter Color
279
344
  */
280
345
  --color-http-get: #3a9601;
281
346
  --color-http-post: #0065fb;
@@ -288,8 +353,9 @@ export const GlobalStyle = createGlobalStyle`
288
353
  --color-http-head: #a23dad;
289
354
  --color-http-hook: var(--color-http-post);
290
355
 
291
- /*
292
- * Response colors
356
+ /**
357
+ * @tokens Response colors
358
+ * @presenter Color
293
359
  */
294
360
  --response-success-border-color: #b1e996;
295
361
  --response-success-background-color: #f6fff4;
@@ -307,6 +373,8 @@ export const GlobalStyle = createGlobalStyle`
307
373
  --response-info-background-color: #87ceeb1a;
308
374
  --response-info-text-color: var(--response-info-border-color);
309
375
 
376
+ // @tokens Other
377
+
310
378
  /*
311
379
  * Panels
312
380
  */
@@ -317,7 +385,7 @@ export const GlobalStyle = createGlobalStyle`
317
385
  --samples-panel-width: 50%;
318
386
  --samples-panel-block-background-color: #fff;
319
387
  --samples-panel-background-color: #52606d;
320
- --samples-panel-callback-background-color: var(--samples-panel-callback-background-color);
388
+ --samples-panel-callback-background-color: var(--color-secondary-300);
321
389
  --samples-panel-controls-background-color: #323f4b;
322
390
  --samples-panel-controls-hover-background-color: #3c4c5a;
323
391
  --samples-panel-controls-active-border-color: var(--color-accent-500);
@@ -418,24 +486,56 @@ export const GlobalStyle = createGlobalStyle`
418
486
  --linear-progress-background-color: var(--color-accent-100);
419
487
 
420
488
  /* Floating action button */
421
- --fab-color: #0065FB;
489
+ --fab-color: #0065fb;
422
490
  --fab-background-color: #f2f2f2;
423
-
491
+
492
+ //* PORTAL settings *//
424
493
  /**
425
- * Portal Logo
494
+ * Headings
495
+ * */
496
+ --h2-font-weight: var(--font-weight-bold);
497
+
498
+ --h1-margin-top: 1.35em;
499
+ --h1-margin-bottom: 0.9em;
500
+ --h2-margin-top: 1.25em;
501
+ --h2-margin-bottom: 0.8em;
502
+ --h3-margin-top: 1.25em;
503
+ --h3-margin-bottom: 0.8em;
504
+
505
+ /**
506
+ * Footer
507
+ * */
508
+ --footer-background-color: var(--color-primary-500);
509
+ --footer-text-color: #fff;
510
+
511
+ /**
512
+ * Sidebar
513
+ * */
514
+ --sidebar-padding-horizontal: var(--sidebar-spacing-unit);
515
+ --sidebar-padding-vertical: var(--sidebar-spacing-unit);
516
+
517
+ --sidebar-spacing-padding-vertical: var(--sidebar-spacing-unit);
518
+ --sidebar-spacing-padding-horizontal: var(--sidebar-spacing-unit);
519
+
520
+ --sidebar-border-radius: 4px;
521
+ --sidebar-font-size: var(--font-size-base);
522
+ --sidebar-font-family: var(--font-family-base);
523
+
524
+ /**
525
+ * Logo
426
526
  * */
427
527
  --logo-height: 2rem;
428
528
  --logo-margin: var(--sidebar-margin-left);
429
529
 
430
530
  /**
431
- * Portal Navbar
531
+ * Navbar
432
532
  * */
433
533
  --navbar-height: 60px;
434
- --navbar-color-text: var(--color-content-inverse);
435
- --navbar-color-background: var(--color-primary-500);
534
+ --navbar-text-color: #fff;
535
+ --navbar-background-color: var(--color-primary-500);
436
536
 
437
537
  /**
438
- * Portal Navbar Item
538
+ * Navbar Item
439
539
  * */
440
540
  --navbar-item-font-size: 16px;
441
541
  --navbar-item-margin-horizontal: 0;
@@ -443,7 +543,96 @@ export const GlobalStyle = createGlobalStyle`
443
543
  --navbar-item-border-radius: 10px;
444
544
  --navbar-item-font-weight: var(--font-weight-bold);
445
545
  --navbar-item-active-background-color: #1b75fa;
446
- --navbar-item-active-text-color: var(--color-primary-contrast);
546
+ --navbar-item-active-text-color: var(--navbar-text-color);
447
547
  --navbar-item-active-text-decoration: none;
548
+
549
+ /**
550
+ * TOC
551
+ * */
552
+ --toc-width: 240px;
553
+
554
+ /**
555
+ * Markdown
556
+ * */
557
+ --content-wrapper-max-width: 910px;
558
+ --content-wrapper-padding-vertical: 25px;
559
+ --content-wrapper-padding-horizontal: 0px;
560
+
561
+ /**
562
+ * Bloquote
563
+ * */
564
+ --bloquote-margin-vertical: 1.5em;
565
+ --bloquote-margin-horizontal: 0;
566
+ --bloquote-padding-vertical: 0;
567
+ --bloquote-padding-horizontal: calc(var(--spacing-unit) * 4);
568
+ --bloquote-background-color: transparent;
569
+
570
+ /**
571
+ * Admonition
572
+ * */
573
+ --admonition-margin-horizontal: 0;
574
+ --admonition-margin-vertical: calc(var(--spacing-unit) * 2);
575
+ --admonition-padding-horizontal: calc(var(--spacing-unit) * 4);
576
+ --admonition-padding-vertical: calc(var(--spacing-unit) * 4);
577
+ --admonition-icon-size: 25px;
578
+ --admonition-border-radius: 8px;
579
+ --admonition-font-size: 16px;
580
+ --admonition-font-weight: normal;
581
+ --admonition-line-height: 1.5em;
582
+ --admonition-heading-font-size: 16px;
583
+ --admonition-heading-font-weight: var(--font-weight-bold);
584
+ --admonition-heading-letter-spacing: 0.3px;
585
+ --admonition-heading-transform: uppercase;
586
+
587
+ /**
588
+ * @tokens Admonition colors
589
+ * @presenter Color
590
+ */
591
+
592
+ /* info */
593
+ --admonition-info-background-color: #ebedf0;
594
+ --admonition-info-text-color: var(--color-content);
595
+ --admonition-info-icon-color: #4782cb;
596
+
597
+ /* attention */
598
+ --admonition-attention-background-color: #e6eef8;
599
+ --admonition-attention-text-color: var(--color-content);
600
+ --admonition-attention-icon-color: #4782cb;
601
+
602
+ /* warning */
603
+ --admonition-warning-background-color: #feeda5;
604
+ --admonition-warning-text-color: var(--color-content);
605
+ --admonition-warning-icon-color: #d4ad03;
606
+
607
+ /* danger */
608
+ --admonition-danger-background-color: #fceaea;
609
+ --admonition-danger-text-color: var(--color-content);
610
+ --admonition-danger-icon-color: #e53935;
611
+
612
+ /* success */
613
+ --admonition-success-background-color: #ddffe1;
614
+ --admonition-success-text-color: var(--color-content);
615
+ --admonition-success-icon-color: #00aa13;
616
+
617
+ /*
618
+ * Portal Search
619
+ */
620
+ --input-background-color: rgba(255, 255, 255, 0.1);
621
+ --input-text-color: #fff;
622
+ --input-border-radius: 4px;
623
+ --input-font-size: 16px;
624
+ --input-font-family: var(--font-family-primary);
625
+ --input-line-height: 1.15em;
626
+ --popover-backgrond-color: #fff;
627
+ --popover-border-radius: 4px;
628
+ --search-item-text-color: var(--color-content-secondary);
629
+ --search-item-title-text-color: var(--color-content);
630
+ --search-item-active-background-color: rgba(0, 68, 212, 0.1);
631
+
632
+ // @tokens Other
448
633
  }
449
634
  `;
635
+
636
+ export const GlobalStyle = createGlobalStyle`
637
+ ${styles}
638
+ `;
@@ -1,7 +1,7 @@
1
- export * from './useControl';
2
- export * from './useMount';
3
- export * from './useUnmount';
4
- export * from './useActiveHeading';
5
- export * from './useActiveSectionId';
6
- export * from './useFullHeight';
7
- export * from './useNavbarHeight';
1
+ export * from '@theme/hooks/useControl';
2
+ export * from '@theme/hooks/useMount';
3
+ export * from '@theme/hooks/useUnmount';
4
+ export * from '@theme/hooks/useActiveHeading';
5
+ export * from '@theme/hooks/useActiveSectionId';
6
+ export * from '@theme/hooks/useFullHeight';
7
+ export * from '@theme/hooks/useNavbarHeight';
@@ -1,14 +1,14 @@
1
+ import { Location } from 'history';
1
2
  import { useEffect, useState, useMemo } from 'react';
2
3
  import throttle from 'lodash.throttle';
3
4
 
4
5
  import { useNavbarHeight } from '@theme/hooks/useNavbarHeight';
5
- import type { MenuProps } from '@theme/types/portal';
6
6
 
7
7
  export type UseActiveSectionIdReturnType = string;
8
8
 
9
9
  export function useActiveSectionId(
10
- location: MenuProps['location'],
11
- hasOverviewPage: boolean,
10
+ location: Location,
11
+ hasOverviewPage = false,
12
12
  ): UseActiveSectionIdReturnType {
13
13
  const [itemId, setItemId] = useState<string>('');
14
14
  const navbarHeight = useNavbarHeight(location);
@@ -1,2 +1,2 @@
1
- export { ShelfIcon } from './ShelfIcon';
2
- export type { ShelfIconProps } from './ShelfIcon';
1
+ export { ShelfIcon } from '@theme/icons/ShelfIcon/ShelfIcon';
2
+ export type { ShelfIconProps } from '@theme/icons/ShelfIcon/ShelfIcon';
@@ -1 +1 @@
1
- export * from './ShelfIcon';
1
+ export * from '@theme/icons/ShelfIcon';
package/src/index.ts CHANGED
@@ -13,3 +13,4 @@ export * from './hooks';
13
13
  export * from './utils';
14
14
  export * from './globalStyle';
15
15
  export * from './OperationBadge';
16
+ export * from './TableOfContent';
@@ -1,7 +1,10 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
+ import { omit } from 'lodash';
2
3
 
3
4
  // TODO: use real typings here
4
5
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
5
6
  export function Link(props: any): JSX.Element {
6
- return <a href={props.to} {...props} />;
7
+ // We omit "active" property to avoid "Warning: Received `false` for a non-boolean attribute `active`."
8
+ const filteredProps = omit(props, ['active']);
9
+ return <a href={filteredProps.to} {...filteredProps} />;
7
10
  }
@@ -4,5 +4,8 @@ export function usePageData(): {
4
4
  prevPage: ResolvedNavLinkItem | null;
5
5
  nextPage: ResolvedNavLinkItem | null;
6
6
  } {
7
- return { prevPage: null, nextPage: null };
7
+ return {
8
+ prevPage: { label: 'Intro', type: 'link', link: '#prev' },
9
+ nextPage: { label: 'FAQ', type: 'link', link: '#next' },
10
+ };
8
11
  }
@@ -2,5 +2,4 @@ export * from './src/client/styling';
2
2
  export * from './src/client/app/Sidebar/types';
3
3
  export * from './src/server/plugins/portal-config/types';
4
4
  export * from './src/shared/types';
5
- export * from './src/server/plugins/versions/types';
6
5
  export type { MdHeading } from './src/server/plugins/markdown/types';