@thecb/components 3.1.3 → 3.1.11
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/page.js +5 -4
- package/README.md +9 -8
- package/dist/index.cjs.js +118 -110
- package/package.json +5 -5
- 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.stories.js +38 -0
- package/src/components/atoms/button-with-link/ButtonWithLink.js +2 -1
- 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/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/InternalLink.styled.js +0 -2
- 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/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/molecules/collapsible-section/CollapsibleSection.js +2 -1
- package/src/components/molecules/collapsible-section/CollapsibleSection.stories.js +68 -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/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/radio-section/RadioSection.stories.js +31 -0
- 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
- package/.tool-versions +0 -1
|
@@ -17,6 +17,7 @@ const Cluster = ({
|
|
|
17
17
|
childGap,
|
|
18
18
|
minHeight,
|
|
19
19
|
minWidth,
|
|
20
|
+
nowrap,
|
|
20
21
|
overflow = false,
|
|
21
22
|
children,
|
|
22
23
|
...rest
|
|
@@ -28,6 +29,7 @@ const Cluster = ({
|
|
|
28
29
|
childGap={childGap}
|
|
29
30
|
minHeight={minHeight}
|
|
30
31
|
minWidth={minWidth}
|
|
32
|
+
nowrap={nowrap}
|
|
31
33
|
>
|
|
32
34
|
{safeChildren(children, <Fragment />)}
|
|
33
35
|
</ClusterInnerWrapper>
|
|
@@ -8,7 +8,7 @@ export const ClusterWrapper = styled.div`
|
|
|
8
8
|
export const ClusterInnerWrapper = styled.div`
|
|
9
9
|
box-sizing: border-box;
|
|
10
10
|
display: flex;
|
|
11
|
-
flex-wrap: wrap;
|
|
11
|
+
flex-wrap: ${({ nowrap }) => (nowrap ? "nowrap" : "wrap")};
|
|
12
12
|
justify-content: ${({ justify }) => justify};
|
|
13
13
|
align-items: ${({ align }) => align};
|
|
14
14
|
margin: calc(${({ childGap }) => childGap} / 2 * -1);
|
|
@@ -10,7 +10,8 @@ const ResizeContainer = ({
|
|
|
10
10
|
animate = "pause",
|
|
11
11
|
containerMax = "500px",
|
|
12
12
|
containerMin = "100%",
|
|
13
|
-
padding = "0.5rem"
|
|
13
|
+
padding = "0.5rem",
|
|
14
|
+
height = "auto"
|
|
14
15
|
}) => {
|
|
15
16
|
const ref = useRef();
|
|
16
17
|
const [width, setWidth] = useState(0);
|
|
@@ -39,6 +40,7 @@ const ResizeContainer = ({
|
|
|
39
40
|
containerMax={containerMax}
|
|
40
41
|
containerMin={containerMin}
|
|
41
42
|
padding={padding}
|
|
43
|
+
height={height}
|
|
42
44
|
>
|
|
43
45
|
{safeChildren(children, <Fragment />)}
|
|
44
46
|
</ResizeInnerContainer>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { text, radios, select } from "@storybook/addon-knobs";
|
|
3
|
+
|
|
4
|
+
import page from "../../../../../../.storybook/page";
|
|
5
|
+
import Box from "../../Box";
|
|
6
|
+
import LayoutContentBlock from "../LayoutContentBlock";
|
|
7
|
+
|
|
8
|
+
const as = { default: "", button: "button" };
|
|
9
|
+
const textAlign = {
|
|
10
|
+
left: "left",
|
|
11
|
+
center: "center",
|
|
12
|
+
right: "right"
|
|
13
|
+
};
|
|
14
|
+
const groupId = "props";
|
|
15
|
+
|
|
16
|
+
export default page({
|
|
17
|
+
title: "Layouts|Basic Layouts/Box",
|
|
18
|
+
Component: Box
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const box = () => (
|
|
22
|
+
<Box
|
|
23
|
+
padding={text("padding", "16px", groupId)}
|
|
24
|
+
borderSize={text("borderSize", "0px", groupId)}
|
|
25
|
+
borderColor={text("borderColor", "transparent", groupId)}
|
|
26
|
+
borderRadius={text("borderRadius", "0px", groupId)}
|
|
27
|
+
boxShadow={text("boxShadow", "none", groupId)}
|
|
28
|
+
background={text("background", "", groupId)}
|
|
29
|
+
color={text("color", "", groupId)}
|
|
30
|
+
minHeight={text("minHeight", "", groupId)}
|
|
31
|
+
width={text("width", "", groupId)}
|
|
32
|
+
minWidth={text("minWidth", "", groupId)}
|
|
33
|
+
maxWidth={text("maxWidth", "", groupId)}
|
|
34
|
+
borderWidthOverride={text("borderWidthOverride", "", groupId)}
|
|
35
|
+
border={text("border", "", groupId)}
|
|
36
|
+
as={radios("as", as, "default", groupId)}
|
|
37
|
+
textAlign={select("textAlign", textAlign, "left", groupId)}
|
|
38
|
+
hoverStyles={text("hoverStyles", "", groupId)}
|
|
39
|
+
activeStyles={text("activeStyles", "", groupId)}
|
|
40
|
+
disabledStyles={text("disabledStyles", "", groupId)}
|
|
41
|
+
hiddenStyles={text("hiddenStyles", "", groupId)}
|
|
42
|
+
extraStyles={text("extraStyles", "", groupId)}
|
|
43
|
+
onClick={text("onClick", () => {}, groupId)}
|
|
44
|
+
onKeyDown={text("onKeyDown", () => {}, groupId)}
|
|
45
|
+
onMouseEnter={text("onMouseEnter", () => {}, groupId)}
|
|
46
|
+
onMouseLeave={text("onMouseLeave", () => {}, groupId)}
|
|
47
|
+
onFocus={text("onFocus", () => {}, groupId)}
|
|
48
|
+
onBlur={text("onBlur", () => {}, groupId)}
|
|
49
|
+
onTouchEnd={text("onTouchEnd", () => {}, groupId)}
|
|
50
|
+
>
|
|
51
|
+
Text Child
|
|
52
|
+
<LayoutContentBlock
|
|
53
|
+
height="3.5rem"
|
|
54
|
+
width="8rem"
|
|
55
|
+
layoutName="Component Child"
|
|
56
|
+
/>
|
|
57
|
+
</Box>
|
|
58
|
+
);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { text, boolean } from "@storybook/addon-knobs";
|
|
3
|
+
|
|
4
|
+
import page from "../../../../../../.storybook/page";
|
|
5
|
+
import Center from "../../Center";
|
|
6
|
+
import LayoutContentBlock from "../LayoutContentBlock";
|
|
7
|
+
|
|
8
|
+
const groupId = "props";
|
|
9
|
+
|
|
10
|
+
export default page({
|
|
11
|
+
title: "Layouts|Basic Layouts/Center",
|
|
12
|
+
Component: Center
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const center = () => (
|
|
16
|
+
<Center
|
|
17
|
+
maxWidth={text("maxWidth", "", groupId)}
|
|
18
|
+
gutters={text("gutters", "", groupId)}
|
|
19
|
+
intrinsic={boolean("intrinsic", false, groupId)}
|
|
20
|
+
>
|
|
21
|
+
Text Child
|
|
22
|
+
<LayoutContentBlock
|
|
23
|
+
height="3.5rem"
|
|
24
|
+
width="8rem"
|
|
25
|
+
layoutName="Component Child"
|
|
26
|
+
/>
|
|
27
|
+
</Center>
|
|
28
|
+
);
|
|
@@ -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}
|
|
@@ -21,8 +21,6 @@ export const StyledInternalLink = styled(
|
|
|
21
21
|
font-size: ${({ fontSize }) => fontSize};
|
|
22
22
|
font-family: ${({ fontFamily }) => fontFamily};
|
|
23
23
|
margin: ${({ margin }) => margin};
|
|
24
|
-
text-decoration: ${({ active }) =>
|
|
25
|
-
active === "true" ? "underline" : "none"};
|
|
26
24
|
|
|
27
25
|
&:hover,
|
|
28
26
|
&:focus {
|
|
@@ -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
|
+
);
|