@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,44 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { text, boolean } from "@storybook/addon-knobs";
|
|
3
|
+
import Modal from "./Modal";
|
|
4
|
+
|
|
5
|
+
import page from "../../../../.storybook/page";
|
|
6
|
+
|
|
7
|
+
import Text from "../../atoms/text";
|
|
8
|
+
import { noop } from "../../../util/general";
|
|
9
|
+
|
|
10
|
+
const groupId = "props";
|
|
11
|
+
export const modal = () => (
|
|
12
|
+
<Modal
|
|
13
|
+
ModalLink={() => (
|
|
14
|
+
<Text
|
|
15
|
+
onClick={noop}
|
|
16
|
+
color={"#347BB2"}
|
|
17
|
+
fontSize="18px"
|
|
18
|
+
lineHeight="2rem"
|
|
19
|
+
extraStyles={`cursor: pointer;`}
|
|
20
|
+
>
|
|
21
|
+
Modal Link
|
|
22
|
+
</Text>
|
|
23
|
+
)}
|
|
24
|
+
hideModal={noop}
|
|
25
|
+
continueAction={noop}
|
|
26
|
+
modalOpen={boolean("modalOpen", false, groupId)}
|
|
27
|
+
modalHeaderText={text("modalHeaderText", "Modal Header Text", groupId)}
|
|
28
|
+
modalBodyText={text("modalBodyText", "Modal Body Text", groupId)}
|
|
29
|
+
cancelButtonText={text("cancelButtonText", "Cancel", groupId)}
|
|
30
|
+
continueButtonText={text("continueButtonText", "Continue", groupId)}
|
|
31
|
+
modalHeaderBg={text("modalHeaderBg", "white", groupId)}
|
|
32
|
+
modalBodyBg={text("modalBodyBg", "#F6F6F9", groupId)}
|
|
33
|
+
useDangerButton={boolean("useDangerButton", false, groupId)}
|
|
34
|
+
defaultWrapper={boolean("defaultWrapper", true, groupId)}
|
|
35
|
+
onlyCloseButton={boolean("onlyCloseButton", false, groupId)}
|
|
36
|
+
maxHeight={text("maxHeight", null, groupId)}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
const story = page({
|
|
41
|
+
title: "Components|Molecules/Modal",
|
|
42
|
+
Component: Modal
|
|
43
|
+
});
|
|
44
|
+
export default story;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import React, { Fragment } from "react";
|
|
1
|
+
import React, { Fragment, memo } from "react";
|
|
2
|
+
import { themeComponent } from "../../../util/themeUtils";
|
|
3
|
+
import { fallbackValues } from "./Module.theme";
|
|
2
4
|
import Heading from "../../atoms/heading";
|
|
3
5
|
import { Box } from "../../atoms/layouts";
|
|
4
6
|
|
|
@@ -37,4 +39,6 @@ const Module = ({
|
|
|
37
39
|
</Fragment>
|
|
38
40
|
);
|
|
39
41
|
|
|
40
|
-
export default
|
|
42
|
+
export default memo(
|
|
43
|
+
themeComponent(Module, "Module", fallbackValues, "default")
|
|
44
|
+
);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { text, select } from "@storybook/addon-knobs";
|
|
3
|
+
import Module from "./Module";
|
|
4
|
+
import page from "../../../../.storybook/page";
|
|
5
|
+
|
|
6
|
+
const variantsLabel = "variant";
|
|
7
|
+
const variants = {
|
|
8
|
+
default: "default",
|
|
9
|
+
largeTitle: "largeTitle",
|
|
10
|
+
None: undefined
|
|
11
|
+
};
|
|
12
|
+
const defaultValue = "default";
|
|
13
|
+
const groupId = "props";
|
|
14
|
+
|
|
15
|
+
export const module = () => (
|
|
16
|
+
<Module
|
|
17
|
+
variant={select(variantsLabel, variants, defaultValue, groupId)}
|
|
18
|
+
heading={text("heading", "Module Title", groupId)}
|
|
19
|
+
spacing={text("spacing", "1rem", groupId)}
|
|
20
|
+
padding={text("padding", "1rem", groupId)}
|
|
21
|
+
spacingBottom={text("spacingBottom", "2.5rem", groupId)}
|
|
22
|
+
>
|
|
23
|
+
{text("child components", "child components go here", groupId)}
|
|
24
|
+
</Module>
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
const story = page({
|
|
28
|
+
title: "Components|Atoms/Module",
|
|
29
|
+
Component: Module
|
|
30
|
+
});
|
|
31
|
+
export default story;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import { memo } from "react";
|
|
2
1
|
import Module from "./Module";
|
|
3
|
-
import { themeComponent } from "../../../util/themeUtils";
|
|
4
|
-
import { fallbackValues } from "./Module.theme";
|
|
5
2
|
|
|
6
|
-
export default
|
|
7
|
-
themeComponent(Module, "Module", fallbackValues, "default")
|
|
8
|
-
);
|
|
3
|
+
export default Module;
|
|
@@ -25,7 +25,7 @@ const Obligation = ({
|
|
|
25
25
|
>
|
|
26
26
|
<Stack childGap="14px">
|
|
27
27
|
<Box key={`${obligations[0].id}-top`} padding="0 8px" minWidth="100%">
|
|
28
|
-
<Cluster justify="space-between" align="center" childGap="4px">
|
|
28
|
+
<Cluster justify="space-between" align="center" childGap="4px" nowrap>
|
|
29
29
|
<Box padding="0">
|
|
30
30
|
<Cluster justify="flex-start" align="center">
|
|
31
31
|
{!isMobile && (
|
|
@@ -12,7 +12,11 @@ import { displayCurrency } from "../../../../util/general";
|
|
|
12
12
|
const AmountModule = ({ totalAmountDue, autoPayEnabled, isMobile }) => (
|
|
13
13
|
<Box padding="0 0.25rem 0 0">
|
|
14
14
|
<Stack childGap="0">
|
|
15
|
-
<Text
|
|
15
|
+
<Text
|
|
16
|
+
variant="pS"
|
|
17
|
+
weight={FONT_WEIGHT_SEMIBOLD}
|
|
18
|
+
extraStyles={`text-align: right;`}
|
|
19
|
+
>
|
|
16
20
|
{isMobile ? "Total Due" : "Total Amount Due"}
|
|
17
21
|
</Text>
|
|
18
22
|
<AmountCallout
|
|
@@ -24,7 +28,7 @@ const AmountModule = ({ totalAmountDue, autoPayEnabled, isMobile }) => (
|
|
|
24
28
|
variant="p"
|
|
25
29
|
weight={FONT_WEIGHT_REGULAR}
|
|
26
30
|
color={REGENT_GREY}
|
|
27
|
-
extraStyles={`font-style: italic
|
|
31
|
+
extraStyles={`font-style: italic; text-align: right;`}
|
|
28
32
|
>
|
|
29
33
|
{isMobile ? "Autopay On" : "Autopay Enabled"}
|
|
30
34
|
</Text>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { text, boolean } from "@storybook/addon-knobs";
|
|
3
|
+
import PaymentButtonBar from "./PaymentButtonBar";
|
|
4
|
+
import page from "../../../../.storybook/page";
|
|
5
|
+
|
|
6
|
+
export const paymentButtonBar = () => (
|
|
7
|
+
<PaymentButtonBar
|
|
8
|
+
forwardButtonText={text("forwardButtonText", "Next", "props")}
|
|
9
|
+
cancelText={text("cancelText", "Cancel", "props")}
|
|
10
|
+
backButtonAction={() => {}}
|
|
11
|
+
forwardButtonAction={() => {}}
|
|
12
|
+
forwardButtonLoading={boolean("forwardButtonLoading", false, "props")}
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
const story = page({
|
|
17
|
+
title: "Components|Molecules/PaymentButtonBar",
|
|
18
|
+
Component: PaymentButtonBar
|
|
19
|
+
});
|
|
20
|
+
export default story;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { text, boolean } from "@storybook/addon-knobs";
|
|
3
|
+
import PaymentDetails from "./PaymentDetails";
|
|
4
|
+
import page from "../../../../.storybook/page";
|
|
5
|
+
|
|
6
|
+
const payment = {
|
|
7
|
+
fees: [
|
|
8
|
+
{
|
|
9
|
+
amount: 1739.12,
|
|
10
|
+
label: "Service Fee"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
lineItems: [
|
|
14
|
+
{
|
|
15
|
+
amount: 77294,
|
|
16
|
+
customAttributes: [
|
|
17
|
+
{
|
|
18
|
+
key: "parcel_id",
|
|
19
|
+
value: "71-83-630-216-0724"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
key: "property_city",
|
|
23
|
+
value: "North Breana"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
key: "property_class",
|
|
27
|
+
value: "7-91"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
key: "property_secondary_address",
|
|
31
|
+
value: "79"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
key: "property_street_address",
|
|
35
|
+
value: "0034 Bednar Mission"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
key: "property_zip_code",
|
|
39
|
+
value: "80326-6917"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
key: "tax_rate",
|
|
43
|
+
value: "7.076"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
description: "0034 Bednar Mission Unit: 79",
|
|
47
|
+
quantity: 1,
|
|
48
|
+
subDescription: "PIN: 71-83-630-216-0724"
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
subtotal: 77294,
|
|
52
|
+
total: 79033
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const paymentDetails = () => (
|
|
56
|
+
<PaymentDetails
|
|
57
|
+
subtotal={text("subtotal", payment.subtotal, "props")}
|
|
58
|
+
lineItems={payment.lineItems}
|
|
59
|
+
fees={payment.fees}
|
|
60
|
+
total={text("total", payment.total, "props")}
|
|
61
|
+
collapsibleOnMobile={boolean("collapsibleOnMobile", false, "props")}
|
|
62
|
+
initiallyOpen={boolean("initiallyOpen", true, "props")}
|
|
63
|
+
hideTitle={boolean("hideTitle", false, "props")}
|
|
64
|
+
/>
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
const story = page({
|
|
68
|
+
title: "Components|Molecules/PaymentDetails",
|
|
69
|
+
Component: PaymentDetails
|
|
70
|
+
});
|
|
71
|
+
export default story;
|
|
@@ -108,22 +108,6 @@ const PaymentFormCard = ({
|
|
|
108
108
|
/>
|
|
109
109
|
</Box>
|
|
110
110
|
)}
|
|
111
|
-
{!!fees?.value && (
|
|
112
|
-
<Alert
|
|
113
|
-
heading="Processing Fee"
|
|
114
|
-
text={`There is a processing fee of ${
|
|
115
|
-
fees.type === "FLAT"
|
|
116
|
-
? `${displayCurrency(fees.value)}`
|
|
117
|
-
: `${fees.value * 100}%`
|
|
118
|
-
} ${ifElse(
|
|
119
|
-
isNil,
|
|
120
|
-
always(""),
|
|
121
|
-
a => `with a minimum of ${displayCurrency(a)} `
|
|
122
|
-
)(fees.minimumInCents)} on all card payments.`}
|
|
123
|
-
variant="info"
|
|
124
|
-
showQuitLink={false}
|
|
125
|
-
/>
|
|
126
|
-
)}
|
|
127
111
|
</FormInputColumn>
|
|
128
112
|
</FormContainer>
|
|
129
113
|
);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { connect } from "react-redux";
|
|
3
|
+
import { boolean } from "@storybook/addon-knobs";
|
|
4
|
+
|
|
5
|
+
import PhoneForm from "./PhoneForm";
|
|
6
|
+
import page from "../../../../.storybook/page";
|
|
7
|
+
import * as PhoneFormState from "./PhoneForm.state";
|
|
8
|
+
|
|
9
|
+
const story = page({
|
|
10
|
+
title: "Components|Molecules/PhoneForm",
|
|
11
|
+
Component: PhoneForm,
|
|
12
|
+
reducer: PhoneFormState.reducer,
|
|
13
|
+
mapStateToProps: PhoneFormState.mapStateToProps,
|
|
14
|
+
mapDispatchToProps: PhoneFormState.mapDispatchToProps
|
|
15
|
+
});
|
|
16
|
+
export default story;
|
|
17
|
+
|
|
18
|
+
const ConnectedForm = connect(
|
|
19
|
+
PhoneFormState.mapStateToProps,
|
|
20
|
+
PhoneFormState.mapDispatchToProps
|
|
21
|
+
)(PhoneForm);
|
|
22
|
+
export const phoneForm = () => (
|
|
23
|
+
<ConnectedForm showErrors={boolean("showErrors", false, "props")} />
|
|
24
|
+
);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { text, boolean } from "@storybook/addon-knobs";
|
|
3
|
+
|
|
4
|
+
import RadioSection from "./RadioSection";
|
|
5
|
+
import page from "../../../../.storybook/page";
|
|
6
|
+
|
|
7
|
+
const story = page({
|
|
8
|
+
title: "Components|Atoms/RadioSection",
|
|
9
|
+
Component: RadioSection
|
|
10
|
+
});
|
|
11
|
+
export default story;
|
|
12
|
+
|
|
13
|
+
const sections = [
|
|
14
|
+
{ id: "foo", title: "Foo", content: <div>Content 0</div> },
|
|
15
|
+
{ id: "bar", title: "Bar", content: <div>Content 1</div> },
|
|
16
|
+
{ id: "baz", title: "Baz", content: <div>Content 2</div> }
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
export const radioSection = () => {
|
|
20
|
+
const [openSection, setOpenSection] = useState("");
|
|
21
|
+
return (
|
|
22
|
+
<RadioSection
|
|
23
|
+
isMobile={boolean("isMobile", false, "props")}
|
|
24
|
+
supportsTouch={boolean("isMobile", false, "props")}
|
|
25
|
+
toggleOpenSection={setOpenSection}
|
|
26
|
+
openSection={openSection}
|
|
27
|
+
staggeredAnimation={boolean("staggeredAnimation", false, "props")}
|
|
28
|
+
sections={sections}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { connect } from "react-redux";
|
|
3
|
+
import { boolean } from "@storybook/addon-knobs";
|
|
4
|
+
|
|
5
|
+
import RegistrationForm from "./RegistrationForm";
|
|
6
|
+
import page from "../../../../.storybook/page";
|
|
7
|
+
import * as RegistrationFormState from "./RegistrationForm.state";
|
|
8
|
+
|
|
9
|
+
const story = page({
|
|
10
|
+
title: "Components|Molecules/RegistrationForm",
|
|
11
|
+
Component: RegistrationForm,
|
|
12
|
+
reducer: RegistrationFormState.reducer,
|
|
13
|
+
mapStateToProps: RegistrationFormState.mapStateToProps,
|
|
14
|
+
mapDispatchToProps: RegistrationFormState.mapDispatchToProps
|
|
15
|
+
});
|
|
16
|
+
export default story;
|
|
17
|
+
|
|
18
|
+
const ConnectedForm = connect(
|
|
19
|
+
RegistrationFormState.mapStateToProps,
|
|
20
|
+
RegistrationFormState.mapDispatchToProps
|
|
21
|
+
)(RegistrationForm);
|
|
22
|
+
export const registrationForm = () => (
|
|
23
|
+
<ConnectedForm showErrors={boolean("showErrors", false, "props")} />
|
|
24
|
+
);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import ResetConfirmationForm from "./ResetConfirmationForm";
|
|
4
|
+
import page from "../../../../.storybook/page";
|
|
5
|
+
|
|
6
|
+
const story = page({
|
|
7
|
+
title: "Components|Molecules/ResetConfirmationForm",
|
|
8
|
+
Component: ResetConfirmationForm
|
|
9
|
+
});
|
|
10
|
+
export default story;
|
|
11
|
+
export const resetConfirmationForm = () => <ResetConfirmationForm />;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { connect } from "react-redux";
|
|
3
|
+
import { boolean } from "@storybook/addon-knobs";
|
|
4
|
+
|
|
5
|
+
import ResetPasswordForm from "./ResetPasswordForm";
|
|
6
|
+
import page from "../../../../.storybook/page";
|
|
7
|
+
import * as ResetPasswordFormState from "./ResetPasswordForm.state";
|
|
8
|
+
|
|
9
|
+
const story = page({
|
|
10
|
+
title: "Components|Molecules/ResetPasswordForm",
|
|
11
|
+
Component: ResetPasswordForm,
|
|
12
|
+
reducer: ResetPasswordFormState.reducer,
|
|
13
|
+
mapStateToProps: ResetPasswordFormState.mapStateToProps,
|
|
14
|
+
mapDispatchToProps: ResetPasswordFormState.mapDispatchToProps
|
|
15
|
+
});
|
|
16
|
+
export default story;
|
|
17
|
+
|
|
18
|
+
const ConnectedForm = connect(
|
|
19
|
+
ResetPasswordFormState.mapStateToProps,
|
|
20
|
+
ResetPasswordFormState.mapDispatchToProps
|
|
21
|
+
)(ResetPasswordForm);
|
|
22
|
+
export const resetPasswordForm = () => (
|
|
23
|
+
<ConnectedForm showErrors={boolean("showErrors", false, "props")} />
|
|
24
|
+
);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import ResetPasswordSuccess from "./ResetPasswordSuccess";
|
|
4
|
+
import page from "../../../../.storybook/page";
|
|
5
|
+
|
|
6
|
+
const story = page({
|
|
7
|
+
title: "Components|Molecules/ResetPasswordSuccess",
|
|
8
|
+
Component: ResetPasswordSuccess
|
|
9
|
+
});
|
|
10
|
+
export default story;
|
|
11
|
+
export const resetPasswordSuccess = () => <ResetPasswordSuccess />;
|
|
@@ -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;
|