@thecb/components 3.1.1 → 3.1.10
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/.storybook/main.js +4 -0
- package/.storybook/page.js +62 -0
- package/.storybook/themes/apc.theme.js +1 -0
- package/.storybook/themes/index.js +2 -0
- package/.storybook/themes/sf.theme.js +1 -0
- package/.tool-versions +1 -0
- package/dist/index.cjs.js +539 -13398
- package/package.json +14 -6
- package/rollup.config.js +0 -2
- package/src/components/atoms/alert/Alert.stories.js +28 -0
- package/src/components/atoms/amount-callout/AmountCallout.stories.js +41 -0
- package/src/components/atoms/amount-callout/AmountCallout.theme.js +4 -4
- package/src/components/atoms/breadcrumb/Breadcrumb.js +7 -0
- package/src/components/atoms/breadcrumb/Breadcrumb.stories.js +38 -0
- package/src/components/atoms/breadcrumb/Breadcrumb.theme.js +3 -1
- package/src/components/atoms/button-with-action/ButtonWithAction.stories.js +31 -122
- package/src/components/atoms/button-with-action/ButtonWithAction.theme.js +20 -7
- package/src/components/atoms/button-with-link/ButtonWithLink.js +17 -3
- package/src/components/atoms/button-with-link/ButtonWithLink.stories.js +32 -0
- package/src/components/atoms/checkbox/Checkbox.stories.js +29 -0
- package/src/components/atoms/checkbox-list/CheckboxList.stories.js +50 -0
- package/src/components/atoms/country-dropdown/CountryDropdown.stories.js +42 -0
- package/src/components/atoms/display-box/DisplayBox.stories.js +25 -0
- package/src/components/atoms/display-card/DisplayCard.js +2 -0
- package/src/components/atoms/display-card/DisplayCard.stories.js +24 -0
- package/src/components/atoms/dropdown/Dropdown.js +3 -6
- package/src/components/atoms/dropdown/Dropdown.stories.js +70 -0
- package/src/components/atoms/form-layouts/FormLayouts.stories.js +72 -0
- package/src/components/atoms/form-select/FormSelect.stories.js +44 -0
- package/src/components/atoms/formatted-address/FormattedAddress.js +1 -3
- package/src/components/atoms/formatted-address/FormattedAddress.stories.js +32 -0
- package/src/components/atoms/hamburger-button/HamburgerButton.js +7 -1
- package/src/components/atoms/hamburger-button/HamburgerButton.stories.js +21 -0
- package/src/components/atoms/heading/Heading.stories.js +20 -0
- package/src/components/atoms/icons/icons.stories.js +50 -0
- package/src/components/atoms/labeled-amount/LabeledAmount.js +1 -1
- package/src/components/atoms/labeled-amount/LabeledAmount.stories.js +29 -0
- package/src/components/atoms/layouts/Cluster.js +2 -0
- package/src/components/atoms/layouts/Cluster.styled.js +1 -1
- package/src/components/atoms/layouts/examples/ResizingContainer.js +3 -1
- package/src/components/atoms/layouts/examples/ResizingContainer.styled.js +1 -1
- package/src/components/atoms/layouts/examples/box-example/BoxExample.stories.js +58 -0
- package/src/components/atoms/layouts/examples/center-example/CenterExample.stories.js +28 -0
- package/src/components/atoms/layouts/examples/cover-example/CoverExample.stories.js +53 -0
- package/src/components/atoms/layouts/examples/frame-example/FrameExample.stories.js +22 -0
- package/src/components/atoms/layouts/examples/imposter-example/ImposterExample.stories.js +35 -0
- package/src/components/atoms/layouts/examples/motion-example/MotionExample.stories.js +62 -0
- package/src/components/atoms/layouts/examples/reel-example/ReelExample.stories.js +57 -0
- package/src/components/atoms/line-item/LineItem.js +2 -2
- package/src/components/atoms/line-item/LineItem.stories.js +19 -0
- package/src/components/atoms/link/ExternalLink.js +1 -3
- package/src/components/atoms/link/ExternalLink.styled.js +2 -2
- package/src/components/atoms/link/InternalLink.styled.js +5 -4
- package/src/components/atoms/link/Link.stories.js +57 -0
- package/src/components/atoms/link/Link.theme.js +3 -2
- package/src/components/atoms/nav-footer/NavFooter.stories.js +31 -0
- package/src/components/atoms/nav-header/NavHeader.stories.js +29 -0
- package/src/components/atoms/paragraph/Paragraph.stories.js +34 -0
- package/src/components/atoms/paragraph/Paragraph.theme.js +6 -2
- package/src/components/atoms/password-requirements/PasswordRequirements.stories.js +75 -0
- package/src/components/atoms/placeholder/Placeholder.js +16 -16
- package/src/components/atoms/placeholder/Placeholder.stories.js +38 -0
- package/src/components/atoms/processing-fee/ProcessingFee.stories.js +28 -0
- package/src/components/atoms/radio-button/RadioButton.stories.js +69 -0
- package/src/components/atoms/solid-divider/SolidDivider.stories.js +11 -0
- package/src/components/atoms/spinner/Spinner.stories.js +17 -0
- package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.stories.js +52 -0
- package/src/components/atoms/text/Text.stories.js +34 -0
- package/src/components/atoms/text/Text.theme.js +6 -2
- package/src/components/atoms/toggle-switch/ToggleSwitch.js +1 -1
- package/src/components/atoms/toggle-switch/ToggleSwitch.stories.js +70 -0
- package/src/components/molecules/address-form/AddressForm.stories.js +21 -0
- package/src/components/molecules/change-password-form/ChangePasswordForm.stories.js +22 -0
- package/src/components/molecules/collapsible-section/CollapsibleSection.js +2 -1
- package/src/components/molecules/collapsible-section/CollapsibleSection.stories.js +68 -0
- package/src/components/molecules/edit-name-form/EdidNameForm.stories.js +24 -0
- package/src/components/molecules/email-form/EmailForm.stories.js +24 -0
- package/src/components/molecules/forgot-password-form/ForgotPasswordForm.stories.js +24 -0
- package/src/components/molecules/highlight-tab-row/HighlightTabRow.js +8 -3
- package/src/components/molecules/highlight-tab-row/HighlightTabRow.stories.js +30 -0
- package/src/components/molecules/highlight-tab-row/index.js +1 -6
- package/src/components/molecules/login-form/LoginForm.stories.js +24 -0
- package/src/components/molecules/modal/Modal.stories.js +44 -0
- package/src/components/molecules/module/Module.js +6 -2
- package/src/components/molecules/module/Module.stories.js +31 -0
- package/src/components/molecules/module/index.js +1 -6
- package/src/components/molecules/obligation/Obligation.js +1 -1
- package/src/components/molecules/obligation/modules/AmountModule.js +6 -2
- package/src/components/molecules/payment-button-bar/PaymentButtonBar.stories.js +20 -0
- package/src/components/molecules/payment-details/PaymentDetails.stories.js +71 -0
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +0 -16
- package/src/components/molecules/phone-form/PhoneForm.stories.js +24 -0
- package/src/components/molecules/radio-section/RadioSection.stories.js +31 -0
- package/src/components/molecules/registration-form/RegistrationForm.stories.js +24 -0
- package/src/components/molecules/reset-confirmation-form/ResetConfirmationForm.stories.js +11 -0
- package/src/components/molecules/reset-password-form/ResetPasswordForm.stories.js +24 -0
- package/src/components/molecules/reset-password-success/ResetPasswordSuccess.stories.js +11 -0
- package/src/components/molecules/tab-sidebar/TabSidebar.js +2 -1
- package/src/components/molecules/tab-sidebar/TabSidebar.stories.js +59 -0
- package/src/components/molecules/terms-and-conditions/TermsAndConditions.stories.js +24 -0
- package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.stories.js +31 -0
- package/src/components/molecules/workflow-tile/WorkflowTile.stories.js +25 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { text, boolean } from "@storybook/addon-knobs";
|
|
3
|
+
|
|
4
|
+
import page from "../../../../../../.storybook/page";
|
|
5
|
+
import Cover from "../../Cover";
|
|
6
|
+
import LayoutContentBlock from "../LayoutContentBlock";
|
|
7
|
+
|
|
8
|
+
const groupId = "props";
|
|
9
|
+
|
|
10
|
+
export default page({
|
|
11
|
+
title: "Layouts|Basic Layouts/Cover",
|
|
12
|
+
Component: Cover
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const cover = () => (
|
|
16
|
+
<Cover
|
|
17
|
+
minHeight={text("minHeight", "100vh", groupId)}
|
|
18
|
+
childGap={text("childGap", "", groupId)}
|
|
19
|
+
padding={text("padding", "", groupId)}
|
|
20
|
+
fillCenter={boolean("fillCenter", false, groupId)}
|
|
21
|
+
singleChild={boolean("singleChild", false, groupId)}
|
|
22
|
+
centerOverride={boolean("centerOverride", false, groupId)}
|
|
23
|
+
>
|
|
24
|
+
<LayoutContentBlock height="3.5rem" width="100%" layoutName="Header" />
|
|
25
|
+
Text Child
|
|
26
|
+
<LayoutContentBlock height="3.5rem" width="100%" layoutName="Footer" />
|
|
27
|
+
</Cover>
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
cover.story = {
|
|
31
|
+
name: "Cover with Multiple Children"
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const coverSingleChild = () => (
|
|
35
|
+
<Cover
|
|
36
|
+
minHeight={text("minHeight", "100vh", groupId)}
|
|
37
|
+
childGap={text("childGap", "", groupId)}
|
|
38
|
+
padding={text("padding", "", groupId)}
|
|
39
|
+
fillCenter={boolean("fillCenter", false, groupId)}
|
|
40
|
+
singleChild={boolean("singleChild", true, groupId)}
|
|
41
|
+
centerOverride={boolean("centerOverride", false, groupId)}
|
|
42
|
+
>
|
|
43
|
+
<LayoutContentBlock
|
|
44
|
+
height="3.5rem"
|
|
45
|
+
width="100%"
|
|
46
|
+
layoutName="Child Component"
|
|
47
|
+
/>
|
|
48
|
+
</Cover>
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
coverSingleChild.story = {
|
|
52
|
+
name: "Cover with Single Child"
|
|
53
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { text } from "@storybook/addon-knobs";
|
|
3
|
+
|
|
4
|
+
import page from "../../../../../../.storybook/page";
|
|
5
|
+
import Frame from "../../Frame";
|
|
6
|
+
import LayoutContentBlock from "../LayoutContentBlock";
|
|
7
|
+
|
|
8
|
+
const groupId = "props";
|
|
9
|
+
|
|
10
|
+
export default page({
|
|
11
|
+
title: "Layouts|Basic Layouts/Frame",
|
|
12
|
+
Component: Frame
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const frame = () => (
|
|
16
|
+
<Frame
|
|
17
|
+
numerator={text("numerator", "1", groupId)}
|
|
18
|
+
denominator={text("denominator", "1", groupId)}
|
|
19
|
+
>
|
|
20
|
+
<LayoutContentBlock height="100%" width="100%" layoutName="Image" />
|
|
21
|
+
</Frame>
|
|
22
|
+
);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { text, boolean } from "@storybook/addon-knobs";
|
|
3
|
+
|
|
4
|
+
import page from "../../../../../../.storybook/page";
|
|
5
|
+
import Box from "../../Box";
|
|
6
|
+
import Imposter from "../../Imposter";
|
|
7
|
+
import LayoutContentBlock from "../LayoutContentBlock";
|
|
8
|
+
|
|
9
|
+
const groupId = "props";
|
|
10
|
+
|
|
11
|
+
export default page({
|
|
12
|
+
title: "Layouts|Basic Layouts/Imposter",
|
|
13
|
+
Component: Imposter
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const imposter = () => (
|
|
17
|
+
<Box minHeight="50vh" background="#F6F6F9">
|
|
18
|
+
<Imposter
|
|
19
|
+
fixed={boolean("fixed", false, groupId)}
|
|
20
|
+
verticalMargin={text("verticalMargin", "0px", groupId)}
|
|
21
|
+
horizontalMargin={text("horizontalMargin", "0px", groupId)}
|
|
22
|
+
breakout={boolean("breakout", true, groupId)}
|
|
23
|
+
top={text("top", "50%", groupId)}
|
|
24
|
+
left={text("left", "50%", groupId)}
|
|
25
|
+
centered={boolean("centered", false, groupId)}
|
|
26
|
+
visible={boolean("visible", true, groupId)}
|
|
27
|
+
>
|
|
28
|
+
<LayoutContentBlock
|
|
29
|
+
height="100%"
|
|
30
|
+
width="100%"
|
|
31
|
+
layoutName="Component Child"
|
|
32
|
+
/>
|
|
33
|
+
</Imposter>
|
|
34
|
+
</Box>
|
|
35
|
+
);
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { text, select, boolean } from "@storybook/addon-knobs";
|
|
3
|
+
|
|
4
|
+
import page from "../../../../../../.storybook/page";
|
|
5
|
+
import Motion from "../../Motion";
|
|
6
|
+
import LayoutContentBlock from "../LayoutContentBlock";
|
|
7
|
+
|
|
8
|
+
const position = {
|
|
9
|
+
relative: "relative",
|
|
10
|
+
absolute: "absolute"
|
|
11
|
+
};
|
|
12
|
+
const animate = {
|
|
13
|
+
open: "open",
|
|
14
|
+
closed: "closed"
|
|
15
|
+
};
|
|
16
|
+
const groupId = "props";
|
|
17
|
+
|
|
18
|
+
const variants = {
|
|
19
|
+
open: {
|
|
20
|
+
height: "50vh",
|
|
21
|
+
opacity: 1,
|
|
22
|
+
transition: {
|
|
23
|
+
duration: 0.3,
|
|
24
|
+
ease: [0.04, 0.62, 0.23, 0.98],
|
|
25
|
+
staggerChildren: 0
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
closed: {
|
|
29
|
+
height: 0,
|
|
30
|
+
opacity: 0,
|
|
31
|
+
transition: {
|
|
32
|
+
duration: 0.3,
|
|
33
|
+
ease: [0.04, 0.62, 0.23, 0.98],
|
|
34
|
+
staggerChildren: 0,
|
|
35
|
+
staggerDirection: -1
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default page({
|
|
41
|
+
title: "Layouts|Basic Layouts/Motion",
|
|
42
|
+
Component: Motion
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export const motion = () => (
|
|
46
|
+
<Motion
|
|
47
|
+
position={select("position", position, "relative", groupId)}
|
|
48
|
+
padding={text("padding", "0", groupId)}
|
|
49
|
+
variants={variants}
|
|
50
|
+
layoutTransition={boolean("layoutTransition", true, groupId)}
|
|
51
|
+
positionTransition={boolean("positionTransition", false, groupId)}
|
|
52
|
+
initial="closed"
|
|
53
|
+
animate={select("animate", animate, "open", groupId)}
|
|
54
|
+
exit="closed"
|
|
55
|
+
>
|
|
56
|
+
<LayoutContentBlock
|
|
57
|
+
height="100%"
|
|
58
|
+
width="100%"
|
|
59
|
+
layoutName="Component Child"
|
|
60
|
+
/>
|
|
61
|
+
</Motion>
|
|
62
|
+
);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { text, boolean, select } from "@storybook/addon-knobs";
|
|
3
|
+
|
|
4
|
+
import page from "../../../../../../.storybook/page";
|
|
5
|
+
import Reel from "../../Reel";
|
|
6
|
+
import LayoutContentBlock from "../LayoutContentBlock";
|
|
7
|
+
|
|
8
|
+
const justifyContent = {
|
|
9
|
+
flexStart: "flex-start",
|
|
10
|
+
flexEnd: "flex-end",
|
|
11
|
+
center: "center",
|
|
12
|
+
spaceEvenly: "space-evenly"
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const groupId = "props";
|
|
16
|
+
|
|
17
|
+
export default page({
|
|
18
|
+
title: "Layouts|Basic Layouts/Reel",
|
|
19
|
+
Component: Reel
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const reel = () => (
|
|
23
|
+
<Reel
|
|
24
|
+
childGap={text("childGap", "1rem", groupId)}
|
|
25
|
+
height={text("height", "auto", groupId)}
|
|
26
|
+
childWidth={text("childWidth", "auto", groupId)}
|
|
27
|
+
padding={text("padding", "1rem", groupId)}
|
|
28
|
+
justifyContent={select(
|
|
29
|
+
"justify-content",
|
|
30
|
+
justifyContent,
|
|
31
|
+
"flexStart",
|
|
32
|
+
groupId
|
|
33
|
+
)}
|
|
34
|
+
disableScroll={boolean("disableScroll", false, groupId)}
|
|
35
|
+
>
|
|
36
|
+
<LayoutContentBlock
|
|
37
|
+
height="3.5rem"
|
|
38
|
+
width="8rem"
|
|
39
|
+
layoutName="Component Child"
|
|
40
|
+
/>
|
|
41
|
+
<LayoutContentBlock
|
|
42
|
+
height="3.5rem"
|
|
43
|
+
width="8rem"
|
|
44
|
+
layoutName="Component Child 2"
|
|
45
|
+
/>
|
|
46
|
+
<LayoutContentBlock
|
|
47
|
+
height="3.5rem"
|
|
48
|
+
width="8rem"
|
|
49
|
+
layoutName="Component Child 3 "
|
|
50
|
+
/>
|
|
51
|
+
<LayoutContentBlock
|
|
52
|
+
height="3.5rem"
|
|
53
|
+
width="8rem"
|
|
54
|
+
layoutName="Component Child 4"
|
|
55
|
+
/>
|
|
56
|
+
</Reel>
|
|
57
|
+
);
|
|
@@ -5,7 +5,7 @@ import { themeComponent } from "../../../util/themeUtils";
|
|
|
5
5
|
import { fallbackValues } from "./LineItem.theme";
|
|
6
6
|
|
|
7
7
|
const LineItem = ({ description, subDescription, amount, themeValues }) => (
|
|
8
|
-
<Cluster justify="space-between" align="start">
|
|
8
|
+
<Cluster nowrap justify="space-between" align="start">
|
|
9
9
|
<Stack childGap="0px">
|
|
10
10
|
<Paragraph
|
|
11
11
|
variant={themeValues.paragraphVariant}
|
|
@@ -20,7 +20,7 @@ const LineItem = ({ description, subDescription, amount, themeValues }) => (
|
|
|
20
20
|
<Paragraph
|
|
21
21
|
variant={themeValues.paragraphVariant}
|
|
22
22
|
weight="600"
|
|
23
|
-
extraStyles="margin: 0;"
|
|
23
|
+
extraStyles="margin: 0; text-align: end; min-width: fit-content; padding-left: 32px;"
|
|
24
24
|
>
|
|
25
25
|
{amount}
|
|
26
26
|
</Paragraph>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { text } from "@storybook/addon-knobs";
|
|
3
|
+
|
|
4
|
+
import LineItem from "./LineItem";
|
|
5
|
+
import page from "../../../../.storybook/page";
|
|
6
|
+
|
|
7
|
+
const story = page({
|
|
8
|
+
title: "Components|Atoms/LineItem",
|
|
9
|
+
Component: LineItem
|
|
10
|
+
});
|
|
11
|
+
export default story;
|
|
12
|
+
|
|
13
|
+
export const lineItem = () => (
|
|
14
|
+
<LineItem
|
|
15
|
+
description={text("description", "Foo", "props")}
|
|
16
|
+
subDescription={text("subDescription", "Bar", "props")}
|
|
17
|
+
amount={text("amount", "$4.00", "props")}
|
|
18
|
+
/>
|
|
19
|
+
);
|
|
@@ -4,13 +4,11 @@ import { fallbackValues } from "./Link.theme";
|
|
|
4
4
|
import { createThemeValues } from "../../../util/themeUtils";
|
|
5
5
|
import { StyledExternalLink } from "./ExternalLink.styled";
|
|
6
6
|
import { FONT_WEIGHT_REGULAR } from "../../../constants/style_constants";
|
|
7
|
-
import { CONGRESS_BLUE } from "../../../constants/colors";
|
|
8
7
|
import { safeChildren } from "../../../util/general";
|
|
9
8
|
|
|
10
9
|
const ExternalLink = ({
|
|
11
10
|
href = "",
|
|
12
11
|
newTab = false,
|
|
13
|
-
color = CONGRESS_BLUE,
|
|
14
12
|
size = "1rem",
|
|
15
13
|
lineHeight = "1.5rem",
|
|
16
14
|
weight = FONT_WEIGHT_REGULAR,
|
|
@@ -31,7 +29,7 @@ const ExternalLink = ({
|
|
|
31
29
|
<StyledExternalLink
|
|
32
30
|
href={href}
|
|
33
31
|
target={newTab ? "_blank" : ""}
|
|
34
|
-
color={
|
|
32
|
+
color={themeValues.externalLinkColor}
|
|
35
33
|
size={size}
|
|
36
34
|
lineheight={lineHeight}
|
|
37
35
|
weight={weight}
|
|
@@ -8,7 +8,7 @@ import styled from "styled-components";
|
|
|
8
8
|
|
|
9
9
|
/* eslint-disable no-unused-vars */
|
|
10
10
|
export const StyledExternalLink = styled(
|
|
11
|
-
({ hoverColor, activeColor,
|
|
11
|
+
({ hoverColor, activeColor, extrastyles, ...props }) => <a {...props} />
|
|
12
12
|
)`
|
|
13
13
|
display: flex;
|
|
14
14
|
font-size: ${({ size }) => size};
|
|
@@ -19,7 +19,7 @@ export const StyledExternalLink = styled(
|
|
|
19
19
|
|
|
20
20
|
&:hover,
|
|
21
21
|
&:focus {
|
|
22
|
-
color: ${({
|
|
22
|
+
color: ${({ hoverColor }) => hoverColor};
|
|
23
23
|
text-decoration: underline;
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -9,21 +9,22 @@ import { Link } from "react-router-dom";
|
|
|
9
9
|
|
|
10
10
|
/* eslint-disable no-unused-vars */
|
|
11
11
|
export const StyledInternalLink = styled(
|
|
12
|
-
({ hoverColor, activeColor, active, ...props }) =>
|
|
12
|
+
({ hoverColor, activeColor, active, color, extrastyles, ...props }) => (
|
|
13
|
+
<Link {...props} />
|
|
14
|
+
)
|
|
13
15
|
)`
|
|
14
16
|
display: flex;
|
|
15
17
|
color: ${({ color, active, activeColor }) =>
|
|
16
|
-
active === true ? activeColor : color};
|
|
18
|
+
active === "true" ? activeColor : color};
|
|
17
19
|
font-weight: ${({ fontWeight }) => fontWeight};
|
|
18
20
|
line-height: ${({ lineheight }) => lineheight};
|
|
19
21
|
font-size: ${({ fontSize }) => fontSize};
|
|
20
22
|
font-family: ${({ fontFamily }) => fontFamily};
|
|
21
23
|
margin: ${({ margin }) => margin};
|
|
22
|
-
text-decoration: ${({ active }) => (active === true ? "underline" : "none")};
|
|
23
24
|
|
|
24
25
|
&:hover,
|
|
25
26
|
&:focus {
|
|
26
|
-
color: ${({
|
|
27
|
+
color: ${({ hoverColor }) => hoverColor};
|
|
27
28
|
text-decoration: underline;
|
|
28
29
|
}
|
|
29
30
|
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { boolean, select, text, number } from "@storybook/addon-knobs";
|
|
3
|
+
import page from "../../../../.storybook/page";
|
|
4
|
+
import InternalLink from "./InternalLink";
|
|
5
|
+
import ExternalLink from "./ExternalLink";
|
|
6
|
+
import {
|
|
7
|
+
FONT_WEIGHT_BOLD,
|
|
8
|
+
FONT_WEIGHT_SEMIBOLD,
|
|
9
|
+
FONT_WEIGHT_REGULAR
|
|
10
|
+
} from "../../../constants/style_constants";
|
|
11
|
+
import * as colors from "../../../constants/colors";
|
|
12
|
+
|
|
13
|
+
const fontWeights = {
|
|
14
|
+
FONT_WEIGHT_BOLD,
|
|
15
|
+
FONT_WEIGHT_SEMIBOLD,
|
|
16
|
+
FONT_WEIGHT_REGULAR
|
|
17
|
+
};
|
|
18
|
+
const variantsLabel = "variant";
|
|
19
|
+
const variants = {
|
|
20
|
+
primary: "primary",
|
|
21
|
+
secondary: "secondary"
|
|
22
|
+
};
|
|
23
|
+
const defaultValue = "primary";
|
|
24
|
+
const groupId = "props";
|
|
25
|
+
|
|
26
|
+
export const internalLink = () => (
|
|
27
|
+
<InternalLink
|
|
28
|
+
variant={select(variantsLabel, variants, defaultValue, groupId)}
|
|
29
|
+
to={text("to", "https://google.com", "props")}
|
|
30
|
+
extraStyles={text("extraStyles", "text-align: center;", "props")}
|
|
31
|
+
margin={number("margin", 0, { min: 0, max: 99 }, "props")}
|
|
32
|
+
fontWeight={select("fontWeight", fontWeights, 400, "props")}
|
|
33
|
+
color={select("color", colors, "black", "props")}
|
|
34
|
+
>
|
|
35
|
+
Internal Link
|
|
36
|
+
</InternalLink>
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
export const externalLink = () => (
|
|
40
|
+
<ExternalLink
|
|
41
|
+
variant={select(variantsLabel, variants, defaultValue, groupId)}
|
|
42
|
+
href={text("href", "https://google.com", "props")}
|
|
43
|
+
newTab={boolean("newTab", true, "props")}
|
|
44
|
+
extraStyles={text("extraStyles", "text-align: center;", "props")}
|
|
45
|
+
margin={number("margin", 0, { min: 0, max: 99 }, "props")}
|
|
46
|
+
weight={select("weight", fontWeights, 400, "props")}
|
|
47
|
+
color={select("color", colors, "black", "props")}
|
|
48
|
+
>
|
|
49
|
+
External Link
|
|
50
|
+
</ExternalLink>
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
const story = page({
|
|
54
|
+
title: "Components|Atoms/Link",
|
|
55
|
+
Component: InternalLink
|
|
56
|
+
});
|
|
57
|
+
export default story;
|
|
@@ -4,11 +4,12 @@ const fontFamily = {
|
|
|
4
4
|
};
|
|
5
5
|
|
|
6
6
|
const hoverColor = "#116285";
|
|
7
|
-
|
|
8
7
|
const activeColor = "#0E506D";
|
|
8
|
+
const externalLinkColor = "#15749D";
|
|
9
9
|
|
|
10
10
|
export const fallbackValues = {
|
|
11
11
|
fontFamily,
|
|
12
12
|
hoverColor,
|
|
13
|
-
activeColor
|
|
13
|
+
activeColor,
|
|
14
|
+
externalLinkColor
|
|
14
15
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { text, select, boolean } from "@storybook/addon-knobs";
|
|
3
|
+
|
|
4
|
+
import NavFooter from "./NavFooter";
|
|
5
|
+
import page from "../../../../.storybook/page";
|
|
6
|
+
import * as colors from "../../../constants/colors";
|
|
7
|
+
|
|
8
|
+
const story = page({
|
|
9
|
+
title: "Components|Atoms/NavFooter",
|
|
10
|
+
Component: NavFooter
|
|
11
|
+
});
|
|
12
|
+
export default story;
|
|
13
|
+
|
|
14
|
+
const Left = () => (
|
|
15
|
+
<div style={{ border: "2px solid black", width: "50px" }}>Left Content</div>
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
const Right = () => (
|
|
19
|
+
<div style={{ border: "2px solid black", width: "50px" }}>Right Content</div>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export const navFooter = () => (
|
|
23
|
+
<NavFooter
|
|
24
|
+
leftContent={<Left />}
|
|
25
|
+
rightContent={<Right />}
|
|
26
|
+
headerHeight={text("headerHeight", "105px", "props")}
|
|
27
|
+
backgroundColor={select("activeColor", colors, "white", "props")}
|
|
28
|
+
footerPadding={text("footerPadding", "1.5rem 1rem", "props")}
|
|
29
|
+
isMobile={boolean("isMobile", false, "props")}
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { text, number, select } from "@storybook/addon-knobs";
|
|
3
|
+
|
|
4
|
+
import NavHeader from "./NavHeader";
|
|
5
|
+
import page from "../../../../.storybook/page";
|
|
6
|
+
import * as colors from "../../../constants/colors";
|
|
7
|
+
|
|
8
|
+
const story = page({
|
|
9
|
+
title: "Components|Atoms/NavHeader",
|
|
10
|
+
Component: NavHeader
|
|
11
|
+
});
|
|
12
|
+
export default story;
|
|
13
|
+
|
|
14
|
+
const Left = () => (
|
|
15
|
+
<div style={{ border: "2px solid black", width: "50px" }}>Left Content</div>
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
const Right = () => (
|
|
19
|
+
<div style={{ border: "2px solid black", width: "50px" }}>Right Content</div>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export const navHeader = () => (
|
|
23
|
+
<NavHeader
|
|
24
|
+
leftContent={<Left />}
|
|
25
|
+
rightContent={<Right />}
|
|
26
|
+
headerHeight={text("headerHeight", "105px", "props")}
|
|
27
|
+
backgroundColor={select("activeColor", colors, "white", "props")}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { text, number, select } from "@storybook/addon-knobs";
|
|
3
|
+
|
|
4
|
+
import Paragraph from "./Paragraph";
|
|
5
|
+
import page from "../../../../.storybook/page";
|
|
6
|
+
import {
|
|
7
|
+
FONT_WEIGHT_BOLD,
|
|
8
|
+
FONT_WEIGHT_SEMIBOLD,
|
|
9
|
+
FONT_WEIGHT_REGULAR
|
|
10
|
+
} from "../../../constants/style_constants";
|
|
11
|
+
import * as colors from "../../../constants/colors";
|
|
12
|
+
|
|
13
|
+
const fontWeights = {
|
|
14
|
+
FONT_WEIGHT_BOLD,
|
|
15
|
+
FONT_WEIGHT_SEMIBOLD,
|
|
16
|
+
FONT_WEIGHT_REGULAR
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const story = page({
|
|
20
|
+
title: "Components|Atoms/Paragraph",
|
|
21
|
+
Component: Paragraph
|
|
22
|
+
});
|
|
23
|
+
export default story;
|
|
24
|
+
|
|
25
|
+
export const paragraph = () => (
|
|
26
|
+
<Paragraph
|
|
27
|
+
extraStyles={text("extraStyles", "text-align: center;", "props")}
|
|
28
|
+
margin={number("margin", 0, { min: 0, max: 99 }, "props")}
|
|
29
|
+
weight={select("weight", fontWeights, 400, "props")}
|
|
30
|
+
color={select("activeColor", colors, "black", "props")}
|
|
31
|
+
>
|
|
32
|
+
{text("children", "Lorem Ipsum", "props")}
|
|
33
|
+
</Paragraph>
|
|
34
|
+
);
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { boolean } from "@storybook/addon-knobs";
|
|
3
|
+
import PasswordRequirements from "./PasswordRequirements";
|
|
4
|
+
import { FormInput } from "../form-layouts";
|
|
5
|
+
import { Box } from "../layouts";
|
|
6
|
+
import page from "../../../../.storybook/page";
|
|
7
|
+
import { connect } from "react-redux";
|
|
8
|
+
import {
|
|
9
|
+
createFormState,
|
|
10
|
+
required,
|
|
11
|
+
hasLength,
|
|
12
|
+
hasNumber,
|
|
13
|
+
hasLowercaseLetter,
|
|
14
|
+
hasUppercaseLetter,
|
|
15
|
+
hasSpecialCharacter
|
|
16
|
+
} from "redux-freeform";
|
|
17
|
+
|
|
18
|
+
const formConfig = {
|
|
19
|
+
password: {
|
|
20
|
+
validators: [
|
|
21
|
+
required(),
|
|
22
|
+
hasLength(8, 100),
|
|
23
|
+
hasNumber(),
|
|
24
|
+
hasLowercaseLetter(),
|
|
25
|
+
hasUppercaseLetter(),
|
|
26
|
+
hasSpecialCharacter()
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const passwordForm = createFormState(formConfig);
|
|
32
|
+
|
|
33
|
+
const passwordRequirementsWrapper = ({ fields, actions, showErrors }) => {
|
|
34
|
+
const passwordErrorMessages = {
|
|
35
|
+
[required.error]: "Password is required",
|
|
36
|
+
[hasLength.error]: "Password must have at least 8 characters",
|
|
37
|
+
[hasNumber.error]: "Password must contain at least one number",
|
|
38
|
+
[hasLowercaseLetter.error]:
|
|
39
|
+
"Password must contain at least one lowercase letter",
|
|
40
|
+
[hasUppercaseLetter.error]:
|
|
41
|
+
"Password must contain at least one uppercase letter",
|
|
42
|
+
[hasSpecialCharacter.error]:
|
|
43
|
+
"Password must contain at least one special character (!@#$%^&*.?)"
|
|
44
|
+
};
|
|
45
|
+
return (
|
|
46
|
+
<Box>
|
|
47
|
+
<FormInput
|
|
48
|
+
labelTextWhenNoError="Type in password"
|
|
49
|
+
errorMessages={passwordErrorMessages}
|
|
50
|
+
field={fields.password}
|
|
51
|
+
fieldActions={actions.fields.password}
|
|
52
|
+
showErrors={showErrors}
|
|
53
|
+
/>
|
|
54
|
+
<PasswordRequirements password={fields.password} />
|
|
55
|
+
</Box>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const story = page({
|
|
60
|
+
title: "Components|Atoms/PasswordRequirements",
|
|
61
|
+
Component: PasswordRequirements,
|
|
62
|
+
reducer: passwordForm.reducer,
|
|
63
|
+
mapStateToProps: passwordForm.mapStateToProps,
|
|
64
|
+
mapDispatchToProps: passwordForm.mapDispatchToProps
|
|
65
|
+
});
|
|
66
|
+
export default story;
|
|
67
|
+
|
|
68
|
+
const ConnectedForm = connect(
|
|
69
|
+
passwordForm.mapStateToProps,
|
|
70
|
+
passwordForm.mapDispatchToProps
|
|
71
|
+
)(passwordRequirementsWrapper);
|
|
72
|
+
|
|
73
|
+
export const passwordRequirements = () => (
|
|
74
|
+
<ConnectedForm showErrors={boolean("showErrors", false, "props")} />
|
|
75
|
+
);
|
|
@@ -51,13 +51,19 @@ const Placeholder = ({
|
|
|
51
51
|
const { isMobile } = useContext(ThemeContext);
|
|
52
52
|
|
|
53
53
|
return (
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
<PlaceholderContentWrapper
|
|
55
|
+
isLink={isLink}
|
|
56
|
+
action={action}
|
|
57
|
+
destination={destination}
|
|
58
|
+
dataQa={dataQa}
|
|
59
|
+
>
|
|
60
|
+
<Box
|
|
61
|
+
padding="0"
|
|
62
|
+
borderRadius="4px"
|
|
63
|
+
border="none"
|
|
64
|
+
minHeight={themeValues.height}
|
|
65
|
+
hiddenStyles={!visible}
|
|
66
|
+
extraStyles={`
|
|
61
67
|
background: linear-gradient(
|
|
62
68
|
to right,
|
|
63
69
|
${STORM_GREY} 40%,
|
|
@@ -72,13 +78,7 @@ const Placeholder = ({
|
|
|
72
78
|
display: flex;
|
|
73
79
|
justify-content: center;
|
|
74
80
|
align-items:center;`}
|
|
75
|
-
|
|
76
|
-
>
|
|
77
|
-
<PlaceholderContentWrapper
|
|
78
|
-
isLink={isLink}
|
|
79
|
-
action={action}
|
|
80
|
-
destination={destination}
|
|
81
|
-
dataQa={dataQa}
|
|
81
|
+
hoverStyles={`background-color: ${GRECIAN_GREY};`}
|
|
82
82
|
>
|
|
83
83
|
<Center maxWidth="300px">
|
|
84
84
|
<Box padding="0px 0px 0px 0px">
|
|
@@ -111,8 +111,8 @@ const Placeholder = ({
|
|
|
111
111
|
</Cluster>
|
|
112
112
|
</Box>
|
|
113
113
|
</Center>
|
|
114
|
-
</
|
|
115
|
-
</
|
|
114
|
+
</Box>
|
|
115
|
+
</PlaceholderContentWrapper>
|
|
116
116
|
);
|
|
117
117
|
};
|
|
118
118
|
export default themeComponent(
|