@thecb/components 3.1.4-beta.0 → 3.2.0
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 +119 -103
- package/dist/index.esm.js +116 -100
- 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/partial-amount-form/PartialAmountForm.state.js +2 -1
- 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/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/dist/cb-components.esm.js +0 -23576
- package/dist/cb-components.js +0 -94714
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React, { Fragment } from "react";
|
|
2
|
+
import { boolean, object } from "@storybook/addon-knobs";
|
|
3
|
+
import TabSidebar from "./TabSidebar";
|
|
4
|
+
|
|
5
|
+
import page from "../../../../.storybook/page";
|
|
6
|
+
|
|
7
|
+
import * as Icons from "../../atoms/icons";
|
|
8
|
+
|
|
9
|
+
const groupId = "props";
|
|
10
|
+
|
|
11
|
+
const defaultLinks = [
|
|
12
|
+
{
|
|
13
|
+
route: "/profile/accounts",
|
|
14
|
+
text: "Accounts",
|
|
15
|
+
active: true,
|
|
16
|
+
icon: "AccountsIconSmall"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
route: "/profile/settings",
|
|
20
|
+
text: "Settings",
|
|
21
|
+
active: false,
|
|
22
|
+
icon: "SettingsIconSmall"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
route: "/profile/properties",
|
|
26
|
+
text: "Properties",
|
|
27
|
+
active: false,
|
|
28
|
+
icon: "PropertiesIconSmall"
|
|
29
|
+
}
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
const isRouteActive = route => location.pathname.includes(route);
|
|
33
|
+
|
|
34
|
+
// should TabSidebar be updated to just take the name of an icon per tab? instead of a full component
|
|
35
|
+
const getIcon = link => {
|
|
36
|
+
const Icon = Icons[link.icon];
|
|
37
|
+
return Icon ? (
|
|
38
|
+
<Icon variant={isRouteActive(link) ? "primary" : "secondary"} />
|
|
39
|
+
) : (
|
|
40
|
+
<Fragment />
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const tabSidebar = () => {
|
|
45
|
+
let links = object("links", defaultLinks, groupId);
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<TabSidebar
|
|
49
|
+
links={links.map(link => ({ ...link, icon: getIcon(link) }))}
|
|
50
|
+
isMobile={boolean("isMobile", false, groupId)}
|
|
51
|
+
/>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const story = page({
|
|
56
|
+
title: "Components|Molecules/TabSidebar",
|
|
57
|
+
Component: TabSidebar
|
|
58
|
+
});
|
|
59
|
+
export default story;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { text, boolean } from "@storybook/addon-knobs";
|
|
3
|
+
|
|
4
|
+
import TermsAndConditions from "./TermsAndConditions";
|
|
5
|
+
import page from "../../../../.storybook/page";
|
|
6
|
+
import { noop } from "../../../util/general";
|
|
7
|
+
|
|
8
|
+
const groupId = "props";
|
|
9
|
+
|
|
10
|
+
export const termsAndConditions = () => (
|
|
11
|
+
<TermsAndConditions
|
|
12
|
+
onCheck={noop}
|
|
13
|
+
isChecked={boolean("isChecked", false, groupId)}
|
|
14
|
+
html={text("html", "terms and conditions summary", groupId)}
|
|
15
|
+
terms={text("terms", "terms and conditions modal text", groupId)}
|
|
16
|
+
error={boolean("error", false, groupId)}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const story = page({
|
|
21
|
+
title: "Components|Molecules/TermsAndConditions",
|
|
22
|
+
Component: TermsAndConditions
|
|
23
|
+
});
|
|
24
|
+
export default story;
|
package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.stories.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { text, select, boolean } from "@storybook/addon-knobs";
|
|
3
|
+
|
|
4
|
+
import TermsAndConditionsModal from "./TermsAndConditionsModal";
|
|
5
|
+
import page from "../../../../.storybook/page";
|
|
6
|
+
|
|
7
|
+
const variants = {
|
|
8
|
+
default: "default",
|
|
9
|
+
footer: "footer",
|
|
10
|
+
None: undefined
|
|
11
|
+
};
|
|
12
|
+
const groupId = "props";
|
|
13
|
+
|
|
14
|
+
export const termsAndConditionsModal = () => (
|
|
15
|
+
<TermsAndConditionsModal
|
|
16
|
+
link={text("text", "Show modal", groupId)}
|
|
17
|
+
title={text("title", "Title", groupId)}
|
|
18
|
+
isOpen={boolean("isOpen", false, groupId)}
|
|
19
|
+
// toggleOpen={setShowTerms}
|
|
20
|
+
// toggleAccepted={toggleTermsAccepted}
|
|
21
|
+
acceptText={text("acceptText", "Accept", groupId)}
|
|
22
|
+
terms={text("terms", "terms and conditions", groupId)}
|
|
23
|
+
variant={select("variants", variants, "default", groupId)}
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
const story = page({
|
|
28
|
+
title: "Components|Molecules/TermsAndConditionsModal",
|
|
29
|
+
Component: TermsAndConditionsModal
|
|
30
|
+
});
|
|
31
|
+
export default story;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { text } from "@storybook/addon-knobs";
|
|
3
|
+
|
|
4
|
+
import WorkflowTile from "./WorkflowTile";
|
|
5
|
+
import page from "../../../../.storybook/page";
|
|
6
|
+
|
|
7
|
+
const groupId = "props";
|
|
8
|
+
|
|
9
|
+
export const workflowTile = () => (
|
|
10
|
+
<WorkflowTile
|
|
11
|
+
workflowName={text("workflowName", "Test Workflow", groupId)}
|
|
12
|
+
workflowDescription={text(
|
|
13
|
+
"workflowDescription",
|
|
14
|
+
"Workflow Description",
|
|
15
|
+
groupId
|
|
16
|
+
)}
|
|
17
|
+
slug={text("slug", "slug", groupId)}
|
|
18
|
+
/>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const story = page({
|
|
22
|
+
title: "Components|Molecules/WorkflowTile",
|
|
23
|
+
Component: WorkflowTile
|
|
24
|
+
});
|
|
25
|
+
export default story;
|