@redocly/theme 0.4.7 → 0.4.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.
- package/Button/Button.d.ts +3 -3
- package/Button/Button.js +3 -7
- package/Cards/Card.d.ts +1 -1
- package/Cards/Card.js +14 -7
- package/ColorModeSwitcher/ColorModeSwitcher.js +13 -25
- package/CopyButton/CopyButton.js +13 -24
- package/CopyButton/CopyButtonWrapper.d.ts +4 -3
- package/CopyButton/CopyButtonWrapper.js +15 -26
- package/EditPageButton/EditPageButton.js +13 -4
- package/Footer/CustomFooter.d.ts +1 -1
- package/Footer/CustomFooter.js +15 -6
- package/Footer/CustomFooterNavItem.js +13 -4
- package/Footer/Footer.js +13 -4
- package/Footer/FooterColumn.js +18 -9
- package/Footer/FooterColumns.js +13 -3
- package/Footer/FooterCopyright.js +13 -2
- package/JsonViewer/JsonViewer.d.ts +4 -3
- package/JsonViewer/JsonViewer.js +17 -34
- package/LastUpdated/LastUpdated.js +13 -4
- package/Layout/PageLayout.d.ts +3 -3
- package/Layout/PageLayout.js +13 -4
- package/Layout/RootLayout.d.ts +4 -4
- package/Layout/RootLayout.js +13 -5
- package/Markdown/Admonition.d.ts +2 -2
- package/Markdown/Admonition.js +13 -5
- package/Markdown/CodeSample/CodeSample.js +14 -7
- package/Markdown/Details.d.ts +2 -2
- package/Markdown/Details.js +2 -4
- package/Markdown/Heading.d.ts +1 -1
- package/Markdown/Heading.js +15 -29
- package/Markdown/MarkdownLayout.d.ts +3 -3
- package/Markdown/MarkdownLayout.js +13 -9
- package/Markdown/MarkdownWrapper.d.ts +1 -1
- package/Markdown/Mermaid.js +2 -2
- package/Markdown/Sup.d.ts +1 -1
- package/Markdown/Sup.js +13 -2
- package/Markdown/Tabs/Tab.js +13 -2
- package/Markdown/Tabs/Tabs.d.ts +1 -1
- package/Markdown/Tabs/Tabs.js +21 -34
- package/Navbar/MobileNavbarDropdown.js +13 -3
- package/Navbar/MobileNavbarItem.js +14 -31
- package/Navbar/MobileNavbarMenu.js +15 -6
- package/Navbar/Navbar.d.ts +5 -5
- package/Navbar/Navbar.js +13 -10
- package/Navbar/NavbarDropdown.js +13 -3
- package/Navbar/NavbarItem.js +14 -8
- package/Navbar/NavbarMenu.js +15 -4
- package/NavbarLogo/NavbarLogo.d.ts +1 -1
- package/NavbarLogo/NavbarLogo.js +14 -3
- package/PageNavigation/NextPageLink.js +14 -3
- package/PageNavigation/PageNavigation.js +13 -4
- package/PageNavigation/PreviousPageLink.js +14 -3
- package/Panel/PanelComponent.d.ts +3 -3
- package/Panel/PanelComponent.js +14 -31
- package/Panel/PanelHeader.d.ts +1 -1
- package/Profile/Profile.d.ts +2 -2
- package/Profile/Profile.js +15 -9
- package/Search/Autocomplete.d.ts +1 -1
- package/Search/Autocomplete.js +3 -30
- package/Search/ClearIcon.d.ts +1 -1
- package/Search/ClearIcon.js +2 -3
- package/Search/Parameters.js +17 -17
- package/Search/Search.js +13 -3
- package/Search/SearchIcon.d.ts +1 -1
- package/Search/SearchIcon.js +2 -3
- package/Search/SearchItem.js +13 -30
- package/Search/utils.js +2 -28
- package/Sidebar/ApiCallItem.d.ts +1 -1
- package/Sidebar/ApiCallItem.js +13 -7
- package/Sidebar/ArrowBack.js +13 -5
- package/Sidebar/BackButton.d.ts +2 -2
- package/Sidebar/BackButton.js +13 -4
- package/Sidebar/Drilldown.d.ts +3 -3
- package/Sidebar/Drilldown.js +2 -6
- package/Sidebar/DrilldownMenu.d.ts +3 -3
- package/Sidebar/DrilldownMenu.js +13 -10
- package/Sidebar/DrilldownMenuItem.d.ts +1 -1
- package/Sidebar/DrilldownMenuItem.js +13 -6
- package/Sidebar/ExternalIcon.js +13 -7
- package/Sidebar/MenuGroup.d.ts +3 -3
- package/Sidebar/MenuGroup.js +13 -8
- package/Sidebar/MenuItem.d.ts +1 -1
- package/Sidebar/MenuItem.js +13 -7
- package/Sidebar/MenuLink.d.ts +1 -1
- package/Sidebar/MenuLinkItem.d.ts +3 -3
- package/Sidebar/MenuLinkItem.js +2 -2
- package/Sidebar/Separator.d.ts +1 -1
- package/Sidebar/Separator.js +13 -4
- package/Sidebar/SidebarLayout.d.ts +3 -3
- package/Sidebar/SidebarLayout.js +13 -7
- package/Sidebar/types/DrilldownMenuProps.d.ts +1 -1
- package/Sidebar/types/ItemState.d.ts +2 -2
- package/Sidebar/types/MenuItemProps.d.ts +1 -1
- package/Sidebar/types/NavItem.d.ts +1 -1
- package/SidebarLogo/SidebarLogo.js +14 -3
- package/SourceCode/SourceCode.d.ts +2 -1
- package/SourceCode/SourceCode.js +19 -32
- package/TableOfContent/TableOfContent.d.ts +1 -1
- package/TableOfContent/TableOfContent.js +21 -35
- package/TableOfContent/utils.d.ts +1 -1
- package/TableOfContent/utils.js +1 -4
- package/Tooltip/Tooltip.d.ts +1 -2
- package/Tooltip/Tooltip.js +3 -4
- package/hooks/useFullHeight.d.ts +1 -1
- package/hooks/useMobileMenu.d.ts +1 -1
- package/hooks/useOutsideClick.d.ts +1 -1
- package/icons/AlertIcon/AlertIcon.js +17 -20
- package/icons/ArrowIcon/ArrowIcon.js +13 -4
- package/icons/ColorModeIcon/ColorModeIcon.js +15 -7
- package/icons/ShelfIcon/ShelfIcon.d.ts +2 -2
- package/icons/ShelfIcon/ShelfIcon.js +13 -4
- package/mocks/Link.js +2 -5
- package/package.json +1 -1
- package/src/Button/Button.tsx +4 -3
- package/src/Cards/Card.tsx +3 -3
- package/src/ColorModeSwitcher/ColorModeSwitcher.tsx +1 -1
- package/src/CopyButton/CopyButton.tsx +1 -1
- package/src/CopyButton/CopyButtonWrapper.tsx +8 -2
- package/src/EditPageButton/EditPageButton.tsx +0 -1
- package/src/Footer/CustomFooter.tsx +2 -2
- package/src/Footer/CustomFooterNavItem.tsx +0 -1
- package/src/Footer/Footer.tsx +0 -1
- package/src/Footer/FooterColumn.tsx +0 -1
- package/src/Footer/FooterColumns.tsx +0 -1
- package/src/Footer/FooterCopyright.tsx +0 -1
- package/src/JsonViewer/JsonViewer.tsx +5 -2
- package/src/LastUpdated/LastUpdated.tsx +0 -1
- package/src/Layout/PageLayout.tsx +3 -6
- package/src/Layout/RootLayout.tsx +4 -4
- package/src/Markdown/Admonition.tsx +2 -2
- package/src/Markdown/CodeSample/CodeSample.tsx +1 -1
- package/src/Markdown/Details.tsx +2 -2
- package/src/Markdown/Heading.tsx +2 -1
- package/src/Markdown/MarkdownLayout.tsx +3 -3
- package/src/Markdown/MarkdownWrapper.tsx +2 -1
- package/src/Markdown/Mermaid.tsx +0 -1
- package/src/Markdown/Sup.tsx +1 -1
- package/src/Markdown/Tabs/Tab.tsx +0 -1
- package/src/Markdown/Tabs/Tabs.tsx +2 -2
- package/src/Navbar/MobileNavbarDropdown.tsx +0 -1
- package/src/Navbar/MobileNavbarItem.tsx +1 -1
- package/src/Navbar/MobileNavbarMenu.tsx +0 -1
- package/src/Navbar/Navbar.tsx +6 -5
- package/src/Navbar/NavbarDropdown.tsx +0 -1
- package/src/Navbar/NavbarItem.tsx +0 -1
- package/src/Navbar/NavbarMenu.tsx +0 -1
- package/src/NavbarLogo/NavbarLogo.tsx +2 -2
- package/src/PageNavigation/NextPageLink.tsx +0 -1
- package/src/PageNavigation/PageNavigation.tsx +0 -1
- package/src/PageNavigation/PreviousPageLink.tsx +0 -1
- package/src/Panel/PanelComponent.tsx +6 -9
- package/src/Panel/PanelHeader.ts +1 -1
- package/src/Profile/Profile.tsx +1 -1
- package/src/Search/Autocomplete.tsx +2 -8
- package/src/Search/ClearIcon.tsx +1 -1
- package/src/Search/Parameters.tsx +0 -1
- package/src/Search/Search.tsx +0 -1
- package/src/Search/SearchIcon.tsx +1 -1
- package/src/Search/SearchItem.tsx +1 -1
- package/src/Search/utils.tsx +0 -1
- package/src/Sidebar/ApiCallItem.tsx +2 -2
- package/src/Sidebar/ArrowBack.tsx +0 -1
- package/src/Sidebar/BackButton.tsx +2 -5
- package/src/Sidebar/Drilldown.tsx +4 -3
- package/src/Sidebar/DrilldownMenu.tsx +4 -3
- package/src/Sidebar/DrilldownMenuItem.tsx +1 -2
- package/src/Sidebar/ExternalIcon.tsx +0 -1
- package/src/Sidebar/MenuGroup.tsx +4 -3
- package/src/Sidebar/MenuItem.tsx +2 -2
- package/src/Sidebar/MenuLink.tsx +3 -1
- package/src/Sidebar/MenuLinkItem.tsx +4 -6
- package/src/Sidebar/Separator.tsx +2 -2
- package/src/Sidebar/SidebarLayout.tsx +3 -3
- package/src/Sidebar/types/DrilldownMenuProps.ts +1 -1
- package/src/Sidebar/types/ItemState.ts +2 -2
- package/src/Sidebar/types/MenuItemProps.ts +1 -1
- package/src/Sidebar/types/NavItem.ts +1 -1
- package/src/SidebarLogo/SidebarLogo.tsx +0 -1
- package/src/SourceCode/SourceCode.tsx +8 -2
- package/src/TableOfContent/TableOfContent.tsx +4 -4
- package/src/TableOfContent/utils.ts +2 -5
- package/src/Tooltip/Tooltip.tsx +1 -1
- package/src/hooks/useFullHeight.ts +2 -1
- package/src/hooks/useMobileMenu.ts +2 -1
- package/src/hooks/useOutsideClick.ts +2 -1
- package/src/icons/AlertIcon/AlertIcon.tsx +0 -1
- package/src/icons/ArrowIcon/ArrowIcon.tsx +0 -1
- package/src/icons/ColorModeIcon/ColorModeIcon.tsx +0 -1
- package/src/icons/ShelfIcon/ShelfIcon.tsx +2 -2
- package/src/mocks/Link.tsx +0 -1
- package/src/types/portal/src/shared/types.d.ts +2 -1
- package/src/ui/Box.tsx +2 -8
- package/src/ui/Burger.tsx +1 -1
- package/src/ui/Dropdown.tsx +3 -2
- package/src/ui/Flex.tsx +4 -3
- package/src/ui/Tiles/ThinTile.tsx +4 -3
- package/src/ui/Tiles/WideTile.tsx +5 -4
- package/src/ui/UniversalLink.tsx +11 -11
- package/src/ui/darkColors.tsx +9 -1
- package/src/ui/index.tsx +2 -3
- package/ui/Box.d.ts +1 -1
- package/ui/Burger.d.ts +1 -1
- package/ui/Burger.js +13 -5
- package/ui/Dropdown.d.ts +1 -1
- package/ui/Dropdown.js +14 -32
- package/ui/Flex.d.ts +3 -3
- package/ui/Flex.js +2 -2
- package/ui/Tiles/ThinTile.d.ts +2 -1
- package/ui/Tiles/ThinTile.js +14 -30
- package/ui/Tiles/WideTile.d.ts +1 -1
- package/ui/Tiles/WideTile.js +14 -30
- package/ui/UniversalLink.d.ts +5 -5
- package/ui/UniversalLink.js +3 -26
- package/ui/darkColors.js +1 -1
- package/ui/index.d.ts +3 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction
|
|
1
|
+
import type { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
2
3
|
import { useHistory } from 'react-router-dom';
|
|
3
4
|
|
|
4
5
|
export function useMobileMenu(initialState = false): [boolean, Dispatch<SetStateAction<boolean>>] {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import styled, { css } from 'styled-components';
|
|
2
|
+
import type { CSSProperties } from 'react';
|
|
3
3
|
|
|
4
4
|
import { getCssColorVariable } from '@theme/utils';
|
|
5
5
|
|
|
@@ -16,7 +16,7 @@ export interface ShelfIconProps {
|
|
|
16
16
|
size?: string;
|
|
17
17
|
color?: string;
|
|
18
18
|
direction: 'left' | 'right' | 'up' | 'down';
|
|
19
|
-
style?:
|
|
19
|
+
style?: CSSProperties;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
const IntShelfIcon = ({ className, style }: ShelfIconProps): JSX.Element => (
|
package/src/mocks/Link.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { PERMISSION_PROP_NAME } from './constants';
|
|
3
|
+
import type { ComponentType } from 'react';
|
|
3
4
|
export declare type ResolvedNavLinkItem = {
|
|
4
5
|
type: 'link';
|
|
5
6
|
link: string;
|
|
@@ -73,7 +74,7 @@ export interface PageData {
|
|
|
73
74
|
versions?: Version[];
|
|
74
75
|
}
|
|
75
76
|
export interface CachedPageData extends PageData {
|
|
76
|
-
Template:
|
|
77
|
+
Template: ComponentType<{
|
|
77
78
|
pageProps: PageProps;
|
|
78
79
|
}>;
|
|
79
80
|
}
|
package/src/ui/Box.tsx
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
space,
|
|
3
|
-
position,
|
|
4
|
-
flex,
|
|
5
|
-
textAlign,
|
|
6
|
-
color,
|
|
7
|
-
border,
|
|
8
|
-
layout,
|
|
1
|
+
import type {
|
|
9
2
|
SpaceProps,
|
|
10
3
|
LayoutProps,
|
|
11
4
|
TextAlignProps,
|
|
@@ -14,6 +7,7 @@ import {
|
|
|
14
7
|
FlexProps,
|
|
15
8
|
BordersProps,
|
|
16
9
|
} from 'styled-system';
|
|
10
|
+
import { space, position, flex, textAlign, color, border, layout } from 'styled-system';
|
|
17
11
|
import styled from 'styled-components';
|
|
18
12
|
|
|
19
13
|
export interface BoxProps
|
package/src/ui/Burger.tsx
CHANGED
package/src/ui/Dropdown.tsx
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useState, useRef, useEffect } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
+
import type { Version } from '@theme/types/portal';
|
|
5
|
+
|
|
4
6
|
import { Link } from '@portal/Link';
|
|
5
|
-
import { Version } from '@theme/types/portal';
|
|
6
7
|
|
|
7
8
|
type DropdownProps = {
|
|
8
9
|
items: Version[];
|
package/src/ui/Flex.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import styled from 'styled-components';
|
|
3
|
-
import {
|
|
2
|
+
import type { FlexboxProps, WidthProps } from 'styled-system';
|
|
3
|
+
import { flexbox, width } from 'styled-system';
|
|
4
|
+
import type { PropsWithChildren } from 'react';
|
|
4
5
|
|
|
5
6
|
import { Box } from '@theme/ui/Box';
|
|
6
7
|
|
|
@@ -13,7 +14,7 @@ export const Flex = styled(Box).attrs({ 'data-component-name': 'ui/Flex' })<Flex
|
|
|
13
14
|
${width}
|
|
14
15
|
`;
|
|
15
16
|
|
|
16
|
-
export function FlexSection(props:
|
|
17
|
+
export function FlexSection(props: PropsWithChildren<FlexProps>): JSX.Element {
|
|
17
18
|
return (
|
|
18
19
|
<Flex {...props} width={props.width || { xs: '90%', large: 910 }}>
|
|
19
20
|
{props.children}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import { Component } from 'react';
|
|
2
3
|
import styled from 'styled-components';
|
|
3
4
|
|
|
4
5
|
import { Link } from '@portal/Link';
|
|
@@ -28,7 +29,7 @@ const ThinTileWrapper = styled(Link)<{ bgColor?: string; bgImage?: string }>`
|
|
|
28
29
|
display: flex;
|
|
29
30
|
flex-direction: column;
|
|
30
31
|
border-radius: 10px;
|
|
31
|
-
box-shadow:
|
|
32
|
+
box-shadow: 0 10px 30px 0 rgba(35, 35, 35, 0.1);
|
|
32
33
|
box-sizing: border-box;
|
|
33
34
|
transition: box-shadow 0.25s ease;
|
|
34
35
|
padding: 24px;
|
|
@@ -40,7 +41,7 @@ const ThinTileWrapper = styled(Link)<{ bgColor?: string; bgImage?: string }>`
|
|
|
40
41
|
background-repeat: no-repeat;
|
|
41
42
|
|
|
42
43
|
:hover {
|
|
43
|
-
box-shadow:
|
|
44
|
+
box-shadow: 0 10px 100px 0 rgba(35, 35, 35, 0.2);
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
${({ theme }) => theme.mediaQueries.small} {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Component } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
+
import type { TileProps } from '@theme/ui';
|
|
5
|
+
|
|
4
6
|
import { Link } from '@portal/Link';
|
|
5
|
-
import { TileProps } from '@theme/ui';
|
|
6
7
|
import { TileText } from '@theme/ui/Tiles/TileText';
|
|
7
8
|
import { TileHeader } from '@theme/ui/Tiles/TileHeader';
|
|
8
9
|
|
|
@@ -18,7 +19,7 @@ const WideTileWrapper = styled(Link)<{
|
|
|
18
19
|
display: inline-flex;
|
|
19
20
|
flex-direction: ${({ withIcon }) => (withIcon ? 'column' : 'row')};
|
|
20
21
|
border-radius: 10px;
|
|
21
|
-
box-shadow:
|
|
22
|
+
box-shadow: 0 10px 30px 0 rgba(35, 35, 35, 0.1);
|
|
22
23
|
background-color: ${({ bgColor }) => bgColor || 'var(--wide-tile-background-color)'};
|
|
23
24
|
background-image: ${({ bgImage }) => (bgImage ? `url(${bgImage})` : 'none')};
|
|
24
25
|
background-repeat: no-repeat;
|
|
@@ -31,7 +32,7 @@ const WideTileWrapper = styled(Link)<{
|
|
|
31
32
|
width: 100%;
|
|
32
33
|
transition: box-shadow 0.25s ease;
|
|
33
34
|
:hover {
|
|
34
|
-
box-shadow:
|
|
35
|
+
box-shadow: 0 10px 30px 0 rgba(35, 35, 35, 0.2);
|
|
35
36
|
}
|
|
36
37
|
:before {
|
|
37
38
|
content: ${({ disableArrow }) => (disableArrow ? 'none' : '""')};
|
package/src/ui/UniversalLink.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useLocation
|
|
1
|
+
import type { LinkProps } from 'react-router-dom';
|
|
2
|
+
import { useLocation } from 'react-router-dom';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
+
import type { FunctionComponent, MouseEvent, PropsWithChildren } from 'react';
|
|
4
5
|
|
|
5
6
|
import { isUrl } from '@theme/utils/isUrl';
|
|
6
7
|
import { Link } from '@portal/Link';
|
|
@@ -41,20 +42,19 @@ const propsList = [
|
|
|
41
42
|
'large',
|
|
42
43
|
];
|
|
43
44
|
|
|
44
|
-
export const withPropsFilter =
|
|
45
|
-
(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
);
|
|
45
|
+
export const withPropsFilter = (filterList: string[]) => (WrappedComponent: FunctionComponent) =>
|
|
46
|
+
function WithPropsFilter(props: PropsWithChildren<object>): JSX.Element {
|
|
47
|
+
const filteredProps = Object.fromEntries(
|
|
48
|
+
Object.entries(props).filter(([key]) => !filterList.includes(key)),
|
|
49
|
+
);
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
return <WrappedComponent {...filteredProps} />;
|
|
52
|
+
};
|
|
53
53
|
|
|
54
54
|
export interface PortalLinkProps<TState> extends LinkProps<TState> {
|
|
55
55
|
activeClassName?: string;
|
|
56
56
|
activeStyle?: object;
|
|
57
|
-
onClick?: (event:
|
|
57
|
+
onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
58
58
|
partiallyActive?: boolean;
|
|
59
59
|
replace?: boolean;
|
|
60
60
|
state?: TState;
|
package/src/ui/darkColors.tsx
CHANGED
|
@@ -17,8 +17,16 @@ export const darkMode = css`
|
|
|
17
17
|
--link-hover-text-color: #57a5fd;
|
|
18
18
|
--link-text-color: #57a5fd;
|
|
19
19
|
--code-block-background-color: #1e2633;
|
|
20
|
-
--admonition-attention-background-color:
|
|
20
|
+
--admonition-attention-background-color: var(--color-primary-300);
|
|
21
|
+
--admonition-attention-icon-color: var(--color-emphasis-700);
|
|
21
22
|
--admonition-warning-background-color: #614b17;
|
|
23
|
+
--admonition-warning-icon-color: #4c3b12;
|
|
24
|
+
--admonition-success-background-color: #267e74;
|
|
25
|
+
--admonition-success-icon-color: #38b9a5;
|
|
26
|
+
--admonition-danger-background-color: #d6524c;
|
|
27
|
+
--admonition-danger-icon-color: #d13e37;
|
|
28
|
+
--admonition-info-background-color: #696969;
|
|
29
|
+
--admonition-info-icon-color: #505050;
|
|
22
30
|
--inline-code-background-color: #1e2633;
|
|
23
31
|
--toc-item-active-background-color: #1e2633;
|
|
24
32
|
--sidebar-item-active-background-color: #1e2633;
|
package/src/ui/index.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { PropsWithChildren, ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
export * from '@theme/ui/Tiles';
|
|
4
4
|
export * from '@theme/ui/Background';
|
|
@@ -8,6 +8,5 @@ export * from '@theme/ui/Flex';
|
|
|
8
8
|
export * from '@theme/ui/Jumbotron';
|
|
9
9
|
export * from '@theme/ui/UniversalLink';
|
|
10
10
|
|
|
11
|
-
export const LandingLayout = ({ children }:
|
|
12
|
-
children;
|
|
11
|
+
export const LandingLayout = ({ children }: PropsWithChildren<object>): ReactNode => children;
|
|
13
12
|
export const EmptyLayout = LandingLayout;
|
package/ui/Box.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SpaceProps, LayoutProps, TextAlignProps, ColorProps, PositionProps, FlexProps, BordersProps } from 'styled-system';
|
|
1
|
+
import type { SpaceProps, LayoutProps, TextAlignProps, ColorProps, PositionProps, FlexProps, BordersProps } from 'styled-system';
|
|
2
2
|
export interface BoxProps extends SpaceProps, LayoutProps, PositionProps, FlexProps, TextAlignProps, ColorProps, BordersProps {
|
|
3
3
|
}
|
|
4
4
|
export declare const Box: import("styled-components").StyledComponent<"div", any, {
|
package/ui/Burger.d.ts
CHANGED
package/ui/Burger.js
CHANGED
|
@@ -3,19 +3,27 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
4
|
return cooked;
|
|
5
5
|
};
|
|
6
|
+
var __assign = (this && this.__assign) || function () {
|
|
7
|
+
__assign = Object.assign || function(t) {
|
|
8
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
+
s = arguments[i];
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
return __assign.apply(this, arguments);
|
|
16
|
+
};
|
|
6
17
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
18
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
19
|
};
|
|
9
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
21
|
exports.Burger = void 0;
|
|
11
|
-
var
|
|
22
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
12
23
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
13
24
|
function BurgerComponent(_a) {
|
|
14
25
|
var onClick = _a.onClick, className = _a.className;
|
|
15
|
-
return (
|
|
16
|
-
react_1.default.createElement(Line, null),
|
|
17
|
-
react_1.default.createElement(Line, null),
|
|
18
|
-
react_1.default.createElement(Line, null)));
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)(Button, __assign({ onClick: onClick, className: className, "data-component-name": "ui/Burger" }, { children: [(0, jsx_runtime_1.jsx)(Line, {}), (0, jsx_runtime_1.jsx)(Line, {}), (0, jsx_runtime_1.jsx)(Line, {})] })));
|
|
19
27
|
}
|
|
20
28
|
var Button = styled_components_1.default.button(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n all: unset;\n max-width: 30px;\n width: 100%;\n min-width: 10px;\n display: block;\n cursor: pointer;\n"], ["\n all: unset;\n max-width: 30px;\n width: 100%;\n min-width: 10px;\n display: block;\n cursor: pointer;\n"])));
|
|
21
29
|
var Line = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin: 4px 0;\n width: 100%;\n height: 2px;\n background: #fff;\n border-radius: 1px;\n"], ["\n margin: 4px 0;\n width: 100%;\n height: 2px;\n background: #fff;\n border-radius: 1px;\n"])));
|
package/ui/Dropdown.d.ts
CHANGED
package/ui/Dropdown.js
CHANGED
|
@@ -3,28 +3,16 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
4
|
return cooked;
|
|
5
5
|
};
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}));
|
|
17
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
-
}) : function(o, v) {
|
|
20
|
-
o["default"] = v;
|
|
21
|
-
});
|
|
22
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
-
if (mod && mod.__esModule) return mod;
|
|
24
|
-
var result = {};
|
|
25
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
-
__setModuleDefault(result, mod);
|
|
27
|
-
return result;
|
|
6
|
+
var __assign = (this && this.__assign) || function () {
|
|
7
|
+
__assign = Object.assign || function(t) {
|
|
8
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
+
s = arguments[i];
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
return __assign.apply(this, arguments);
|
|
28
16
|
};
|
|
29
17
|
var __read = (this && this.__read) || function (o, n) {
|
|
30
18
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
@@ -47,11 +35,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
47
35
|
};
|
|
48
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
37
|
exports.Dropdown = void 0;
|
|
50
|
-
var
|
|
38
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
+
var react_1 = require("react");
|
|
51
40
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
52
41
|
var Link_1 = require("../mocks/Link");
|
|
53
|
-
var Icon = function () { return (
|
|
54
|
-
react_1.default.createElement("polyline", { points: "6 9 12 15 18 9" }))); };
|
|
42
|
+
var Icon = function () { return ((0, jsx_runtime_1.jsx)("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, { children: (0, jsx_runtime_1.jsx)("polyline", { points: "6 9 12 15 18 9" }) }))); };
|
|
55
43
|
var DropDownContainer = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 4);\n"], ["\n position: relative;\n padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 4);\n"])));
|
|
56
44
|
var DropDownHeader = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n background: #fff;\n padding: 8px 10px;\n border-radius: 4px;\n border: 1px solid #e4e7eb;\n font-weight: 600;\n color: var(--text-color);\n background: var(--color-secondary-200);\n"], ["\n display: flex;\n justify-content: space-between;\n align-items: center;\n background: #fff;\n padding: 8px 10px;\n border-radius: 4px;\n border: 1px solid #e4e7eb;\n font-weight: 600;\n color: var(--text-color);\n background: var(--color-secondary-200);\n"])));
|
|
57
45
|
var DropDownList = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n background: var(--color-secondary-200);\n margin: 2px 20px 0 20px;\n padding: 0;\n border-radius: 4px;\n border: 1px solid rgba(38, 50, 56, 0.2);\n z-index: 9999;\n left: 0;\n right: 0;\n"], ["\n position: absolute;\n background: var(--color-secondary-200);\n margin: 2px 20px 0 20px;\n padding: 0;\n border-radius: 4px;\n border: 1px solid rgba(38, 50, 56, 0.2);\n z-index: 9999;\n left: 0;\n right: 0;\n"])));
|
|
@@ -77,13 +65,7 @@ function Dropdown(_a) {
|
|
|
77
65
|
document.removeEventListener('mousedown', checkIfClickedOutside);
|
|
78
66
|
};
|
|
79
67
|
}, [isOpen]);
|
|
80
|
-
return (
|
|
81
|
-
react_1.default.createElement(DropDownHeader, { onClick: toggling },
|
|
82
|
-
(activeItem === null || activeItem === void 0 ? void 0 : activeItem.label) || activeItem.version,
|
|
83
|
-
react_1.default.createElement(IconWrapper, { className: isOpen ? 'active' : '' },
|
|
84
|
-
react_1.default.createElement(Icon, null))),
|
|
85
|
-
isOpen && (react_1.default.createElement(DropDownList, null, items.map(function (item) { return (react_1.default.createElement(ListItem, { className: activeItem.version === item.version ? 'active' : '', onClick: toggling, key: (item === null || item === void 0 ? void 0 : item.link) + (item === null || item === void 0 ? void 0 : item.version) },
|
|
86
|
-
react_1.default.createElement(DropDownLink, { to: (item === null || item === void 0 ? void 0 : item.link) || '#' }, (item === null || item === void 0 ? void 0 : item.label) || item.version))); })))));
|
|
68
|
+
return ((0, jsx_runtime_1.jsxs)(DropDownContainer, __assign({ ref: ref, "data-component-name": "ui/Dropdown" }, { children: [(0, jsx_runtime_1.jsxs)(DropDownHeader, __assign({ onClick: toggling }, { children: [(activeItem === null || activeItem === void 0 ? void 0 : activeItem.label) || activeItem.version, (0, jsx_runtime_1.jsx)(IconWrapper, __assign({ className: isOpen ? 'active' : '' }, { children: (0, jsx_runtime_1.jsx)(Icon, {}) }))] })), isOpen && ((0, jsx_runtime_1.jsx)(DropDownList, { children: items.map(function (item) { return ((0, jsx_runtime_1.jsx)(ListItem, __assign({ className: activeItem.version === item.version ? 'active' : '', onClick: toggling }, { children: (0, jsx_runtime_1.jsx)(DropDownLink, __assign({ to: (item === null || item === void 0 ? void 0 : item.link) || '#' }, { children: (item === null || item === void 0 ? void 0 : item.label) || item.version })) }), (item === null || item === void 0 ? void 0 : item.link) + (item === null || item === void 0 ? void 0 : item.version))); }) }))] })));
|
|
87
69
|
}
|
|
88
70
|
exports.Dropdown = Dropdown;
|
|
89
71
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
package/ui/Flex.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import type { FlexboxProps, WidthProps } from 'styled-system';
|
|
2
|
+
import type { PropsWithChildren } from 'react';
|
|
3
3
|
export interface FlexProps extends FlexboxProps, WidthProps {
|
|
4
4
|
}
|
|
5
5
|
export declare const Flex: import("styled-components").StyledComponent<"div", any, {
|
|
@@ -7,4 +7,4 @@ export declare const Flex: import("styled-components").StyledComponent<"div", an
|
|
|
7
7
|
} & import("../ui/Box").BoxProps & {
|
|
8
8
|
'data-component-name': string;
|
|
9
9
|
} & FlexProps, "data-component-name">;
|
|
10
|
-
export declare function FlexSection(props:
|
|
10
|
+
export declare function FlexSection(props: PropsWithChildren<FlexProps>): JSX.Element;
|
package/ui/Flex.js
CHANGED
|
@@ -19,13 +19,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.FlexSection = exports.Flex = void 0;
|
|
22
|
-
var
|
|
22
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
23
23
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
24
24
|
var styled_system_1 = require("styled-system");
|
|
25
25
|
var Box_1 = require("../ui/Box");
|
|
26
26
|
exports.Flex = (0, styled_components_1.default)(Box_1.Box).attrs({ 'data-component-name': 'ui/Flex' })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n ", "\n ", "\n"], ["\n display: flex;\n flex-wrap: wrap;\n ", "\n ", "\n"])), styled_system_1.flexbox, styled_system_1.width);
|
|
27
27
|
function FlexSection(props) {
|
|
28
|
-
return (
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)(exports.Flex, __assign({}, props, { width: props.width || { xs: '90%', large: 910 } }, { children: props.children })));
|
|
29
29
|
}
|
|
30
30
|
exports.FlexSection = FlexSection;
|
|
31
31
|
var templateObject_1;
|
package/ui/Tiles/ThinTile.d.ts
CHANGED
package/ui/Tiles/ThinTile.js
CHANGED
|
@@ -18,41 +18,30 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
18
18
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
19
19
|
};
|
|
20
20
|
})();
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}));
|
|
32
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
33
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
34
|
-
}) : function(o, v) {
|
|
35
|
-
o["default"] = v;
|
|
36
|
-
});
|
|
37
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
38
|
-
if (mod && mod.__esModule) return mod;
|
|
39
|
-
var result = {};
|
|
40
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
41
|
-
__setModuleDefault(result, mod);
|
|
42
|
-
return result;
|
|
21
|
+
var __assign = (this && this.__assign) || function () {
|
|
22
|
+
__assign = Object.assign || function(t) {
|
|
23
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
24
|
+
s = arguments[i];
|
|
25
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
26
|
+
t[p] = s[p];
|
|
27
|
+
}
|
|
28
|
+
return t;
|
|
29
|
+
};
|
|
30
|
+
return __assign.apply(this, arguments);
|
|
43
31
|
};
|
|
44
32
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
45
33
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
34
|
};
|
|
47
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
36
|
exports.ThinTile = void 0;
|
|
49
|
-
var
|
|
37
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
var react_1 = require("react");
|
|
50
39
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
51
40
|
var Link_1 = require("../../mocks/Link");
|
|
52
41
|
var Flex_1 = require("../../ui/Flex");
|
|
53
42
|
var TileText_1 = require("../../ui/Tiles/TileText");
|
|
54
43
|
var TileHeader_1 = require("../../ui/Tiles/TileHeader");
|
|
55
|
-
var ThinTileWrapper = (0, styled_components_1.default)(Link_1.Link)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n border-radius: 10px;\n box-shadow:
|
|
44
|
+
var ThinTileWrapper = (0, styled_components_1.default)(Link_1.Link)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n border-radius: 10px;\n box-shadow: 0 10px 30px 0 rgba(35, 35, 35, 0.1);\n box-sizing: border-box;\n transition: box-shadow 0.25s ease;\n padding: 24px;\n margin-bottom: 20px;\n text-decoration: none;\n width: 100%;\n background-color: ", ";\n background-image: ", ";\n background-repeat: no-repeat;\n\n :hover {\n box-shadow: 0 10px 100px 0 rgba(35, 35, 35, 0.2);\n }\n\n ", " {\n width: calc(50% - 20px);\n margin-right: 10px;\n margin-left: 10px;\n }\n\n ", " {\n width: 250px;\n }\n\n ", " {\n width: 280px;\n }\n\n &.external-url {\n :after {\n display: none;\n }\n }\n"], ["\n display: flex;\n flex-direction: column;\n border-radius: 10px;\n box-shadow: 0 10px 30px 0 rgba(35, 35, 35, 0.1);\n box-sizing: border-box;\n transition: box-shadow 0.25s ease;\n padding: 24px;\n margin-bottom: 20px;\n text-decoration: none;\n width: 100%;\n background-color: ", ";\n background-image: ", ";\n background-repeat: no-repeat;\n\n :hover {\n box-shadow: 0 10px 100px 0 rgba(35, 35, 35, 0.2);\n }\n\n ", " {\n width: calc(50% - 20px);\n margin-right: 10px;\n margin-left: 10px;\n }\n\n ", " {\n width: 250px;\n }\n\n ", " {\n width: 280px;\n }\n\n &.external-url {\n :after {\n display: none;\n }\n }\n"])), function (_a) {
|
|
56
45
|
var bgColor = _a.bgColor;
|
|
57
46
|
return bgColor || 'var(--thin-tile-background-color)';
|
|
58
47
|
}, function (_a) {
|
|
@@ -101,12 +90,7 @@ var ThinTile = /** @class */ (function (_super) {
|
|
|
101
90
|
var Wrapper = to
|
|
102
91
|
? ThinTileWrapper
|
|
103
92
|
: ThinTileWrapper.withComponent('div');
|
|
104
|
-
return (
|
|
105
|
-
(icon || header) && (react_1.default.createElement(Flex_1.Flex, { flexDirection: "column" },
|
|
106
|
-
icon && (react_1.default.createElement(Flex_1.Flex, { flexShrink: 0, height: { xs: 'auto', small: '100px', medium: '110px' }, alignItems: "center", justifyContent: "center", mb: "25px" },
|
|
107
|
-
react_1.default.createElement(ThinTileIcon, { src: icon }))),
|
|
108
|
-
header && (react_1.default.createElement(ThinTileHeader, { align: headerAlign, color: color, "data-cy": "Thin-".concat(header) }, header)))),
|
|
109
|
-
children && (react_1.default.createElement(ThinTileText, { icon: icon, align: textAlign, color: color }, children))));
|
|
93
|
+
return ((0, jsx_runtime_1.jsxs)(Wrapper, __assign({ to: to, target: target, color: color, className: className, style: style, "data-component-name": "ui/Tiles/ThinTile" }, { children: [(icon || header) && ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, __assign({ flexDirection: "column" }, { children: [icon && ((0, jsx_runtime_1.jsx)(Flex_1.Flex, __assign({ flexShrink: 0, height: { xs: 'auto', small: '100px', medium: '110px' }, alignItems: "center", justifyContent: "center", mb: "25px" }, { children: (0, jsx_runtime_1.jsx)(ThinTileIcon, { src: icon }) }))), header && ((0, jsx_runtime_1.jsx)(ThinTileHeader, __assign({ align: headerAlign, color: color, "data-cy": "Thin-".concat(header) }, { children: header })))] }))), children && ((0, jsx_runtime_1.jsx)(ThinTileText, __assign({ icon: icon, align: textAlign, color: color }, { children: children })))] })));
|
|
110
94
|
};
|
|
111
95
|
return ThinTile;
|
|
112
96
|
}(react_1.Component));
|
package/ui/Tiles/WideTile.d.ts
CHANGED
package/ui/Tiles/WideTile.js
CHANGED
|
@@ -18,41 +18,30 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
18
18
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
19
19
|
};
|
|
20
20
|
})();
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}));
|
|
32
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
33
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
34
|
-
}) : function(o, v) {
|
|
35
|
-
o["default"] = v;
|
|
36
|
-
});
|
|
37
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
38
|
-
if (mod && mod.__esModule) return mod;
|
|
39
|
-
var result = {};
|
|
40
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
41
|
-
__setModuleDefault(result, mod);
|
|
42
|
-
return result;
|
|
21
|
+
var __assign = (this && this.__assign) || function () {
|
|
22
|
+
__assign = Object.assign || function(t) {
|
|
23
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
24
|
+
s = arguments[i];
|
|
25
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
26
|
+
t[p] = s[p];
|
|
27
|
+
}
|
|
28
|
+
return t;
|
|
29
|
+
};
|
|
30
|
+
return __assign.apply(this, arguments);
|
|
43
31
|
};
|
|
44
32
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
45
33
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
34
|
};
|
|
47
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
36
|
exports.WideTile = void 0;
|
|
49
|
-
var
|
|
37
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
var react_1 = require("react");
|
|
50
39
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
51
40
|
var Link_1 = require("../../mocks/Link");
|
|
52
41
|
var TileText_1 = require("../../ui/Tiles/TileText");
|
|
53
42
|
var TileHeader_1 = require("../../ui/Tiles/TileHeader");
|
|
54
43
|
// prettier-ignore
|
|
55
|
-
var WideTileWrapper = (0, styled_components_1.default)(Link_1.Link)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n flex-direction: ", ";\n border-radius: 10px;\n box-shadow:
|
|
44
|
+
var WideTileWrapper = (0, styled_components_1.default)(Link_1.Link)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n flex-direction: ", ";\n border-radius: 10px;\n box-shadow: 0 10px 30px 0 rgba(35, 35, 35, 0.1);\n background-color: ", ";\n background-image: ", ";\n background-repeat: no-repeat;\n padding: 24px;\n padding-right: ", ";\n margin-bottom: 32px;\n box-sizing: border-box;\n position: relative;\n text-decoration: none;\n width: 100%;\n transition: box-shadow 0.25s ease;\n :hover {\n box-shadow: 0 10px 30px 0 rgba(35, 35, 35, 0.2);\n }\n :before {\n content: ", ";\n display: inline-block;\n width: 9px;\n min-height: 18px;\n background-size: 9px 18px;\n background-repeat: no-repeat;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n right: 30px;\n }\n &.external-url::after {\n content: none;\n }\n \n ", " {\n width: calc(50% - 2em);\n padding: 32px;\n padding-right: ", ";\n flex-direction: row;\n max-width: ", ";\n }\n"], ["\n display: inline-flex;\n flex-direction: ", ";\n border-radius: 10px;\n box-shadow: 0 10px 30px 0 rgba(35, 35, 35, 0.1);\n background-color: ", ";\n background-image: ", ";\n background-repeat: no-repeat;\n padding: 24px;\n padding-right: ", ";\n margin-bottom: 32px;\n box-sizing: border-box;\n position: relative;\n text-decoration: none;\n width: 100%;\n transition: box-shadow 0.25s ease;\n :hover {\n box-shadow: 0 10px 30px 0 rgba(35, 35, 35, 0.2);\n }\n :before {\n content: ", ";\n display: inline-block;\n width: 9px;\n min-height: 18px;\n background-size: 9px 18px;\n background-repeat: no-repeat;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n right: 30px;\n }\n &.external-url::after {\n content: none;\n }\n \n ", " {\n width: calc(50% - 2em);\n padding: 32px;\n padding-right: ", ";\n flex-direction: row;\n max-width: ", ";\n }\n"])), function (_a) {
|
|
56
45
|
var withIcon = _a.withIcon;
|
|
57
46
|
return (withIcon ? 'column' : 'row');
|
|
58
47
|
}, function (_a) {
|
|
@@ -96,12 +85,7 @@ var WideTile = /** @class */ (function (_super) {
|
|
|
96
85
|
}
|
|
97
86
|
WideTile.prototype.render = function () {
|
|
98
87
|
var _a = this.props, to = _a.to, header = _a.header, children = _a.children, target = _a.target, disableArrow = _a.disableArrow, textAlign = _a.textAlign, headerAlign = _a.headerAlign, icon = _a.icon, bgColor = _a.bgColor, bgImage = _a.bgImage, color = _a.color, className = _a.className, style = _a.style, maxWidth = _a.maxWidth;
|
|
99
|
-
return (
|
|
100
|
-
icon && (react_1.default.createElement(WideTileIcon, null,
|
|
101
|
-
react_1.default.createElement("img", { src: icon, alt: "" }))),
|
|
102
|
-
react_1.default.createElement("div", null,
|
|
103
|
-
header && (react_1.default.createElement(WideTileHeader, { align: textAlign, color: color, "data-cy": "Wide-".concat(header) }, header)),
|
|
104
|
-
children && (react_1.default.createElement(WideTileText, { align: headerAlign, color: color }, children)))));
|
|
88
|
+
return ((0, jsx_runtime_1.jsxs)(WideTileWrapper, __assign({ to: to, target: target, disableArrow: disableArrow, withIcon: !!icon, bgColor: bgColor, bgImage: bgImage, color: color, className: className, style: style, maxWidth: maxWidth, "data-component-name": "ui/Tiles/WideTile" }, { children: [icon && ((0, jsx_runtime_1.jsx)(WideTileIcon, { children: (0, jsx_runtime_1.jsx)("img", { src: icon, alt: "" }) })), (0, jsx_runtime_1.jsxs)("div", { children: [header && ((0, jsx_runtime_1.jsx)(WideTileHeader, __assign({ align: textAlign, color: color, "data-cy": "Wide-".concat(header) }, { children: header }))), children && ((0, jsx_runtime_1.jsx)(WideTileText, __assign({ align: headerAlign, color: color }, { children: children })))] })] })));
|
|
105
89
|
};
|
|
106
90
|
return WideTile;
|
|
107
91
|
}(react_1.Component));
|
package/ui/UniversalLink.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
export declare const withPropsFilter: (filterList: string[]) => (WrappedComponent:
|
|
1
|
+
import type { LinkProps } from 'react-router-dom';
|
|
2
|
+
import type { FunctionComponent, MouseEvent, PropsWithChildren } from 'react';
|
|
3
|
+
export declare const withPropsFilter: (filterList: string[]) => (WrappedComponent: FunctionComponent) => (props: PropsWithChildren<object>) => JSX.Element;
|
|
4
4
|
export interface PortalLinkProps<TState> extends LinkProps<TState> {
|
|
5
5
|
activeClassName?: string;
|
|
6
6
|
activeStyle?: object;
|
|
7
|
-
onClick?: (event:
|
|
7
|
+
onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
8
8
|
partiallyActive?: boolean;
|
|
9
9
|
replace?: boolean;
|
|
10
10
|
state?: TState;
|
|
@@ -14,4 +14,4 @@ export interface UniversalLinkProps extends Partial<PortalLinkProps<object>> {
|
|
|
14
14
|
external?: boolean;
|
|
15
15
|
ref?: any;
|
|
16
16
|
}
|
|
17
|
-
export declare const UniversalLink: (props:
|
|
17
|
+
export declare const UniversalLink: (props: PropsWithChildren<object>) => JSX.Element;
|