@redocly/theme 0.1.6 → 0.1.9

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 (405) hide show
  1. package/Footer/Footer.d.ts +3 -0
  2. package/Footer/Footer.js +35 -0
  3. package/Footer/FooterColumn.d.ts +7 -0
  4. package/Footer/FooterColumn.js +39 -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 +30 -0
  9. package/Footer/index.d.ts +4 -0
  10. package/Footer/index.js +20 -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 +31 -0
  16. package/Layout/RootLayout.d.ts +7 -0
  17. package/Layout/RootLayout.js +32 -0
  18. package/Layout/index.d.ts +2 -0
  19. package/Layout/index.js +18 -0
  20. package/Logo/Logo.d.ts +1 -6
  21. package/Logo/index.d.ts +1 -0
  22. package/Logo/index.js +17 -0
  23. package/Markdown/Admonition.d.ts +9 -0
  24. package/Markdown/Admonition.js +39 -0
  25. package/Markdown/CodeSample/CodeSample.d.ts +8 -0
  26. package/Markdown/CodeSample/CodeSample.js +30 -0
  27. package/Markdown/CodeSample/index.d.ts +3 -0
  28. package/Markdown/CodeSample/index.js +19 -0
  29. package/Markdown/CodeSample/styled.d.ts +5 -0
  30. package/Markdown/CodeSample/styled.js +109 -0
  31. package/Markdown/CodeSample/types.d.ts +9 -0
  32. package/Markdown/CodeSample/types.js +2 -0
  33. package/Markdown/ContentWrapper.d.ts +5 -0
  34. package/Markdown/ContentWrapper.js +21 -0
  35. package/Markdown/Heading.d.ts +5 -0
  36. package/Markdown/Heading.js +23 -0
  37. package/Markdown/MarkdownLayout.d.ts +7 -0
  38. package/Markdown/MarkdownLayout.js +23 -0
  39. package/Markdown/Mermaid.d.ts +6 -0
  40. package/Markdown/Mermaid.js +19 -0
  41. package/Markdown/PageWrapper.d.ts +3 -0
  42. package/Markdown/PageWrapper.js +15 -0
  43. package/Markdown/StyledMarkdown.d.ts +8 -0
  44. package/Markdown/StyledMarkdown.js +54 -0
  45. package/Markdown/Tabs/Tab.d.ts +8 -0
  46. package/Markdown/Tabs/Tab.js +35 -0
  47. package/Markdown/Tabs/Tabs.d.ts +10 -0
  48. package/Markdown/Tabs/Tabs.js +43 -0
  49. package/Markdown/Tabs/index.d.ts +2 -0
  50. package/Markdown/Tabs/index.js +18 -0
  51. package/Markdown/index.d.ts +9 -0
  52. package/Markdown/index.js +25 -0
  53. package/Navbar/Navbar.d.ts +2 -1
  54. package/Navbar/Navbar.js +9 -3
  55. package/Navbar/NavbarItem.d.ts +1 -1
  56. package/Navbar/NavbarItem.js +3 -3
  57. package/Navbar/NavbarMenu.d.ts +1 -1
  58. package/Navbar/NavbarMenu.js +8 -4
  59. package/OperationBadge/OperationBadge.d.ts +5 -0
  60. package/OperationBadge/OperationBadge.js +15 -0
  61. package/OperationBadge/index.d.ts +1 -0
  62. package/OperationBadge/index.js +17 -0
  63. package/PageNavigation/NextPageLink.d.ts +2 -0
  64. package/PageNavigation/NextPageLink.js +25 -0
  65. package/PageNavigation/PageNavigation.d.ts +2 -0
  66. package/PageNavigation/PageNavigation.js +31 -0
  67. package/PageNavigation/PreviousPageLink.d.ts +2 -0
  68. package/PageNavigation/PreviousPageLink.js +25 -0
  69. package/Panel/CodePanel.js +6 -6
  70. package/Panel/ContentPanel.js +4 -4
  71. package/Panel/Panel.d.ts +1 -1
  72. package/Panel/Panel.js +3 -3
  73. package/Panel/PanelComponent.d.ts +1 -1
  74. package/Panel/PanelComponent.js +3 -3
  75. package/Panel/index.d.ts +1 -0
  76. package/Panel/index.js +1 -0
  77. package/Search/Autocomplete.d.ts +13 -0
  78. package/Search/Autocomplete.js +79 -0
  79. package/Search/ClearIcon.d.ts +2 -0
  80. package/Search/ClearIcon.js +29 -0
  81. package/Search/Input.d.ts +3 -0
  82. package/Search/Input.js +15 -0
  83. package/Search/Parameters.d.ts +7 -0
  84. package/Search/Parameters.js +42 -0
  85. package/Search/Popover.d.ts +3 -0
  86. package/Search/Popover.js +15 -0
  87. package/Search/Search.d.ts +2 -0
  88. package/Search/Search.js +39 -0
  89. package/Search/SearchIcon.d.ts +2 -0
  90. package/Search/SearchIcon.js +29 -0
  91. package/Search/SearchItem.d.ts +7 -0
  92. package/Search/SearchItem.js +47 -0
  93. package/Search/index.d.ts +9 -0
  94. package/Search/index.js +25 -0
  95. package/Search/utils.d.ts +2 -0
  96. package/Search/utils.js +21 -0
  97. package/Sidebar/ApiCallItem.d.ts +8 -0
  98. package/Sidebar/ApiCallItem.js +35 -0
  99. package/Sidebar/ArrowBack.d.ts +4 -0
  100. package/Sidebar/ArrowBack.js +29 -0
  101. package/Sidebar/BackButton.d.ts +6 -0
  102. package/Sidebar/BackButton.js +31 -0
  103. package/Sidebar/Drilldown.d.ts +8 -0
  104. package/Sidebar/Drilldown.js +46 -0
  105. package/Sidebar/DrilldownMenu.d.ts +3 -0
  106. package/Sidebar/DrilldownMenu.js +55 -0
  107. package/Sidebar/DrilldownMenuItem.d.ts +3 -0
  108. package/Sidebar/DrilldownMenuItem.js +32 -0
  109. package/Sidebar/ExternalIcon.d.ts +4 -0
  110. package/Sidebar/ExternalIcon.js +29 -0
  111. package/Sidebar/Menu.d.ts +3 -0
  112. package/Sidebar/Menu.js +15 -0
  113. package/Sidebar/MenuContainer.d.ts +1 -0
  114. package/Sidebar/MenuContainer.js +13 -0
  115. package/Sidebar/MenuGroup.d.ts +9 -0
  116. package/Sidebar/MenuGroup.js +37 -0
  117. package/Sidebar/MenuItem.d.ts +3 -0
  118. package/Sidebar/MenuItem.js +34 -0
  119. package/Sidebar/MenuItemLabel.d.ts +5 -0
  120. package/Sidebar/MenuItemLabel.js +19 -0
  121. package/Sidebar/MenuLink.d.ts +5 -0
  122. package/Sidebar/MenuLink.js +16 -0
  123. package/Sidebar/MenuLinkItem.d.ts +3 -0
  124. package/Sidebar/MenuLinkItem.js +31 -0
  125. package/Sidebar/MobileSidebarButton.d.ts +5 -0
  126. package/Sidebar/MobileSidebarButton.js +21 -0
  127. package/Sidebar/Separator.d.ts +3 -0
  128. package/Sidebar/Separator.js +32 -0
  129. package/Sidebar/SeparatorItem.d.ts +5 -0
  130. package/Sidebar/SeparatorItem.js +14 -0
  131. package/Sidebar/SeparatorLine.d.ts +3 -0
  132. package/Sidebar/SeparatorLine.js +15 -0
  133. package/Sidebar/Sidebar.d.ts +8 -0
  134. package/Sidebar/Sidebar.js +24 -0
  135. package/Sidebar/SidebarLayout.d.ts +7 -0
  136. package/Sidebar/SidebarLayout.js +36 -0
  137. package/Sidebar/index.d.ts +19 -0
  138. package/Sidebar/index.js +35 -0
  139. package/Sidebar/types/DrilldownMenuProps.d.ts +6 -0
  140. package/Sidebar/types/DrilldownMenuProps.js +2 -0
  141. package/Sidebar/types/ItemState.d.ts +8 -0
  142. package/Sidebar/types/ItemState.js +2 -0
  143. package/Sidebar/types/MenuItemProps.d.ts +5 -0
  144. package/Sidebar/types/MenuItemProps.js +2 -0
  145. package/Sidebar/types/MenuStyle.d.ts +3 -0
  146. package/Sidebar/types/MenuStyle.js +8 -0
  147. package/Sidebar/types/NavItem.d.ts +26 -0
  148. package/Sidebar/types/NavItem.js +2 -0
  149. package/Sidebar/types/index.d.ts +5 -0
  150. package/Sidebar/types/index.js +21 -0
  151. package/SourceCode/SourceCode.js +2 -2
  152. package/TableOfContent/TableOfContent.d.ts +9 -0
  153. package/TableOfContent/TableOfContent.js +65 -0
  154. package/TableOfContent/index.d.ts +1 -0
  155. package/TableOfContent/index.js +17 -0
  156. package/globalStyle.js +1 -1
  157. package/hooks/index.d.ts +4 -0
  158. package/hooks/index.js +4 -0
  159. package/hooks/useActiveHeading.d.ts +2 -0
  160. package/hooks/useActiveHeading.js +34 -0
  161. package/hooks/useActiveSectionId.d.ts +3 -0
  162. package/hooks/useActiveSectionId.js +48 -0
  163. package/hooks/useFullHeight.d.ts +2 -0
  164. package/hooks/useFullHeight.js +47 -0
  165. package/hooks/useMobileMenu.d.ts +2 -0
  166. package/hooks/useMobileMenu.js +13 -0
  167. package/hooks/useNavbarHeight.d.ts +3 -0
  168. package/hooks/useNavbarHeight.js +20 -0
  169. package/icons/ShelfIcon/ShelfIcon.js +2 -2
  170. package/index.d.ts +2 -0
  171. package/index.js +2 -0
  172. package/mocks/hooks/usePageData.d.ts +5 -0
  173. package/mocks/hooks/usePageData.js +7 -0
  174. package/mocks/models.d.ts +3 -0
  175. package/mocks/models.js +2 -0
  176. package/mocks/search.d.ts +22 -0
  177. package/mocks/search.js +13 -0
  178. package/mocks/types/index.d.ts +1 -0
  179. package/mocks/types/index.js +2 -0
  180. package/mocks/usePreloadHistory.d.ts +3 -0
  181. package/mocks/usePreloadHistory.js +12 -0
  182. package/package.json +5 -2
  183. package/src/Button/Button.stories.tsx +1 -1
  184. package/src/Button/__tests__/Button.test.tsx +1 -1
  185. package/src/CodeBlock/__tests__/CodeBlock.test.tsx +1 -1
  186. package/src/CopyButton/CopyButton.stories.tsx +1 -1
  187. package/src/CopyButton/CopyButton.tsx +1 -1
  188. package/src/CopyButton/CopyButtonWrapper.tsx +4 -4
  189. package/src/CopyButton/__tests__/CopyButton.test.tsx +1 -1
  190. package/src/CopyButton/__tests__/CopyButtonWrapper.test.tsx +2 -1
  191. package/src/Footer/Footer.tsx +34 -0
  192. package/src/Footer/FooterColumn.tsx +62 -0
  193. package/src/Footer/FooterColumns.tsx +51 -0
  194. package/src/Footer/FooterCopyright.tsx +26 -0
  195. package/src/Footer/index.ts +4 -0
  196. package/src/Headings/Headings.stories.tsx +1 -1
  197. package/src/Headings/Headings.ts +1 -1
  198. package/src/Headings/__tests__/Headings.test.tsx +1 -1
  199. package/src/JsonViewer/JsonViewer.stories.tsx +1 -1
  200. package/src/JsonViewer/JsonViewer.tsx +6 -7
  201. package/src/JsonViewer/__tests__/JsonViewer.test.tsx +2 -1
  202. package/src/JsonViewer/index.ts +1 -0
  203. package/src/Layout/PageLayout.tsx +34 -0
  204. package/src/Layout/RootLayout.tsx +24 -0
  205. package/src/Layout/index.ts +2 -0
  206. package/src/Logo/Logo.tsx +1 -7
  207. package/src/Logo/index.ts +1 -0
  208. package/src/Markdown/Admonition.tsx +64 -0
  209. package/src/Markdown/CodeSample/CodeSample.tsx +39 -0
  210. package/src/Markdown/CodeSample/index.ts +3 -0
  211. package/src/Markdown/CodeSample/styled.ts +289 -0
  212. package/src/Markdown/CodeSample/types.ts +40 -0
  213. package/src/Markdown/ContentWrapper.tsx +20 -0
  214. package/src/Markdown/Heading.tsx +35 -0
  215. package/src/Markdown/MarkdownLayout.tsx +25 -0
  216. package/src/Markdown/Mermaid.tsx +23 -0
  217. package/src/Markdown/PageWrapper.tsx +9 -0
  218. package/src/Markdown/StyledMarkdown.tsx +312 -0
  219. package/src/Markdown/Tabs/Tab.tsx +37 -0
  220. package/src/Markdown/Tabs/Tabs.tsx +45 -0
  221. package/src/Markdown/Tabs/index.ts +2 -0
  222. package/src/Markdown/index.ts +9 -0
  223. package/src/Navbar/Navbar.stories.tsx +3 -13
  224. package/src/Navbar/Navbar.tsx +20 -26
  225. package/src/Navbar/NavbarItem.tsx +2 -2
  226. package/src/Navbar/NavbarMenu.tsx +6 -6
  227. package/src/OperationBadge/OperationBadge.stories.tsx +35 -0
  228. package/src/OperationBadge/OperationBadge.ts +59 -0
  229. package/src/OperationBadge/__tests__/OperationBadge.test.tsx +59 -0
  230. package/src/OperationBadge/__tests__/__snapshots__/OperationBadge.test.tsx.snap +651 -0
  231. package/src/OperationBadge/index.ts +1 -0
  232. package/src/PageNavigation/NextPageLink.tsx +22 -0
  233. package/src/PageNavigation/PageNavigation.tsx +20 -0
  234. package/src/PageNavigation/PreviousPageLink.tsx +22 -0
  235. package/src/Panel/CodePanel.stories.tsx +1 -2
  236. package/src/Panel/CodePanel.ts +8 -7
  237. package/src/Panel/ContentPanel.stories.tsx +1 -2
  238. package/src/Panel/ContentPanel.ts +5 -6
  239. package/src/Panel/Panel.stories.tsx +1 -3
  240. package/src/Panel/Panel.ts +3 -3
  241. package/src/Panel/PanelComponent.tsx +4 -5
  242. package/src/Panel/__tests__/CodePanel.test.tsx +1 -1
  243. package/src/Panel/__tests__/ContentPanel.test.tsx +1 -1
  244. package/src/Panel/__tests__/Panel.test.tsx +1 -2
  245. package/src/Panel/__tests__/__snapshots__/CodePanel.test.tsx.snap +8 -8
  246. package/src/Panel/__tests__/__snapshots__/ContentPanel.test.tsx.snap +22 -22
  247. package/src/Panel/__tests__/__snapshots__/Panel.test.tsx.snap +16 -16
  248. package/src/Panel/index.ts +1 -0
  249. package/src/SamplesPanelControls/SamplesControlButton.stories.tsx +1 -1
  250. package/src/SamplesPanelControls/SamplesPanelControls.ts +1 -1
  251. package/src/Search/Autocomplete.tsx +128 -0
  252. package/src/Search/ClearIcon.tsx +31 -0
  253. package/src/Search/Input.tsx +19 -0
  254. package/src/Search/Parameters.tsx +62 -0
  255. package/src/Search/Popover.tsx +20 -0
  256. package/src/Search/Search.tsx +52 -0
  257. package/src/Search/SearchIcon.tsx +32 -0
  258. package/src/Search/SearchItem.tsx +85 -0
  259. package/src/Search/index.ts +9 -0
  260. package/src/Search/utils.tsx +19 -0
  261. package/src/Sidebar/ApiCallItem.tsx +33 -0
  262. package/src/Sidebar/ArrowBack.tsx +22 -0
  263. package/src/Sidebar/BackButton.tsx +44 -0
  264. package/src/Sidebar/Drilldown.tsx +46 -0
  265. package/src/Sidebar/DrilldownMenu.tsx +58 -0
  266. package/src/Sidebar/DrilldownMenuItem.tsx +40 -0
  267. package/src/Sidebar/ExternalIcon.tsx +37 -0
  268. package/src/Sidebar/Menu.tsx +11 -0
  269. package/src/Sidebar/MenuContainer.tsx +8 -0
  270. package/src/Sidebar/MenuGroup.tsx +55 -0
  271. package/src/Sidebar/MenuItem.tsx +25 -0
  272. package/src/Sidebar/MenuItemLabel.tsx +41 -0
  273. package/src/Sidebar/MenuLink.tsx +14 -0
  274. package/src/Sidebar/MenuLinkItem.tsx +24 -0
  275. package/src/Sidebar/MobileSidebarButton.tsx +44 -0
  276. package/src/Sidebar/Separator.tsx +17 -0
  277. package/src/Sidebar/SeparatorItem.tsx +14 -0
  278. package/src/Sidebar/SeparatorLine.tsx +9 -0
  279. package/src/Sidebar/Sidebar.tsx +54 -0
  280. package/src/Sidebar/SidebarLayout.tsx +30 -0
  281. package/src/Sidebar/index.ts +19 -0
  282. package/src/Sidebar/types/DrilldownMenuProps.ts +7 -0
  283. package/src/Sidebar/types/ItemState.ts +9 -0
  284. package/src/Sidebar/types/MenuItemProps.ts +6 -0
  285. package/src/Sidebar/types/MenuStyle.ts +4 -0
  286. package/src/Sidebar/types/NavItem.ts +27 -0
  287. package/src/Sidebar/types/index.ts +5 -0
  288. package/src/SidebarLogo/SidebarLogo.stories.tsx +1 -1
  289. package/src/SidebarLogo/__tests__/SidebarLogo.test.tsx +1 -1
  290. package/src/SourceCode/SourceCode.stories.tsx +1 -1
  291. package/src/SourceCode/SourceCode.tsx +7 -3
  292. package/src/SourceCode/__tests__/SourceCode.test.tsx +2 -1
  293. package/src/TableOfContent/TableOfContent.stories.tsx +39 -0
  294. package/src/TableOfContent/TableOfContent.tsx +112 -0
  295. package/src/TableOfContent/index.ts +1 -0
  296. package/src/Tooltip/Tooltip.stories.tsx +1 -1
  297. package/src/Tooltip/Tooltip.tsx +1 -1
  298. package/src/Tooltip/__tests__/Tooltip.test.tsx +1 -1
  299. package/src/globalStyle.ts +10 -73
  300. package/src/hooks/index.ts +4 -0
  301. package/src/hooks/useActiveHeading.ts +46 -0
  302. package/src/hooks/useActiveSectionId.ts +53 -0
  303. package/src/hooks/useFullHeight.ts +47 -0
  304. package/src/hooks/useMobileMenu.ts +11 -0
  305. package/src/hooks/useNavbarHeight.ts +24 -0
  306. package/src/icons/ShelfIcon/ShelfIcon.stories.tsx +1 -1
  307. package/src/icons/ShelfIcon/ShelfIcon.tsx +1 -1
  308. package/src/icons/ShelfIcon/__tests__/ShelfIcon.test.tsx +1 -1
  309. package/src/index.ts +2 -0
  310. package/src/mocks/hooks/usePageData.ts +8 -0
  311. package/src/mocks/models.ts +3 -0
  312. package/src/mocks/search.ts +31 -0
  313. package/src/mocks/types/index.ts +1 -0
  314. package/src/mocks/usePreloadHistory.ts +9 -0
  315. package/src/types/portal/index.d.ts +6 -0
  316. package/src/types/portal/src/client/app/Sidebar/types.d.ts +50 -0
  317. package/src/types/portal/src/client/app/media-css.d.ts +7 -0
  318. package/src/types/portal/src/client/styling/default.d.ts +407 -0
  319. package/src/types/portal/src/client/styling/index.d.ts +14 -0
  320. package/src/types/portal/src/client/styling/resolve.d.ts +1 -0
  321. package/src/types/portal/src/server/constants.d.ts +11 -0
  322. package/src/types/portal/src/server/plugins/markdown/types.d.ts +28 -0
  323. package/src/types/portal/src/server/plugins/nav-utils.d.ts +19 -0
  324. package/src/types/portal/src/server/plugins/portal-config/types.d.ts +23 -0
  325. package/src/types/portal/src/server/plugins/sidebars/index.d.ts +16 -0
  326. package/src/types/portal/src/server/plugins/versions/index.d.ts +15 -0
  327. package/src/types/portal/src/server/plugins/versions/types.d.ts +23 -0
  328. package/src/types/portal/src/server/plugins/versions/utils.d.ts +10 -0
  329. package/src/types/portal/src/server/store.d.ts +101 -0
  330. package/src/types/portal/src/server/utils/async.d.ts +5 -0
  331. package/src/types/portal/src/server/utils/crypto.d.ts +3 -0
  332. package/src/types/portal/src/server/utils/fs.d.ts +3 -0
  333. package/src/types/portal/src/server/utils/index.d.ts +6 -0
  334. package/src/types/portal/src/server/utils/paths.d.ts +16 -0
  335. package/src/types/portal/src/server/utils/reporter/formatter.d.ts +11 -0
  336. package/src/types/portal/src/server/utils/reporter/reporter.d.ts +17 -0
  337. package/src/types/portal/src/server/utils/watcher.d.ts +16 -0
  338. package/src/types/portal/src/server/utils/yaml.d.ts +1 -0
  339. package/src/types/portal/src/shared/constants.d.ts +8 -0
  340. package/src/types/portal/src/shared/types.d.ts +77 -0
  341. package/src/types/portal/src/shared/urls.d.ts +7 -0
  342. package/src/types/portal/src/shared/utils.d.ts +10 -0
  343. package/src/ui/AlertIcon.tsx +110 -0
  344. package/src/ui/Arrow.tsx +36 -0
  345. package/src/ui/Background.tsx +16 -0
  346. package/src/ui/Box.tsx +39 -0
  347. package/src/ui/Button.tsx +19 -0
  348. package/src/ui/Dropdown.tsx +132 -0
  349. package/src/ui/Flex.tsx +21 -0
  350. package/src/ui/Jumbotron.tsx +57 -0
  351. package/src/ui/Tiles/ThinTile.tsx +151 -0
  352. package/src/ui/Tiles/TileHeader.ts +13 -0
  353. package/src/ui/Tiles/TileText.tsx +12 -0
  354. package/src/ui/Tiles/WideTile.tsx +138 -0
  355. package/src/ui/Tiles/index.ts +4 -0
  356. package/src/ui/Typography.tsx +167 -0
  357. package/src/ui/UniversalLink.tsx +100 -0
  358. package/src/ui/index.tsx +17 -0
  359. package/src/utils/__tests__/ClipboardService.test.ts +1 -1
  360. package/src/utils/__tests__/css-variables.test.ts +1 -1
  361. package/src/utils/__tests__/highlight.test.ts +1 -1
  362. package/src/utils/__tests__/jsonToHtml.test.ts +1 -1
  363. package/src/utils/__tests__/media-css.test.ts +1 -1
  364. package/src/utils/__tests__/theme-helpers.test.ts +1 -1
  365. package/src/utils/getNavbarElement.ts +10 -0
  366. package/src/utils/isUrl.ts +42 -0
  367. package/src/utils/replaceHashInColor.ts +3 -0
  368. package/ui/AlertIcon.d.ts +9 -0
  369. package/ui/AlertIcon.js +45 -0
  370. package/ui/Arrow.d.ts +7 -0
  371. package/ui/Arrow.js +42 -0
  372. package/ui/Background.d.ts +7 -0
  373. package/ui/Background.js +16 -0
  374. package/ui/Box.d.ts +6 -0
  375. package/ui/Box.js +16 -0
  376. package/ui/Button.d.ts +7 -0
  377. package/ui/Button.js +27 -0
  378. package/ui/Dropdown.d.ts +8 -0
  379. package/ui/Dropdown.js +55 -0
  380. package/ui/Flex.d.ts +10 -0
  381. package/ui/Flex.js +31 -0
  382. package/ui/Jumbotron.d.ts +18 -0
  383. package/ui/Jumbotron.js +44 -0
  384. package/ui/Tiles/ThinTile.d.ts +21 -0
  385. package/ui/Tiles/ThinTile.js +98 -0
  386. package/ui/Tiles/TileHeader.d.ts +5 -0
  387. package/ui/Tiles/TileHeader.js +15 -0
  388. package/ui/Tiles/TileText.d.ts +5 -0
  389. package/ui/Tiles/TileText.js +15 -0
  390. package/ui/Tiles/WideTile.d.ts +7 -0
  391. package/ui/Tiles/WideTile.js +93 -0
  392. package/ui/Tiles/index.d.ts +4 -0
  393. package/ui/Tiles/index.js +20 -0
  394. package/ui/Typography.d.ts +110 -0
  395. package/ui/Typography.js +137 -0
  396. package/ui/UniversalLink.d.ts +17 -0
  397. package/ui/UniversalLink.js +62 -0
  398. package/ui/index.d.ts +14 -0
  399. package/ui/index.js +34 -0
  400. package/utils/getNavbarElement.d.ts +1 -0
  401. package/utils/getNavbarElement.js +14 -0
  402. package/utils/isUrl.d.ts +12 -0
  403. package/utils/isUrl.js +36 -0
  404. package/utils/replaceHashInColor.d.ts +1 -0
  405. package/utils/replaceHashInColor.js +7 -0
@@ -0,0 +1,132 @@
1
+ import React, { useState, useRef, useEffect } from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ import { Link } from '@portal/Link';
5
+ import { Version } from '@theme/types/portal';
6
+
7
+ type DropdownProps = {
8
+ items: Version[];
9
+ activeItem: Version;
10
+ };
11
+
12
+ const Icon = () => (
13
+ <svg
14
+ xmlns="http://www.w3.org/2000/svg"
15
+ width="16"
16
+ height="16"
17
+ viewBox="0 0 24 24"
18
+ fill="none"
19
+ stroke="currentColor"
20
+ strokeWidth="2"
21
+ strokeLinecap="round"
22
+ strokeLinejoin="round"
23
+ >
24
+ <polyline points="6 9 12 15 18 9"></polyline>
25
+ </svg>
26
+ );
27
+
28
+ const DropDownContainer = styled.div`
29
+ position: relative;
30
+ padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 4);
31
+ `;
32
+
33
+ const DropDownHeader = styled.div`
34
+ display: flex;
35
+ justify-content: space-between;
36
+ align-items: center;
37
+ background: #fff;
38
+ padding: 8px 10px;
39
+ border-radius: 4px;
40
+ border: 1px solid #e4e7eb;
41
+ font-weight: 600;
42
+ color: var(--color-text-main);
43
+ background: var(--color-secondary-300);
44
+ `;
45
+
46
+ const DropDownList = styled.div`
47
+ position: absolute;
48
+ background: var(--color-secondary-300);
49
+ margin: 2px 20px 0 20px;
50
+ padding: 0;
51
+ border-radius: 4px;
52
+ border: 1px solid rgba(38, 50, 56, 0.2);
53
+ z-index: 9999;
54
+ left: 0;
55
+ right: 0;
56
+ `;
57
+
58
+ const IconWrapper = styled.span`
59
+ transition: transform 0.2s;
60
+ display: inline-block;
61
+ font-size: 0;
62
+ &.active {
63
+ transform: rotate(-180deg);
64
+ }
65
+ `;
66
+
67
+ const ListItem = styled.div`
68
+ background-color: var(--background-color);
69
+ padding: 0.4em 10px;
70
+ font-size: 1em;
71
+ color: var(--color-text-main);
72
+ cursor: pointer;
73
+ &:hover {
74
+ background-color: rgba(38, 50, 56, 0.12);
75
+ }
76
+ &.active {
77
+ background-color: rgba(0, 0, 0, 0.05);
78
+ }
79
+ `;
80
+
81
+ const DropDownLink = styled(Link)`
82
+ display: block;
83
+ text-decoration: none;
84
+ color: var(--color-text-main);
85
+ `;
86
+
87
+ export function Dropdown({ items, activeItem }: DropdownProps): JSX.Element {
88
+ const ref = useRef<HTMLDivElement>(null);
89
+ const [isOpen, setIsOpen] = useState(false);
90
+ const toggling = () => setIsOpen(!isOpen);
91
+ useEffect(() => {
92
+ const checkIfClickedOutside = (e: MouseEvent) => {
93
+ if (!(e.target instanceof HTMLElement)) {
94
+ return;
95
+ }
96
+
97
+ if (isOpen && ref.current && !ref.current.contains(e.target)) {
98
+ setIsOpen(false);
99
+ }
100
+ };
101
+
102
+ document.addEventListener('mousedown', checkIfClickedOutside);
103
+
104
+ return () => {
105
+ document.removeEventListener('mousedown', checkIfClickedOutside);
106
+ };
107
+ }, [isOpen]);
108
+
109
+ return (
110
+ <DropDownContainer ref={ref} data-component-name="ui/Dropdown">
111
+ <DropDownHeader onClick={toggling}>
112
+ {activeItem?.label || activeItem.version}
113
+ <IconWrapper className={isOpen ? 'active' : ''}>
114
+ <Icon />
115
+ </IconWrapper>
116
+ </DropDownHeader>
117
+ {isOpen && (
118
+ <DropDownList>
119
+ {items.map((item) => (
120
+ <ListItem
121
+ className={activeItem.version === item.version ? 'active' : ''}
122
+ onClick={toggling}
123
+ key={item?.link + item?.version}
124
+ >
125
+ <DropDownLink to={item?.link || '#'}>{item?.label || item.version}</DropDownLink>
126
+ </ListItem>
127
+ ))}
128
+ </DropDownList>
129
+ )}
130
+ </DropDownContainer>
131
+ );
132
+ }
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import { flexbox, FlexboxProps, width, WidthProps } from 'styled-system';
4
+
5
+ import { Box } from '@theme/ui/Box';
6
+
7
+ export interface FlexProps extends FlexboxProps, WidthProps {}
8
+
9
+ export const Flex = styled(Box).attrs({ 'data-component-name': 'ui/Flex' })<FlexProps>`
10
+ display: flex;
11
+ ${flexbox}
12
+ ${width}
13
+ `;
14
+
15
+ export function FlexSection(props: React.PropsWithChildren<FlexProps>): JSX.Element {
16
+ return (
17
+ <Flex {...props} width={props.width || { xs: '90%', large: 910 }}>
18
+ {props.children}
19
+ </Flex>
20
+ );
21
+ }
@@ -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,4 @@
1
+ export * from './ThinTile';
2
+ export * from './TileHeader';
3
+ export * from './TileText';
4
+ export * from './WideTile';
@@ -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
+ }))``;