@redocly/theme 0.1.7 → 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 (375) 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/Layout/PageLayout.d.ts +6 -0
  15. package/Layout/PageLayout.js +30 -0
  16. package/Layout/RootLayout.d.ts +7 -0
  17. package/Layout/RootLayout.js +31 -0
  18. package/Layout/index.d.ts +2 -0
  19. package/Layout/index.js +10 -0
  20. package/Logo/Logo.d.ts +1 -6
  21. package/Markdown/Admonition/Admonition.d.ts +9 -0
  22. package/Markdown/Admonition/Admonition.js +39 -0
  23. package/Markdown/CodeSample/CodeSample.d.ts +8 -0
  24. package/Markdown/CodeSample/CodeSample.js +30 -0
  25. package/Markdown/CodeSample/styled.d.ts +5 -0
  26. package/Markdown/CodeSample/styled.js +109 -0
  27. package/Markdown/CodeSample/types.d.ts +9 -0
  28. package/Markdown/CodeSample/types.js +2 -0
  29. package/Markdown/ContentWrapper.d.ts +5 -0
  30. package/Markdown/ContentWrapper.js +21 -0
  31. package/Markdown/Heading/Heading.d.ts +5 -0
  32. package/Markdown/Heading/Heading.js +23 -0
  33. package/Markdown/MarkdownLayout.d.ts +7 -0
  34. package/Markdown/MarkdownLayout.js +23 -0
  35. package/Markdown/Mermaid/Mermaid.d.ts +6 -0
  36. package/Markdown/Mermaid/Mermaid.js +19 -0
  37. package/Markdown/PageWrapper.d.ts +3 -0
  38. package/Markdown/PageWrapper.js +15 -0
  39. package/Markdown/StyledMarkdown.d.ts +8 -0
  40. package/Markdown/StyledMarkdown.js +54 -0
  41. package/Markdown/Tabs/Tab.d.ts +8 -0
  42. package/Markdown/Tabs/Tab.js +35 -0
  43. package/Markdown/Tabs/Tabs.d.ts +10 -0
  44. package/Markdown/Tabs/Tabs.js +43 -0
  45. package/Navbar/Navbar.d.ts +1 -0
  46. package/Navbar/Navbar.js +7 -1
  47. package/Navbar/NavbarItem.js +1 -1
  48. package/Navbar/NavbarMenu.js +4 -1
  49. package/OperationBadge/OperationBadge.d.ts +5 -0
  50. package/OperationBadge/OperationBadge.js +15 -0
  51. package/OperationBadge/index.d.ts +1 -0
  52. package/OperationBadge/index.js +17 -0
  53. package/PageNavigation/NextPageLink.d.ts +2 -0
  54. package/PageNavigation/NextPageLink.js +25 -0
  55. package/PageNavigation/PageNavigation.d.ts +2 -0
  56. package/PageNavigation/PageNavigation.js +31 -0
  57. package/PageNavigation/PreviousPageLink.d.ts +2 -0
  58. package/PageNavigation/PreviousPageLink.js +25 -0
  59. package/Panel/CodePanel.js +6 -6
  60. package/Panel/ContentPanel.js +4 -4
  61. package/Panel/Panel.d.ts +1 -1
  62. package/Panel/Panel.js +3 -3
  63. package/Panel/PanelComponent.d.ts +1 -1
  64. package/Panel/PanelComponent.js +3 -3
  65. package/Panel/index.d.ts +1 -0
  66. package/Panel/index.js +1 -0
  67. package/Search/Autocomplete.d.ts +13 -0
  68. package/Search/Autocomplete.js +79 -0
  69. package/Search/ClearIcon.d.ts +2 -0
  70. package/Search/ClearIcon.js +29 -0
  71. package/Search/Input.d.ts +3 -0
  72. package/Search/Input.js +15 -0
  73. package/Search/Parameters.d.ts +7 -0
  74. package/Search/Parameters.js +42 -0
  75. package/Search/Popover.d.ts +3 -0
  76. package/Search/Popover.js +15 -0
  77. package/Search/Search.d.ts +2 -0
  78. package/Search/Search.js +39 -0
  79. package/Search/SearchIcon.d.ts +2 -0
  80. package/Search/SearchIcon.js +29 -0
  81. package/Search/SearchItem.d.ts +7 -0
  82. package/Search/SearchItem.js +47 -0
  83. package/Search/utils.d.ts +2 -0
  84. package/Search/utils.js +21 -0
  85. package/Sidebar/ApiCallItem.d.ts +8 -0
  86. package/Sidebar/ApiCallItem.js +35 -0
  87. package/Sidebar/ArrowBack.d.ts +5 -0
  88. package/Sidebar/ArrowBack.js +28 -0
  89. package/Sidebar/BackButton.d.ts +6 -0
  90. package/Sidebar/BackButton.js +30 -0
  91. package/Sidebar/Drilldown.d.ts +8 -0
  92. package/Sidebar/Drilldown.js +45 -0
  93. package/Sidebar/DrilldownMenu.d.ts +3 -0
  94. package/Sidebar/DrilldownMenu.js +57 -0
  95. package/Sidebar/DrilldownMenuItem.d.ts +3 -0
  96. package/Sidebar/DrilldownMenuItem.js +31 -0
  97. package/Sidebar/ExternalIcon.d.ts +5 -0
  98. package/Sidebar/ExternalIcon.js +28 -0
  99. package/Sidebar/Menu.d.ts +4 -0
  100. package/Sidebar/Menu.js +14 -0
  101. package/Sidebar/MenuContainer.d.ts +2 -0
  102. package/Sidebar/MenuContainer.js +12 -0
  103. package/Sidebar/MenuGroup.d.ts +9 -0
  104. package/Sidebar/MenuGroup.js +37 -0
  105. package/Sidebar/MenuItem.d.ts +3 -0
  106. package/Sidebar/MenuItem.js +33 -0
  107. package/Sidebar/MenuItemLabel.d.ts +6 -0
  108. package/Sidebar/MenuItemLabel.js +18 -0
  109. package/Sidebar/MenuLink.d.ts +6 -0
  110. package/Sidebar/MenuLink.js +15 -0
  111. package/Sidebar/MenuLinkItem.d.ts +3 -0
  112. package/Sidebar/MenuLinkItem.js +30 -0
  113. package/Sidebar/MobileSidebarButton.d.ts +6 -0
  114. package/Sidebar/MobileSidebarButton.js +20 -0
  115. package/Sidebar/Separator.d.ts +3 -0
  116. package/Sidebar/Separator.js +31 -0
  117. package/Sidebar/SeparatorItem.d.ts +6 -0
  118. package/Sidebar/SeparatorItem.js +13 -0
  119. package/Sidebar/SeparatorLine.d.ts +4 -0
  120. package/Sidebar/SeparatorLine.js +14 -0
  121. package/Sidebar/Sidebar.d.ts +8 -0
  122. package/Sidebar/Sidebar.js +23 -0
  123. package/Sidebar/SidebarLayout.d.ts +7 -0
  124. package/Sidebar/SidebarLayout.js +35 -0
  125. package/Sidebar/types/DrilldownMenuProps.d.ts +6 -0
  126. package/Sidebar/types/DrilldownMenuProps.js +2 -0
  127. package/Sidebar/types/ItemState.d.ts +9 -0
  128. package/Sidebar/types/ItemState.js +2 -0
  129. package/Sidebar/types/MenuItemProps.d.ts +5 -0
  130. package/Sidebar/types/MenuItemProps.js +2 -0
  131. package/Sidebar/types/MenuStyle.d.ts +3 -0
  132. package/Sidebar/types/MenuStyle.js +8 -0
  133. package/Sidebar/types/NavItem.d.ts +26 -0
  134. package/Sidebar/types/NavItem.js +2 -0
  135. package/SourceCode/SourceCode.js +2 -2
  136. package/TableOfContent/TableOfContent.d.ts +9 -0
  137. package/TableOfContent/TableOfContent.js +64 -0
  138. package/globalStyle.js +1 -1
  139. package/hooks/index.d.ts +4 -0
  140. package/hooks/index.js +4 -0
  141. package/hooks/useActiveHeading.d.ts +2 -0
  142. package/hooks/useActiveHeading.js +34 -0
  143. package/hooks/useActiveSectionId.d.ts +3 -0
  144. package/hooks/useActiveSectionId.js +48 -0
  145. package/hooks/useFullHeight.d.ts +2 -0
  146. package/hooks/useFullHeight.js +47 -0
  147. package/hooks/useMobileMenu.d.ts +2 -0
  148. package/hooks/useMobileMenu.js +13 -0
  149. package/hooks/useNavbarHeight.d.ts +3 -0
  150. package/hooks/useNavbarHeight.js +20 -0
  151. package/icons/ShelfIcon/ShelfIcon.js +2 -2
  152. package/index.d.ts +1 -0
  153. package/index.js +1 -0
  154. package/mocks/hooks/usePageData.d.ts +5 -0
  155. package/mocks/hooks/usePageData.js +7 -0
  156. package/mocks/models.d.ts +3 -0
  157. package/mocks/models.js +2 -0
  158. package/mocks/search.d.ts +22 -0
  159. package/mocks/search.js +13 -0
  160. package/mocks/types/index.d.ts +1 -0
  161. package/mocks/types/index.js +2 -0
  162. package/mocks/usePreloadHistory.d.ts +3 -0
  163. package/mocks/usePreloadHistory.js +12 -0
  164. package/package.json +5 -2
  165. package/src/Button/Button.stories.tsx +1 -1
  166. package/src/Button/__tests__/Button.test.tsx +1 -1
  167. package/src/CodeBlock/__tests__/CodeBlock.test.tsx +1 -1
  168. package/src/CopyButton/CopyButton.stories.tsx +1 -1
  169. package/src/CopyButton/CopyButton.tsx +1 -1
  170. package/src/CopyButton/CopyButtonWrapper.tsx +4 -4
  171. package/src/CopyButton/__tests__/CopyButton.test.tsx +1 -1
  172. package/src/CopyButton/__tests__/CopyButtonWrapper.test.tsx +2 -1
  173. package/src/Footer/Footer.tsx +34 -0
  174. package/src/Footer/FooterColumn.tsx +62 -0
  175. package/src/Footer/FooterColumns.tsx +51 -0
  176. package/src/Footer/FooterCopyright.tsx +26 -0
  177. package/src/Footer/index.tsx +4 -0
  178. package/src/Headings/Headings.stories.tsx +1 -1
  179. package/src/Headings/Headings.ts +1 -1
  180. package/src/Headings/__tests__/Headings.test.tsx +1 -1
  181. package/src/JsonViewer/JsonViewer.stories.tsx +1 -1
  182. package/src/JsonViewer/JsonViewer.tsx +6 -7
  183. package/src/JsonViewer/__tests__/JsonViewer.test.tsx +2 -1
  184. package/src/JsonViewer/index.ts +1 -0
  185. package/src/Layout/PageLayout.tsx +34 -0
  186. package/src/Layout/RootLayout.tsx +24 -0
  187. package/src/Layout/index.tsx +2 -0
  188. package/src/Logo/Logo.tsx +1 -7
  189. package/src/Markdown/Admonition/Admonition.tsx +64 -0
  190. package/src/Markdown/CodeSample/CodeSample.tsx +39 -0
  191. package/src/Markdown/CodeSample/styled.ts +289 -0
  192. package/src/Markdown/CodeSample/types.ts +40 -0
  193. package/src/Markdown/ContentWrapper.tsx +20 -0
  194. package/src/Markdown/Heading/Heading.tsx +35 -0
  195. package/src/Markdown/MarkdownLayout.tsx +25 -0
  196. package/src/Markdown/Mermaid/Mermaid.tsx +23 -0
  197. package/src/Markdown/PageWrapper.tsx +9 -0
  198. package/src/Markdown/StyledMarkdown.tsx +312 -0
  199. package/src/Markdown/Tabs/Tab.tsx +37 -0
  200. package/src/Markdown/Tabs/Tabs.tsx +45 -0
  201. package/src/Navbar/Navbar.stories.tsx +0 -10
  202. package/src/Navbar/Navbar.tsx +19 -25
  203. package/src/Navbar/NavbarItem.tsx +1 -1
  204. package/src/Navbar/NavbarMenu.tsx +4 -4
  205. package/src/OperationBadge/OperationBadge.stories.tsx +35 -0
  206. package/src/OperationBadge/OperationBadge.ts +59 -0
  207. package/src/OperationBadge/__tests__/OperationBadge.test.tsx +59 -0
  208. package/src/OperationBadge/__tests__/__snapshots__/OperationBadge.test.tsx.snap +651 -0
  209. package/src/OperationBadge/index.ts +1 -0
  210. package/src/PageNavigation/NextPageLink.tsx +22 -0
  211. package/src/PageNavigation/PageNavigation.tsx +20 -0
  212. package/src/PageNavigation/PreviousPageLink.tsx +22 -0
  213. package/src/Panel/CodePanel.stories.tsx +1 -2
  214. package/src/Panel/CodePanel.ts +8 -7
  215. package/src/Panel/ContentPanel.stories.tsx +1 -2
  216. package/src/Panel/ContentPanel.ts +5 -6
  217. package/src/Panel/Panel.stories.tsx +1 -3
  218. package/src/Panel/Panel.ts +3 -3
  219. package/src/Panel/PanelComponent.tsx +4 -5
  220. package/src/Panel/__tests__/CodePanel.test.tsx +1 -1
  221. package/src/Panel/__tests__/ContentPanel.test.tsx +1 -1
  222. package/src/Panel/__tests__/Panel.test.tsx +1 -2
  223. package/src/Panel/__tests__/__snapshots__/CodePanel.test.tsx.snap +8 -8
  224. package/src/Panel/__tests__/__snapshots__/ContentPanel.test.tsx.snap +22 -22
  225. package/src/Panel/__tests__/__snapshots__/Panel.test.tsx.snap +16 -16
  226. package/src/Panel/index.ts +1 -0
  227. package/src/SamplesPanelControls/SamplesControlButton.stories.tsx +1 -1
  228. package/src/SamplesPanelControls/SamplesPanelControls.ts +1 -1
  229. package/src/Search/Autocomplete.tsx +128 -0
  230. package/src/Search/ClearIcon.tsx +31 -0
  231. package/src/Search/Input.tsx +19 -0
  232. package/src/Search/Parameters.tsx +62 -0
  233. package/src/Search/Popover.tsx +20 -0
  234. package/src/Search/Search.tsx +52 -0
  235. package/src/Search/SearchIcon.tsx +32 -0
  236. package/src/Search/SearchItem.tsx +85 -0
  237. package/src/Search/utils.tsx +19 -0
  238. package/src/Sidebar/ApiCallItem.tsx +33 -0
  239. package/src/Sidebar/ArrowBack.tsx +22 -0
  240. package/src/Sidebar/BackButton.tsx +44 -0
  241. package/src/Sidebar/Drilldown.tsx +46 -0
  242. package/src/Sidebar/DrilldownMenu.tsx +58 -0
  243. package/src/Sidebar/DrilldownMenuItem.tsx +40 -0
  244. package/src/Sidebar/ExternalIcon.tsx +37 -0
  245. package/src/Sidebar/Menu.tsx +11 -0
  246. package/src/Sidebar/MenuContainer.tsx +8 -0
  247. package/src/Sidebar/MenuGroup.tsx +55 -0
  248. package/src/Sidebar/MenuItem.tsx +25 -0
  249. package/src/Sidebar/MenuItemLabel.tsx +41 -0
  250. package/src/Sidebar/MenuLink.tsx +14 -0
  251. package/src/Sidebar/MenuLinkItem.tsx +24 -0
  252. package/src/Sidebar/MobileSidebarButton.tsx +44 -0
  253. package/src/Sidebar/Separator.tsx +17 -0
  254. package/src/Sidebar/SeparatorItem.tsx +14 -0
  255. package/src/Sidebar/SeparatorLine.tsx +9 -0
  256. package/src/Sidebar/Sidebar.tsx +54 -0
  257. package/src/Sidebar/SidebarLayout.tsx +30 -0
  258. package/src/Sidebar/types/DrilldownMenuProps.ts +7 -0
  259. package/src/Sidebar/types/ItemState.ts +11 -0
  260. package/src/Sidebar/types/MenuItemProps.ts +6 -0
  261. package/src/Sidebar/types/MenuStyle.ts +4 -0
  262. package/src/Sidebar/types/NavItem.ts +27 -0
  263. package/src/SidebarLogo/SidebarLogo.stories.tsx +1 -1
  264. package/src/SidebarLogo/__tests__/SidebarLogo.test.tsx +1 -1
  265. package/src/SourceCode/SourceCode.stories.tsx +1 -1
  266. package/src/SourceCode/SourceCode.tsx +7 -3
  267. package/src/SourceCode/__tests__/SourceCode.test.tsx +2 -1
  268. package/src/TableOfContent/TableOfContent.tsx +112 -0
  269. package/src/Tooltip/Tooltip.stories.tsx +1 -1
  270. package/src/Tooltip/Tooltip.tsx +1 -1
  271. package/src/Tooltip/__tests__/Tooltip.test.tsx +1 -1
  272. package/src/globalStyle.ts +10 -34
  273. package/src/hooks/index.ts +4 -0
  274. package/src/hooks/useActiveHeading.ts +46 -0
  275. package/src/hooks/useActiveSectionId.ts +53 -0
  276. package/src/hooks/useFullHeight.ts +47 -0
  277. package/src/hooks/useMobileMenu.ts +11 -0
  278. package/src/hooks/useNavbarHeight.ts +24 -0
  279. package/src/icons/ShelfIcon/ShelfIcon.stories.tsx +1 -1
  280. package/src/icons/ShelfIcon/ShelfIcon.tsx +1 -1
  281. package/src/icons/ShelfIcon/__tests__/ShelfIcon.test.tsx +1 -1
  282. package/src/index.ts +1 -0
  283. package/src/mocks/hooks/usePageData.ts +8 -0
  284. package/src/mocks/models.ts +3 -0
  285. package/src/mocks/search.ts +31 -0
  286. package/src/mocks/types/index.ts +1 -0
  287. package/src/mocks/usePreloadHistory.ts +9 -0
  288. package/src/types/portal/index.d.ts +6 -0
  289. package/src/types/portal/src/client/app/Sidebar/types.d.ts +50 -0
  290. package/src/types/portal/src/client/app/media-css.d.ts +7 -0
  291. package/src/types/portal/src/client/styling/default.d.ts +407 -0
  292. package/src/types/portal/src/client/styling/index.d.ts +14 -0
  293. package/src/types/portal/src/client/styling/resolve.d.ts +1 -0
  294. package/src/types/portal/src/server/constants.d.ts +11 -0
  295. package/src/types/portal/src/server/plugins/markdown/types.d.ts +28 -0
  296. package/src/types/portal/src/server/plugins/nav-utils.d.ts +19 -0
  297. package/src/types/portal/src/server/plugins/portal-config/types.d.ts +23 -0
  298. package/src/types/portal/src/server/plugins/sidebars/index.d.ts +16 -0
  299. package/src/types/portal/src/server/plugins/versions/index.d.ts +15 -0
  300. package/src/types/portal/src/server/plugins/versions/types.d.ts +23 -0
  301. package/src/types/portal/src/server/plugins/versions/utils.d.ts +10 -0
  302. package/src/types/portal/src/server/store.d.ts +101 -0
  303. package/src/types/portal/src/server/utils/async.d.ts +5 -0
  304. package/src/types/portal/src/server/utils/crypto.d.ts +3 -0
  305. package/src/types/portal/src/server/utils/fs.d.ts +3 -0
  306. package/src/types/portal/src/server/utils/index.d.ts +6 -0
  307. package/src/types/portal/src/server/utils/paths.d.ts +16 -0
  308. package/src/types/portal/src/server/utils/reporter/formatter.d.ts +11 -0
  309. package/src/types/portal/src/server/utils/reporter/reporter.d.ts +17 -0
  310. package/src/types/portal/src/server/utils/watcher.d.ts +16 -0
  311. package/src/types/portal/src/server/utils/yaml.d.ts +1 -0
  312. package/src/types/portal/src/shared/constants.d.ts +8 -0
  313. package/src/types/portal/src/shared/types.d.ts +77 -0
  314. package/src/types/portal/src/shared/urls.d.ts +7 -0
  315. package/src/types/portal/src/shared/utils.d.ts +10 -0
  316. package/src/ui/AlertIcon.tsx +110 -0
  317. package/src/ui/Arrow/Arrow.tsx +36 -0
  318. package/src/ui/Background.tsx +16 -0
  319. package/src/ui/Box.tsx +39 -0
  320. package/src/ui/Button.tsx +19 -0
  321. package/src/ui/Dropdown.tsx +132 -0
  322. package/src/ui/Flex.tsx +21 -0
  323. package/src/ui/Jumbotron.tsx +57 -0
  324. package/src/ui/Tiles/ThinTile.tsx +151 -0
  325. package/src/ui/Tiles/TileHeader.ts +13 -0
  326. package/src/ui/Tiles/TileText.tsx +12 -0
  327. package/src/ui/Tiles/WideTile.tsx +138 -0
  328. package/src/ui/Typography.tsx +167 -0
  329. package/src/ui/UniversalLink.tsx +100 -0
  330. package/src/ui/index.tsx +12 -0
  331. package/src/utils/__tests__/ClipboardService.test.ts +1 -1
  332. package/src/utils/__tests__/css-variables.test.ts +1 -1
  333. package/src/utils/__tests__/highlight.test.ts +1 -1
  334. package/src/utils/__tests__/jsonToHtml.test.ts +1 -1
  335. package/src/utils/__tests__/media-css.test.ts +1 -1
  336. package/src/utils/__tests__/theme-helpers.test.ts +1 -1
  337. package/src/utils/getNavbarElement.ts +10 -0
  338. package/src/utils/isUrl.ts +42 -0
  339. package/src/utils/replaceHashInColor.ts +3 -0
  340. package/ui/AlertIcon.d.ts +9 -0
  341. package/ui/AlertIcon.js +45 -0
  342. package/ui/Arrow/Arrow.d.ts +7 -0
  343. package/ui/Arrow/Arrow.js +42 -0
  344. package/ui/Background.d.ts +7 -0
  345. package/ui/Background.js +16 -0
  346. package/ui/Box.d.ts +6 -0
  347. package/ui/Box.js +16 -0
  348. package/ui/Button.d.ts +7 -0
  349. package/ui/Button.js +27 -0
  350. package/ui/Dropdown.d.ts +8 -0
  351. package/ui/Dropdown.js +54 -0
  352. package/ui/Flex.d.ts +10 -0
  353. package/ui/Flex.js +31 -0
  354. package/ui/Jumbotron.d.ts +18 -0
  355. package/ui/Jumbotron.js +44 -0
  356. package/ui/Tiles/ThinTile.d.ts +21 -0
  357. package/ui/Tiles/ThinTile.js +98 -0
  358. package/ui/Tiles/TileHeader.d.ts +5 -0
  359. package/ui/Tiles/TileHeader.js +15 -0
  360. package/ui/Tiles/TileText.d.ts +5 -0
  361. package/ui/Tiles/TileText.js +15 -0
  362. package/ui/Tiles/WideTile.d.ts +7 -0
  363. package/ui/Tiles/WideTile.js +93 -0
  364. package/ui/Typography.d.ts +110 -0
  365. package/ui/Typography.js +137 -0
  366. package/ui/UniversalLink.d.ts +17 -0
  367. package/ui/UniversalLink.js +62 -0
  368. package/ui/index.d.ts +10 -0
  369. package/ui/index.js +30 -0
  370. package/utils/getNavbarElement.d.ts +1 -0
  371. package/utils/getNavbarElement.js +14 -0
  372. package/utils/isUrl.d.ts +12 -0
  373. package/utils/isUrl.js +35 -0
  374. package/utils/replaceHashInColor.d.ts +1 -0
  375. package/utils/replaceHashInColor.js +6 -0
@@ -0,0 +1,57 @@
1
+ import { space } from 'styled-system';
2
+ import styled from 'styled-components';
3
+
4
+ import { H1, H2 } from '@theme/ui/Typography';
5
+ import { Background } from '@theme/ui/Background';
6
+
7
+ export const Jumbotron = styled(Background).attrs(() => ({
8
+ 'data-component-name': 'ui/Jumbotron',
9
+ }))<{
10
+ pt?: string;
11
+ pb?: string;
12
+ pl?: string;
13
+ pr?: string;
14
+ bgImage?: string;
15
+ bgColor?: string;
16
+ parallaxEffect?: boolean;
17
+ textColor?: string;
18
+ }>`
19
+ flex-direction: column;
20
+ padding-top: ${({ pt }) => pt || '0'};
21
+ padding-bottom: ${({ pb }) => pb || '8em'};
22
+ padding-left: ${({ pl }) => pl || '0'};
23
+ padding-right: ${({ pr }) => pr || '0'};
24
+ ${({ bgColor }) => bgColor && `background: ${bgColor}`};
25
+ ${({ bgImage, bgColor }) =>
26
+ bgImage &&
27
+ `
28
+ background: ${bgColor || 'var(--color-primary-main)'} url(${bgImage});
29
+ background-repeat: no-repeat;
30
+ background-size: cover;
31
+ background-position: center;
32
+ `};
33
+ ${({ parallaxEffect }) =>
34
+ parallaxEffect &&
35
+ `
36
+ background-attachment: scroll, fixed;
37
+ `};
38
+ ${space}
39
+ ${H1}, ${H2} {
40
+ color: ${({ textColor }) => textColor || 'var(--navbar-color-text)'};
41
+ text-align: center;
42
+ padding: 0;
43
+ }
44
+ h1 {
45
+ font-size: 3.5em;
46
+ line-height: 1.2;
47
+ font-weight: var(--font-weight-bold);
48
+ margin: 1.75em 0 0.5em 0;
49
+ }
50
+ h2 {
51
+ font-size: 1.875em;
52
+ line-height: 1;
53
+ font-weight: var(--font-weight-light);
54
+ margin: 0;
55
+ margin-bottom: 2em;
56
+ }
57
+ `;
@@ -0,0 +1,151 @@
1
+ import React, { Component, CSSProperties } from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ import { Link } from '@portal/Link';
5
+ import { Flex } from '@theme/ui/Flex';
6
+ import { TileText } from '@theme/ui/Tiles/TileText';
7
+ import { TileHeader } from '@theme/ui/Tiles/TileHeader';
8
+
9
+ type TextAlign = 'left' | 'right' | 'center' | 'justify';
10
+
11
+ export interface TileProps {
12
+ header?: string;
13
+ icon?: string;
14
+ children?: string;
15
+ to?: string;
16
+ target?: string;
17
+ headerAlign?: TextAlign;
18
+ textAlign?: TextAlign;
19
+ bgColor?: string;
20
+ bgImage?: string;
21
+ color?: string;
22
+ className?: string;
23
+ style?: CSSProperties;
24
+ maxWidth?: string;
25
+ }
26
+
27
+ const ThinTileWrapper = styled(Link)<{ bgColor?: string; bgImage?: string }>`
28
+ display: flex;
29
+ flex-direction: column;
30
+ border-radius: 10px;
31
+ box-shadow: 0px 10px 30px 0px rgba(35, 35, 35, 0.1);
32
+ box-sizing: border-box;
33
+ transition: box-shadow 0.25s ease;
34
+ padding: 24px;
35
+ margin-bottom: 20px;
36
+ text-decoration: none;
37
+ width: 100%;
38
+ background-color: ${({ bgColor }) => bgColor || '#fff'};
39
+ background-image: ${({ bgImage }) => (bgImage ? `url(${bgImage})` : 'none')};
40
+ background-repeat: no-repeat;
41
+
42
+ :hover {
43
+ box-shadow: 0px 10px 100px 0px rgba(35, 35, 35, 0.2);
44
+ }
45
+
46
+ ${({ theme }) => theme.mediaQueries.small} {
47
+ width: calc(50% - 20px);
48
+ margin-right: 10px;
49
+ margin-left: 10px;
50
+ }
51
+
52
+ ${({ theme }) => theme.mediaQueries.medium} {
53
+ width: 250px;
54
+ }
55
+
56
+ ${({ theme }) => theme.mediaQueries.large} {
57
+ width: 280px;
58
+ }
59
+
60
+ &.external-url {
61
+ :after {
62
+ display: none;
63
+ }
64
+ }
65
+ `;
66
+
67
+ const ThinTileIcon = styled.img`
68
+ width: 90px;
69
+
70
+ ${({ theme }) => theme.mediaQueries.medium} {
71
+ width: 80px;
72
+ }
73
+ `;
74
+
75
+ const ThinTileHeader = styled(TileHeader)<{ align?: TextAlign }>`
76
+ font-size: 24px;
77
+ text-align: ${({ align }) => align || 'center'};
78
+ `;
79
+
80
+ const ThinTileText = styled(TileText)<{ icon?: string; align?: TextAlign }>`
81
+ font-size: 18px;
82
+ line-height: 1.5;
83
+ flex-shrink: 0;
84
+ min-height: 3em;
85
+ text-align: ${({ align }) => align || 'center'};
86
+ ${({ icon }) =>
87
+ icon
88
+ ? `
89
+ display: -webkit-box;
90
+ -webkit-line-clamp: 8;
91
+ -webkit-box-orient: vertical;
92
+ overflow: hidden;
93
+ line-clamp: 8;
94
+ `
95
+ : ''};
96
+ ${({ theme }) => theme.mediaQueries.small} {
97
+ min-height: 6em;
98
+ }
99
+
100
+ ${({ theme }) => theme.mediaQueries.medium} {
101
+ min-height: 4.5em;
102
+ }
103
+ `;
104
+
105
+ export class ThinTile extends Component<TileProps> {
106
+ render(): JSX.Element {
107
+ const { header, icon, children, to, target, headerAlign, textAlign, color, className, style } =
108
+ this.props;
109
+
110
+ const Wrapper = to
111
+ ? ThinTileWrapper
112
+ : (ThinTileWrapper.withComponent('div') as typeof ThinTileWrapper);
113
+
114
+ return (
115
+ <Wrapper
116
+ to={to}
117
+ target={target}
118
+ color={color}
119
+ className={className}
120
+ style={style}
121
+ data-component-name="ui/Tiles/ThinTile"
122
+ >
123
+ {(icon || header) && (
124
+ <Flex flexDirection="column">
125
+ {icon && (
126
+ <Flex
127
+ flexShrink={0}
128
+ height={{ xs: 'auto', small: '100px', medium: '110px' }}
129
+ alignItems="center"
130
+ justifyContent="center"
131
+ mb="25px"
132
+ >
133
+ <ThinTileIcon src={icon} />
134
+ </Flex>
135
+ )}
136
+ {header && (
137
+ <ThinTileHeader align={headerAlign} color={color} data-cy={`Thin-${header}`}>
138
+ {header}
139
+ </ThinTileHeader>
140
+ )}
141
+ </Flex>
142
+ )}
143
+ {children && (
144
+ <ThinTileText icon={icon} align={textAlign} color={color}>
145
+ {children}
146
+ </ThinTileText>
147
+ )}
148
+ </Wrapper>
149
+ );
150
+ }
151
+ }
@@ -0,0 +1,13 @@
1
+ import styled from 'styled-components';
2
+
3
+ export const TileHeader = styled.h3.attrs(() => ({
4
+ 'data-component-name': 'ui/Tiles/TileHeader',
5
+ }))<{ color?: string }>`
6
+ font-weight: var(--font-weight-bold);
7
+ line-height: 1.25;
8
+ color: ${(props) => props.color || 'var(--color-primary-main)'};
9
+ font-family: var(--h-font-family);
10
+ && {
11
+ margin: 0 0 0.5em;
12
+ }
13
+ `;
@@ -0,0 +1,12 @@
1
+ import styled from 'styled-components';
2
+
3
+ export const TileText = styled.span.attrs(() => ({
4
+ 'data-component-name': 'ui/Tiles/TileText',
5
+ }))<{ color?: string }>`
6
+ display: inline-block;
7
+ font-weight: var(--font-weight-regular);
8
+ overflow: hidden;
9
+ color: ${(props) => props.color || 'var(--color-text-main)'};
10
+ line-height: 1.25;
11
+ font-family: var(--font-family-primary);
12
+ `;
@@ -0,0 +1,138 @@
1
+ import React, { Component } from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ import { Link } from '@portal/Link';
5
+ import { TileProps } from '@theme/ui';
6
+ import { TileText } from '@theme/ui/Tiles/TileText';
7
+ import { TileHeader } from '@theme/ui/Tiles/TileHeader';
8
+
9
+ // prettier-ignore
10
+ const WideTileWrapper = styled(Link)<{
11
+ disableArrow?: boolean;
12
+ withIcon: boolean;
13
+ bgColor?: string;
14
+ bgImage?: string;
15
+ color?: string;
16
+ maxWidth?: string;
17
+ }>`
18
+ display: inline-flex;
19
+ flex-direction: ${({ withIcon }) => (withIcon ? 'column' : 'row')};
20
+ border-radius: 10px;
21
+ box-shadow: 0px 10px 30px 0px rgba(35, 35, 35, 0.1);
22
+ background-color: ${({ bgColor }) => bgColor || '#fff'};
23
+ background-image: ${({ bgImage }) => (bgImage ? `url(${bgImage})` : 'none')};
24
+ background-repeat: no-repeat;
25
+ padding: 24px;
26
+ padding-right: ${({ disableArrow }) => (disableArrow ? '24px' : '56px')};
27
+ margin-bottom: 32px;
28
+ box-sizing: border-box;
29
+ position: relative;
30
+ text-decoration: none;
31
+ width: 100%;
32
+ transition: box-shadow 0.25s ease;
33
+ :hover {
34
+ box-shadow: 0px 10px 30px 0px rgba(35, 35, 35, 0.2);
35
+ }
36
+ :before {
37
+ content: ${({ disableArrow }) => (disableArrow ? 'none' : '""')};
38
+ display: inline-block;
39
+ width: 9px;
40
+ min-height: 18px;
41
+ background-size: 9px 18px;
42
+ background-repeat: no-repeat;
43
+ position: absolute;
44
+ top: 50%;
45
+ transform: translateY(-50%);
46
+ right: 30px;
47
+ }
48
+ &.external-url::after {
49
+ content: none;
50
+ }
51
+
52
+ ${({ theme }) => theme.mediaQueries.medium} {
53
+ width: calc(50% - 2em);
54
+ padding: 32px;
55
+ padding-right: ${({ disableArrow }) => (disableArrow ? '32px' : '64px')};
56
+ flex-direction: row;
57
+ max-width: ${({ maxWidth }) => maxWidth};
58
+ }
59
+ `;
60
+
61
+ const WideTileHeader = styled(TileHeader)<{ align?: string }>`
62
+ font-size: 24px;
63
+ text-align: ${({ align }) => align || 'left'};
64
+ `;
65
+ const WideTileText = styled(TileText)<{ align?: string }>`
66
+ font-size: 18px;
67
+ text-align: ${({ align }) => align || 'left'};
68
+ `;
69
+
70
+ const WideTileIcon = styled.div`
71
+ margin-bottom: 24px;
72
+ flex-shrink: 0;
73
+ width: 70px;
74
+ img {
75
+ display: block;
76
+ height: auto;
77
+ max-width: 100%;
78
+ }
79
+
80
+ ${({ theme }) => theme.mediaQueries.medium} {
81
+ margin-right: 24px;
82
+ margin-bottom: 0;
83
+ }
84
+ `;
85
+
86
+ export class WideTile extends Component<TileProps & { disableArrow?: boolean }> {
87
+ render(): JSX.Element {
88
+ const {
89
+ to,
90
+ header,
91
+ children,
92
+ target,
93
+ disableArrow,
94
+ textAlign,
95
+ headerAlign,
96
+ icon,
97
+ bgColor,
98
+ bgImage,
99
+ color,
100
+ className,
101
+ style,
102
+ maxWidth,
103
+ } = this.props;
104
+ return (
105
+ <WideTileWrapper
106
+ to={to}
107
+ target={target}
108
+ disableArrow={disableArrow}
109
+ withIcon={!!icon}
110
+ bgColor={bgColor}
111
+ bgImage={bgImage}
112
+ color={color}
113
+ className={className}
114
+ style={style}
115
+ maxWidth={maxWidth}
116
+ data-component-name="ui/Tiles/WideTile"
117
+ >
118
+ {icon && (
119
+ <WideTileIcon>
120
+ <img src={icon} alt="" />
121
+ </WideTileIcon>
122
+ )}
123
+ <div>
124
+ {header && (
125
+ <WideTileHeader align={textAlign} color={color} data-cy={`Wide-${header}`}>
126
+ {header}
127
+ </WideTileHeader>
128
+ )}
129
+ {children && (
130
+ <WideTileText align={headerAlign} color={color}>
131
+ {children}
132
+ </WideTileText>
133
+ )}
134
+ </div>
135
+ </WideTileWrapper>
136
+ );
137
+ }
138
+ }
@@ -0,0 +1,167 @@
1
+ import styled, { css, SimpleInterpolation } from 'styled-components';
2
+ import { color, typography as typographySystem, ColorProps, TypographyProps } from 'styled-system';
3
+
4
+ export interface ITypography {
5
+ fontSize?: string;
6
+ fontWeight?: string | number;
7
+ fontFamily?: string;
8
+ lineHeight?: string;
9
+ color?: string;
10
+ transform?: string;
11
+ marginTop?: string;
12
+ marginRight?: string;
13
+ marginLeft?: string;
14
+ marginBottom?: string;
15
+ marginVertical?: string;
16
+ marginHorizontal?: string;
17
+ }
18
+
19
+ export const typographyTokens = {
20
+ typography: {
21
+ fontSize: 'var(--font-size-base)',
22
+ fontFamily: 'var(--font-family-h)',
23
+ lineHeight: 'var(--line-height-m)',
24
+ },
25
+ heading1: {
26
+ fontSize: 'var(--h1-font-size)',
27
+ fontFamily: 'var(--font-family-h)',
28
+ fontWeight: 'var(--font-weight-bold)',
29
+ lineHeight: 'var(--h1-line-height)',
30
+ color: 'var(--color-text-main)',
31
+ marginTop: 'var(--h1-margin-top)',
32
+ marginBottom: 'var(--h1-margin-bottom)',
33
+ },
34
+ heading2: {
35
+ fontSize: 'var(--h2-font-size)',
36
+ fontFamily: 'var(--font-family-h)',
37
+ fontWeight: 'var(--font-weight-bold)',
38
+ lineHeight: 'var(--h2-line-height)',
39
+ color: 'var(--color-text-main)',
40
+ marginTop: 'var(--h2-margin-top)',
41
+ marginBottom: 'var(--h2-margin-bottom)',
42
+ },
43
+ heading3: {
44
+ fontSize: 'var(--h3-font-size)',
45
+ fontFamily: 'var(--font-family-h)',
46
+ fontWeight: 'var(--font-weight-bold)',
47
+ lineHeight: 'var(--h3-line-height)',
48
+ color: 'var(--color-text-main)',
49
+ marginTop: 'var(--h3-margin-top)',
50
+ marginBottom: 'var(--h3-margin-bottom)',
51
+ },
52
+ heading4: {},
53
+ heading5: {},
54
+ heading6: {},
55
+ blockquote: {
56
+ color: 'var(--color-text-main)',
57
+ },
58
+ alert: {
59
+ fontSize: 'var(--alert-font-size)',
60
+ fontWeight: 'var(--alert-font-weight)',
61
+ lineHeight: 'var(--alert-line-height)',
62
+ marginTop: 'var(--alert-margin-vertical)',
63
+ marginBottom: 'var(-alert-margin-vartical)',
64
+ heading: {
65
+ fontSize: 'var(--alert-heading-font-size)',
66
+ fontWeight: 'var(--alert-heading-font-weight)',
67
+ lineHeight: 'var(--alert-line-height)',
68
+ transform: 'var(--alert-heading-transform)',
69
+ },
70
+ },
71
+ };
72
+
73
+ export function typography(theme?: ITypography): string | SimpleInterpolation {
74
+ if (!theme) return '';
75
+ return css`
76
+ font-size: ${theme.fontSize || ''};
77
+ font-weight: ${theme.fontWeight || ''};
78
+ font-family: ${theme.fontFamily || ''};
79
+ line-height: ${theme.lineHeight || ''};
80
+ color: ${theme.color || ''};
81
+ text-transform: ${theme.transform || ''};
82
+ `;
83
+ }
84
+
85
+ type HeadingProps = TypographyProps &
86
+ ColorProps & {
87
+ mt?: string;
88
+ mb?: string;
89
+ };
90
+
91
+ export const Emphasis = styled.strong.attrs(() => ({
92
+ 'data-component-name': 'ui/Typography/Emphasis',
93
+ }))`
94
+ font-weight: var(--font-weight-bold);
95
+ `;
96
+
97
+ export const H1 = styled.h1.attrs(() => ({
98
+ 'data-component-name': 'ui/Typography/H1',
99
+ }))<HeadingProps>`
100
+ ${typography(typographyTokens.heading1)};
101
+ margin: 1.35em 0 0.9em;
102
+ && {
103
+ ${({ mt }) => mt && `margin-top: ${mt};`}
104
+ ${({ mb }) => mb && `margin-bottom: ${mb};`}
105
+ ${color}
106
+ ${typographySystem}
107
+ }
108
+ `;
109
+
110
+ export const H2 = styled.h1.attrs(() => ({
111
+ 'data-component-name': 'ui/Typography/H2',
112
+ }))<HeadingProps>`
113
+ ${typography(typographyTokens.heading2)};
114
+ margin: 1.25em 0 0.8em;
115
+ && {
116
+ ${({ mt }) => mt && `margin-top: ${mt};`}
117
+ ${({ mb }) => mb && `margin-bottom: ${mb};`}
118
+ ${color}
119
+ ${typographySystem}
120
+ }
121
+ `;
122
+
123
+ export const H3 = styled.h1.attrs(() => ({
124
+ 'data-component-name': 'ui/Typography/H3',
125
+ }))<HeadingProps>`
126
+ ${typography(typographyTokens.heading3)};
127
+ margin: 1.25em 0 0.8em;
128
+ && {
129
+ ${({ mt }) => mt && `margin-top: ${mt};`}
130
+ ${({ mb }) => mb && `margin-bottom: ${mb};`}
131
+ ${color}
132
+ ${typographySystem}
133
+ }
134
+ `;
135
+
136
+ export const SectionHeader = styled.h2`
137
+ color: var(--color-primary-main);
138
+ font-size: 1.75em;
139
+ font-weight: var(--font-weight-light);
140
+ text-align: center;
141
+ margin: 2.65em 0;
142
+ padding: 0px 20px;
143
+ font-family: var(--font-family-h);
144
+ `;
145
+
146
+ export const Typography = styled.p.attrs(() => ({
147
+ 'data-component-name': 'ui/Typography/Typography',
148
+ }))<
149
+ TypographyProps & {
150
+ color?: string;
151
+ mt?: string;
152
+ mb?: string;
153
+ }
154
+ >`
155
+ ${typography(typographyTokens.typography)};
156
+ color: var(--color-text-main);
157
+ ${color}
158
+ margin-top: ${({ mt }) => mt || '1em'};
159
+ margin-bottom: ${({ mb }) => mb || '1em'};
160
+ ${typographySystem}
161
+ `;
162
+
163
+ export const CompactTypography = styled(Typography).attrs(() => ({
164
+ mt: '0em',
165
+ mb: '0em',
166
+ 'data-component-name': 'ui/Typography/CompactTypography',
167
+ }))``;
@@ -0,0 +1,100 @@
1
+ import * as React from 'react';
2
+ import { useLocation, LinkProps } from 'react-router-dom';
3
+ import styled from 'styled-components';
4
+
5
+ import isUrl from '@theme/utils/isUrl';
6
+ import replaceHashInColor from '@theme/utils/replaceHashInColor';
7
+ import { Link } from '@portal/Link';
8
+
9
+ const StyledExternalLink = styled.a`
10
+ &.external-url {
11
+ position: relative;
12
+
13
+ :after {
14
+ content: '';
15
+ display: inline-block;
16
+ position: absolute;
17
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' version='1.1' x='0' y='0' viewBox='0 0 100 125' enable-background='new 0 0 100 100' xml:space='preserve'%3E%3Cpath fill='${({
18
+ theme,
19
+ }) =>
20
+ replaceHashInColor(
21
+ theme.colors.text.primary,
22
+ )}' d='M-408.2-318.5 98.6 4.8c0-0.1 0-0.2-0.1-0.3 0-0.1-0.1-0.2-0.1-0.3 0-0.1 0-0.1-0.1-0.2 0 0 0-0.1 0-0.1 0-0.1-0.1-0.2-0.2-0.3 0-0.1-0.1-0.2-0.2-0.3 -0.1-0.1-0.1-0.2-0.2-0.3C97.7 2.9 97.6 2.8 97.5 2.7c-0.1-0.1-0.2-0.2-0.3-0.3 -0.1-0.1-0.1-0.1-0.2-0.2 -0.1-0.1-0.2-0.2-0.3-0.2 -0.1-0.1-0.2-0.1-0.2-0.2 -0.1-0.1-0.2-0.1-0.3-0.2 -0.1 0-0.2-0.1-0.3-0.1 0 0-0.1 0-0.1-0.1 -0.1 0-0.2 0-0.2-0.1 -0.1 0-0.2-0.1-0.3-0.1 -0.1 0-0.2-0.1-0.4-0.1 -0.1 0-0.2 0-0.3 0 -0.1 0-0.3 0-0.4 0 -0.1 0-0.1 0-0.2 0L63.8 1.3c-2.5 0-4.6 2.1-4.6 4.6 0 2.5 2.1 4.6 4.6 4.5l19.3-0.1 -29.8 30.2c-1.1 1.1-1.5 2.7-1.2 4.1 0.2 0.9 0.6 1.7 1.3 2.4 0.9 0.9 2.1 1.3 3.2 1.3 1.2 0 2.3-0.5 3.2-1.4l0 0 29.8-30.2 0.1 19.3c0 2.5 2.1 4.6 4.6 4.5 1.3 0 2.4-0.5 3.2-1.4 0.8-0.8 1.3-2 1.3-3.2L98.7 5.7c0-0.1 0-0.1 0-0.2 0-0.1 0-0.2 0-0.4C98.6 5 98.6 4.9 98.6 4.8zM6.5 83.3c0 5.7 4.6 10.4 10.4 10.4l55.6 0.1c5.7 0 10.4-4.6 10.4-10.4l-0.1-40.8h6.1v40.8c0 9-7.3 16.3-16.3 16.3l-56.4-0.1c-8.6 0-15.6-7-15.6-15.6L0.6 27.8c0-9 7.3-16.3 16.3-16.3l41.1-0.1v6.1L17 17.5c-5.7 0-10.4 4.6-10.4 10.4L6.5 83.3z'/%3E%3C/svg%3E");
23
+ width: 10px;
24
+ height: 10px;
25
+ background-repeat: no-repeat;
26
+ top: 50%;
27
+ right: -15px;
28
+ transform: translateY(-50%);
29
+ }
30
+ }
31
+ `;
32
+
33
+ // TODO: We're using our own Link component so probably filtering is not necessary here.
34
+ // filter out unnecessary props
35
+ const propsList = [
36
+ 'color',
37
+ 'size',
38
+ 'variant',
39
+ 'bgColor',
40
+ 'bgImage',
41
+ 'disableArrow',
42
+ 'withIcon',
43
+ 'maxWidth',
44
+ 'inversed',
45
+ 'transparent',
46
+ 'large',
47
+ ];
48
+
49
+ export const withPropsFilter =
50
+ (filterList: string[]) => (WrappedComponent: React.FunctionComponent) =>
51
+ function WithPropsFilter(props: React.PropsWithChildren<object>): JSX.Element {
52
+ const filteredProps = Object.fromEntries(
53
+ Object.entries(props).filter(([key]) => !filterList.includes(key)),
54
+ );
55
+
56
+ return <WrappedComponent {...filteredProps} />;
57
+ };
58
+
59
+ export interface PortalLinkProps<TState> extends LinkProps<TState> {
60
+ activeClassName?: string;
61
+ activeStyle?: object;
62
+ onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
63
+ partiallyActive?: boolean;
64
+ replace?: boolean;
65
+ state?: TState;
66
+ to: string;
67
+ }
68
+
69
+ export interface UniversalLinkProps extends Partial<PortalLinkProps<object>> {
70
+ external?: boolean;
71
+ ref?: any;
72
+ }
73
+
74
+ export const UniversalLink = withPropsFilter(propsList)((props: UniversalLinkProps) => {
75
+ return (typeof props.to === 'string' && (isUrl(props.to) || props.to.startsWith('mailto:'))) ||
76
+ props.external ? (
77
+ <StyledExternalLink
78
+ style={props.style}
79
+ href={props.to}
80
+ target={props.target || (props.external && '_blank') || '_self'}
81
+ className={`${props.external ? 'external-url' : ''} ${props.className}`}
82
+ rel={props.rel}
83
+ data-cy={`universalLink-${
84
+ typeof props.children === 'string' ? props.children : 'with-nested-jsx'
85
+ }`}
86
+ >
87
+ {props.children}
88
+ </StyledExternalLink>
89
+ ) : props.to == null ? (
90
+ <a onClick={props.onClick} className={props.className} style={props.style}>
91
+ {props.children}
92
+ </a>
93
+ ) : (
94
+ <Link
95
+ {...props}
96
+ to={props.to}
97
+ state={{ previousPath: useLocation()?.pathname, ...props.state }}
98
+ />
99
+ );
100
+ });
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ export * from '@theme/ui/Button';
3
+ export * from '@theme/ui/Box';
4
+ export * from '@theme/ui/Flex';
5
+ export * from '@theme/ui/Jumbotron';
6
+ export * from '@theme/ui/Typography';
7
+ export * from '@theme/ui/Tiles/WideTile';
8
+ export * from '@theme/ui/Tiles/ThinTile';
9
+
10
+ export const LandingLayout = ({ children }: React.PropsWithChildren<object>): React.ReactNode =>
11
+ children;
12
+ export const EmptyLayout = LandingLayout;
@@ -1,4 +1,4 @@
1
- import { ClipboardService } from '../ClipboardService';
1
+ import { ClipboardService } from '@theme/utils';
2
2
 
3
3
  describe('ClipboardService', () => {
4
4
  describe('isSupported', () => {
@@ -1,4 +1,4 @@
1
- import { getCssColorVariable } from '../css-variables';
1
+ import { getCssColorVariable } from '@theme/utils';
2
2
 
3
3
  describe('css-variables', () => {
4
4
  afterEach(() => {
@@ -1,6 +1,6 @@
1
1
  import * as Prism from 'prismjs';
2
2
 
3
- import { highlight, mapLang } from '../highlight';
3
+ import { highlight, mapLang } from '@theme/utils';
4
4
 
5
5
  jest.mock('prismjs', () => {
6
6
  const original = jest.requireActual('prismjs');
@@ -1,4 +1,4 @@
1
- import { jsonToHTML } from '../jsonToHtml';
1
+ import { jsonToHTML } from '@theme/utils';
2
2
 
3
3
  const data = {
4
4
  id: '600dc3b5d617e547a0e74cb9',
@@ -1,4 +1,4 @@
1
- import { generateMediaQueries } from '../media-css';
1
+ import { generateMediaQueries } from '@theme/utils';
2
2
 
3
3
  describe('media-css helpers', () => {
4
4
  describe('generateMediaQueries function', () => {
@@ -1,4 +1,4 @@
1
- import { getTypographyCssRulesByComponentName } from '../theme-helpers';
1
+ import { getTypographyCssRulesByComponentName } from '@theme/utils';
2
2
 
3
3
  describe('getTypographyCssRulesByComponentName', () => {
4
4
  it('should return object with defined css variable for component', () => {