@thecb/components 6.4.2 → 7.0.0-beta.2
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/README.md +43 -0
- package/dist/index.cjs.js +12072 -11822
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +308 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +4177 -3930
- package/dist/index.esm.js.map +1 -1
- package/package.json +6 -2
- package/src/components/atoms/button-with-action/index.d.ts +17 -0
- package/src/components/atoms/button-with-link/index.d.ts +14 -0
- package/src/components/atoms/card/Card.js +87 -0
- package/src/components/atoms/card/Card.theme.js +14 -0
- package/src/components/atoms/card/CardHeader.js +28 -0
- package/src/components/atoms/card/CardImage.styled.js +9 -0
- package/src/components/atoms/card/CardText.js +46 -0
- package/src/components/atoms/card/CardText.theme.js +12 -0
- package/src/components/atoms/card/index.d.ts +32 -0
- package/src/components/atoms/card/index.js +3 -0
- package/src/components/atoms/{welcome-card/Card.theme.js → card-registry/CardRegistry.theme.js} +0 -0
- package/src/components/atoms/{welcome-card/Card.js → card-registry/CardRegistryCard.js} +7 -3
- package/src/components/atoms/{welcome-card → card-registry}/index.js +4 -4
- package/src/components/atoms/display-card/DisplayCard.js +1 -1
- package/src/components/atoms/index.d.ts +11 -0
- package/src/components/atoms/index.js +3 -1
- package/src/components/atoms/layouts/Box.d.ts +32 -0
- package/src/components/atoms/layouts/Center.d.ts +11 -0
- package/src/components/atoms/layouts/Cluster.d.ts +19 -0
- package/src/components/atoms/layouts/Cover.d.ts +14 -0
- package/src/components/atoms/layouts/Stack.d.ts +27 -0
- package/src/components/atoms/layouts/Switcher.d.ts +17 -0
- package/src/components/atoms/layouts/index.d.ts +6 -0
- package/src/components/atoms/link/ExternalLink.d.ts +18 -0
- package/src/components/atoms/link/InternalLink.d.ts +19 -0
- package/src/components/atoms/link/index.d.ts +2 -0
- package/src/components/atoms/nav-footer/index.d.ts +17 -0
- package/src/components/atoms/nav-header/index.d.ts +16 -0
- package/src/components/atoms/nav-tabs/NavTab.js +47 -0
- package/src/components/atoms/nav-tabs/NavTab.theme.js +11 -0
- package/src/components/atoms/nav-tabs/NavTabs.js +24 -0
- package/src/components/atoms/nav-tabs/index.d.ts +10 -0
- package/src/components/atoms/nav-tabs/index.js +3 -0
- package/src/components/atoms/paragraph/index.d.ts +15 -0
- package/src/components/atoms/text/index.d.ts +16 -0
- package/src/components/atoms/title/index.d.ts +17 -0
- package/src/components/index.d.ts +3 -0
- package/src/components/molecules/footer-with-subfooter/FooterWithSubfooter.js +42 -0
- package/src/components/molecules/footer-with-subfooter/FooterWithSubfooter.theme.js +8 -0
- package/src/components/molecules/footer-with-subfooter/index.d.ts +14 -0
- package/src/components/molecules/footer-with-subfooter/index.js +3 -0
- package/src/components/molecules/index.d.ts +1 -0
- package/src/components/molecules/index.js +1 -0
- package/src/components/molecules/modal/Modal.js +5 -1
- package/src/components/templates/default-page-template/DefaultPageTemplate.js +7 -2
- package/src/components/templates/default-page-template/index.d.ts +16 -0
- package/src/components/templates/index.d.ts +1 -0
- package/src/index.d.ts +1 -0
- package/src/util/expand.d.ts +3 -0
- package/src/.DS_Store +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MATISSE_BLUE, CHARADE_GREY } from "../../../constants/colors";
|
|
2
|
+
|
|
3
|
+
const fontFamily = "Public Sans, sans-serif";
|
|
4
|
+
const activeColor = MATISSE_BLUE;
|
|
5
|
+
const linkColor = CHARADE_GREY;
|
|
6
|
+
|
|
7
|
+
export const fallbackValues = {
|
|
8
|
+
fontFamily,
|
|
9
|
+
activeColor,
|
|
10
|
+
linkColor
|
|
11
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { ThemeContext } from "styled-components";
|
|
3
|
+
|
|
4
|
+
import BoxWithShadow from "../box-with-shadow";
|
|
5
|
+
import Center from "../layouts/Center";
|
|
6
|
+
import Cluster from "../layouts/Cluster";
|
|
7
|
+
import NavTab from "./NavTab";
|
|
8
|
+
|
|
9
|
+
const NavTabs = ({ tabsConfig, tabGap }) => {
|
|
10
|
+
const { isMobile } = useContext(ThemeContext);
|
|
11
|
+
|
|
12
|
+
const tabs = tabsConfig.map(tabConfig => {
|
|
13
|
+
return <NavTab key={tabConfig.path} {...tabConfig} />;
|
|
14
|
+
});
|
|
15
|
+
return (
|
|
16
|
+
<BoxWithShadow variant="insetStandard" extraStyles="padding: 0">
|
|
17
|
+
<Center intrinsic>
|
|
18
|
+
{isMobile ? tabs : <Cluster childGap={tabGap}>{tabs}</Cluster>}
|
|
19
|
+
</Center>
|
|
20
|
+
</BoxWithShadow>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default NavTabs;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Expand from "../../../util/expand";
|
|
3
|
+
|
|
4
|
+
export interface NavTabsProps {
|
|
5
|
+
tabsConfig: Array<{ path: string; label: string }>;
|
|
6
|
+
tabGap?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const NavTabs: React.FC<Expand<NavTabsProps> &
|
|
10
|
+
React.HTMLAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Expand from "../../../util/expand";
|
|
3
|
+
|
|
4
|
+
export interface ParagraphProps {
|
|
5
|
+
color?: string;
|
|
6
|
+
themeValues?: string;
|
|
7
|
+
weight?: string;
|
|
8
|
+
margin?: string;
|
|
9
|
+
extraStyles?: string;
|
|
10
|
+
dataQa?: string;
|
|
11
|
+
as?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const Paragraph: React.FC<Expand<ParagraphProps> &
|
|
15
|
+
React.HTMLAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Expand from "../../../util/expand";
|
|
3
|
+
|
|
4
|
+
export interface TextProps {
|
|
5
|
+
weight?: string;
|
|
6
|
+
color?: string;
|
|
7
|
+
textWrap?: boolean;
|
|
8
|
+
extraStyles?: string;
|
|
9
|
+
hoverStyles?: string;
|
|
10
|
+
as?: string;
|
|
11
|
+
dataQa?: string;
|
|
12
|
+
variant?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const Text: React.FC<Expand<TextProps> &
|
|
16
|
+
React.HTMLAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Expand from "../../../util/expand";
|
|
3
|
+
|
|
4
|
+
export interface TitleProps {
|
|
5
|
+
variant?: string;
|
|
6
|
+
color?: string;
|
|
7
|
+
margin?: string;
|
|
8
|
+
extraStyles?: string;
|
|
9
|
+
weight?: string;
|
|
10
|
+
textAlign?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
as?: string;
|
|
13
|
+
dataQa?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const Title: React.FC<Expand<TitleProps> &
|
|
17
|
+
React.HTMLAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import { themeComponent } from "../../../util/themeUtils";
|
|
4
|
+
import { fallbackValues } from "./FooterWithSubfooter.theme";
|
|
5
|
+
import NavFooter from "../../atoms/nav-footer";
|
|
6
|
+
|
|
7
|
+
const FooterWithSubfooter = ({
|
|
8
|
+
footerLargeSide = "right",
|
|
9
|
+
footerLargeSideSize = "2",
|
|
10
|
+
leftFooterContent,
|
|
11
|
+
rightFooterContent,
|
|
12
|
+
leftSubfooterContent,
|
|
13
|
+
rightSubfooterContent,
|
|
14
|
+
themeValues
|
|
15
|
+
}) => {
|
|
16
|
+
return (
|
|
17
|
+
<>
|
|
18
|
+
<NavFooter
|
|
19
|
+
largeSide={footerLargeSide}
|
|
20
|
+
largeSideSize={footerLargeSideSize}
|
|
21
|
+
rightContent={rightFooterContent}
|
|
22
|
+
leftContent={leftFooterContent}
|
|
23
|
+
aria-label="footer"
|
|
24
|
+
backgroundColor={themeValues.footerBackgroundColor}
|
|
25
|
+
/>
|
|
26
|
+
<NavFooter
|
|
27
|
+
backgroundColor={themeValues.subfooterBackgroundColor}
|
|
28
|
+
footerMinHeight="45px"
|
|
29
|
+
footerPadding="0 16px"
|
|
30
|
+
aria-label="subfooter"
|
|
31
|
+
leftContent={leftSubfooterContent}
|
|
32
|
+
rightContent={rightSubfooterContent}
|
|
33
|
+
></NavFooter>
|
|
34
|
+
</>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default themeComponent(
|
|
39
|
+
FooterWithSubfooter,
|
|
40
|
+
"FooterWithSubfooter",
|
|
41
|
+
fallbackValues
|
|
42
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Expand from "../../../util/expand";
|
|
3
|
+
|
|
4
|
+
export interface FooterWithSubfooterProps {
|
|
5
|
+
footerLargeSide?: "left" | "right";
|
|
6
|
+
footerLargeSideSize?: string;
|
|
7
|
+
leftFooterContent?: JSX.Element;
|
|
8
|
+
rightFooterContent?: JSX.Element;
|
|
9
|
+
leftSubfooterContent?: JSX.Element;
|
|
10
|
+
rightSubfooterContent?: JSX.Element;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const FooterWithSubfooter: React.FC<Expand<FooterWithSubfooterProps> &
|
|
14
|
+
React.HTMLAttributes<HTMLElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./footer-with-subfooter";
|
|
@@ -5,6 +5,7 @@ export { default as EditNameForm } from "./edit-name-form";
|
|
|
5
5
|
export { default as EditableList } from "./editable-list";
|
|
6
6
|
export * from "./editable-table";
|
|
7
7
|
export { default as EmailForm } from "./email-form";
|
|
8
|
+
export { default as FooterWithSubfooter } from "./footer-with-subfooter";
|
|
8
9
|
export { default as ForgotPasswordForm } from "./forgot-password-form";
|
|
9
10
|
export { default as HighlightTabRow } from "./highlight-tab-row";
|
|
10
11
|
export { iconsMap as ObligationIcons } from "./obligation/icons";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { Fragment, useContext } from "react";
|
|
1
|
+
import React, { Fragment, useContext, useRef } from "react";
|
|
2
2
|
import { ThemeContext } from "styled-components";
|
|
3
3
|
import AriaModal from "react-aria-modal";
|
|
4
4
|
import { WHITE, ATHENS_GREY, SILVER_GREY } from "../../../constants/colors";
|
|
@@ -47,10 +47,13 @@ const Modal = ({
|
|
|
47
47
|
children
|
|
48
48
|
}) => {
|
|
49
49
|
const { isMobile } = useContext(ThemeContext);
|
|
50
|
+
const closeBtnRef = useRef(null);
|
|
50
51
|
return (
|
|
51
52
|
<Fragment>
|
|
52
53
|
{modalOpen && (
|
|
53
54
|
<AriaModal
|
|
55
|
+
initialFocus={closeBtnRef}
|
|
56
|
+
focusTrapOptions={{ delayInitialFocus: false, fallbackFocus: closeBtnRef }} // fallback to resolve unit test errors with Jest/tabbable https://github.com/focus-trap/focus-trap-react/issues/91
|
|
54
57
|
onExit={onExit}
|
|
55
58
|
getApplicationNode={getApplicationNode}
|
|
56
59
|
titleText={modalHeaderText}
|
|
@@ -169,6 +172,7 @@ const Modal = ({
|
|
|
169
172
|
) : (
|
|
170
173
|
<Box padding="0.5rem">
|
|
171
174
|
<ButtonWithAction
|
|
175
|
+
ref={closeBtnRef}
|
|
172
176
|
action={hideModal}
|
|
173
177
|
variant="primary"
|
|
174
178
|
text={closeButtonText}
|
|
@@ -14,7 +14,8 @@ const CenterSingle = ({
|
|
|
14
14
|
content,
|
|
15
15
|
themeValues,
|
|
16
16
|
maxWidth = "75rem",
|
|
17
|
-
gutters = "2rem"
|
|
17
|
+
gutters = "2rem",
|
|
18
|
+
fillPageVertical = false
|
|
18
19
|
}) => {
|
|
19
20
|
const themeContext = useContext(ThemeContext);
|
|
20
21
|
const { isMobile } = themeContext;
|
|
@@ -26,7 +27,11 @@ const CenterSingle = ({
|
|
|
26
27
|
background={COOL_GREY_05}
|
|
27
28
|
extraStyles="flex-grow: 1;"
|
|
28
29
|
>
|
|
29
|
-
<Cover
|
|
30
|
+
<Cover
|
|
31
|
+
childGap="0"
|
|
32
|
+
fillCenter
|
|
33
|
+
style={{ minHeight: fillPageVertical ? "100vh" : "initial" }}
|
|
34
|
+
>
|
|
30
35
|
{header ? header : <Box padding="0" />}
|
|
31
36
|
<Box
|
|
32
37
|
padding="0"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Expand from "../../../util/expand";
|
|
3
|
+
|
|
4
|
+
export interface DefaultPageTemplateProps {
|
|
5
|
+
content: JSX.Element;
|
|
6
|
+
header?: JSX.Element;
|
|
7
|
+
subHeader?: JSX.Element;
|
|
8
|
+
footer?: JSX.Element;
|
|
9
|
+
hideMobileSubHeader?: boolean;
|
|
10
|
+
maxWidth?: string;
|
|
11
|
+
gutters?: string;
|
|
12
|
+
fillPageVertical?: Boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const DefaultPageTemplate: React.FC<Expand<DefaultPageTemplateProps> &
|
|
16
|
+
React.HTMLAttributes<HTMLElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./default-page-template";
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./components";
|
package/src/.DS_Store
DELETED
|
Binary file
|