@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.
Files changed (102) hide show
  1. package/.storybook/main.js +4 -0
  2. package/.storybook/page.js +62 -0
  3. package/.storybook/themes/apc.theme.js +1 -0
  4. package/.storybook/themes/index.js +2 -0
  5. package/.storybook/themes/sf.theme.js +1 -0
  6. package/.tool-versions +1 -0
  7. package/dist/index.cjs.js +539 -13398
  8. package/package.json +14 -6
  9. package/rollup.config.js +0 -2
  10. package/src/components/atoms/alert/Alert.stories.js +28 -0
  11. package/src/components/atoms/amount-callout/AmountCallout.stories.js +41 -0
  12. package/src/components/atoms/amount-callout/AmountCallout.theme.js +4 -4
  13. package/src/components/atoms/breadcrumb/Breadcrumb.js +7 -0
  14. package/src/components/atoms/breadcrumb/Breadcrumb.stories.js +38 -0
  15. package/src/components/atoms/breadcrumb/Breadcrumb.theme.js +3 -1
  16. package/src/components/atoms/button-with-action/ButtonWithAction.stories.js +31 -122
  17. package/src/components/atoms/button-with-action/ButtonWithAction.theme.js +20 -7
  18. package/src/components/atoms/button-with-link/ButtonWithLink.js +17 -3
  19. package/src/components/atoms/button-with-link/ButtonWithLink.stories.js +32 -0
  20. package/src/components/atoms/checkbox/Checkbox.stories.js +29 -0
  21. package/src/components/atoms/checkbox-list/CheckboxList.stories.js +50 -0
  22. package/src/components/atoms/country-dropdown/CountryDropdown.stories.js +42 -0
  23. package/src/components/atoms/display-box/DisplayBox.stories.js +25 -0
  24. package/src/components/atoms/display-card/DisplayCard.js +2 -0
  25. package/src/components/atoms/display-card/DisplayCard.stories.js +24 -0
  26. package/src/components/atoms/dropdown/Dropdown.js +3 -6
  27. package/src/components/atoms/dropdown/Dropdown.stories.js +70 -0
  28. package/src/components/atoms/form-layouts/FormLayouts.stories.js +72 -0
  29. package/src/components/atoms/form-select/FormSelect.stories.js +44 -0
  30. package/src/components/atoms/formatted-address/FormattedAddress.js +1 -3
  31. package/src/components/atoms/formatted-address/FormattedAddress.stories.js +32 -0
  32. package/src/components/atoms/hamburger-button/HamburgerButton.js +7 -1
  33. package/src/components/atoms/hamburger-button/HamburgerButton.stories.js +21 -0
  34. package/src/components/atoms/heading/Heading.stories.js +20 -0
  35. package/src/components/atoms/icons/icons.stories.js +50 -0
  36. package/src/components/atoms/labeled-amount/LabeledAmount.js +1 -1
  37. package/src/components/atoms/labeled-amount/LabeledAmount.stories.js +29 -0
  38. package/src/components/atoms/layouts/Cluster.js +2 -0
  39. package/src/components/atoms/layouts/Cluster.styled.js +1 -1
  40. package/src/components/atoms/layouts/examples/ResizingContainer.js +3 -1
  41. package/src/components/atoms/layouts/examples/ResizingContainer.styled.js +1 -1
  42. package/src/components/atoms/layouts/examples/box-example/BoxExample.stories.js +58 -0
  43. package/src/components/atoms/layouts/examples/center-example/CenterExample.stories.js +28 -0
  44. package/src/components/atoms/layouts/examples/cover-example/CoverExample.stories.js +53 -0
  45. package/src/components/atoms/layouts/examples/frame-example/FrameExample.stories.js +22 -0
  46. package/src/components/atoms/layouts/examples/imposter-example/ImposterExample.stories.js +35 -0
  47. package/src/components/atoms/layouts/examples/motion-example/MotionExample.stories.js +62 -0
  48. package/src/components/atoms/layouts/examples/reel-example/ReelExample.stories.js +57 -0
  49. package/src/components/atoms/line-item/LineItem.js +2 -2
  50. package/src/components/atoms/line-item/LineItem.stories.js +19 -0
  51. package/src/components/atoms/link/ExternalLink.js +1 -3
  52. package/src/components/atoms/link/ExternalLink.styled.js +2 -2
  53. package/src/components/atoms/link/InternalLink.styled.js +5 -4
  54. package/src/components/atoms/link/Link.stories.js +57 -0
  55. package/src/components/atoms/link/Link.theme.js +3 -2
  56. package/src/components/atoms/nav-footer/NavFooter.stories.js +31 -0
  57. package/src/components/atoms/nav-header/NavHeader.stories.js +29 -0
  58. package/src/components/atoms/paragraph/Paragraph.stories.js +34 -0
  59. package/src/components/atoms/paragraph/Paragraph.theme.js +6 -2
  60. package/src/components/atoms/password-requirements/PasswordRequirements.stories.js +75 -0
  61. package/src/components/atoms/placeholder/Placeholder.js +16 -16
  62. package/src/components/atoms/placeholder/Placeholder.stories.js +38 -0
  63. package/src/components/atoms/processing-fee/ProcessingFee.stories.js +28 -0
  64. package/src/components/atoms/radio-button/RadioButton.stories.js +69 -0
  65. package/src/components/atoms/solid-divider/SolidDivider.stories.js +11 -0
  66. package/src/components/atoms/spinner/Spinner.stories.js +17 -0
  67. package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.stories.js +52 -0
  68. package/src/components/atoms/text/Text.stories.js +34 -0
  69. package/src/components/atoms/text/Text.theme.js +6 -2
  70. package/src/components/atoms/toggle-switch/ToggleSwitch.js +1 -1
  71. package/src/components/atoms/toggle-switch/ToggleSwitch.stories.js +70 -0
  72. package/src/components/molecules/address-form/AddressForm.stories.js +21 -0
  73. package/src/components/molecules/change-password-form/ChangePasswordForm.stories.js +22 -0
  74. package/src/components/molecules/collapsible-section/CollapsibleSection.js +2 -1
  75. package/src/components/molecules/collapsible-section/CollapsibleSection.stories.js +68 -0
  76. package/src/components/molecules/edit-name-form/EdidNameForm.stories.js +24 -0
  77. package/src/components/molecules/email-form/EmailForm.stories.js +24 -0
  78. package/src/components/molecules/forgot-password-form/ForgotPasswordForm.stories.js +24 -0
  79. package/src/components/molecules/highlight-tab-row/HighlightTabRow.js +8 -3
  80. package/src/components/molecules/highlight-tab-row/HighlightTabRow.stories.js +30 -0
  81. package/src/components/molecules/highlight-tab-row/index.js +1 -6
  82. package/src/components/molecules/login-form/LoginForm.stories.js +24 -0
  83. package/src/components/molecules/modal/Modal.stories.js +44 -0
  84. package/src/components/molecules/module/Module.js +6 -2
  85. package/src/components/molecules/module/Module.stories.js +31 -0
  86. package/src/components/molecules/module/index.js +1 -6
  87. package/src/components/molecules/obligation/Obligation.js +1 -1
  88. package/src/components/molecules/obligation/modules/AmountModule.js +6 -2
  89. package/src/components/molecules/payment-button-bar/PaymentButtonBar.stories.js +20 -0
  90. package/src/components/molecules/payment-details/PaymentDetails.stories.js +71 -0
  91. package/src/components/molecules/payment-form-card/PaymentFormCard.js +0 -16
  92. package/src/components/molecules/phone-form/PhoneForm.stories.js +24 -0
  93. package/src/components/molecules/radio-section/RadioSection.stories.js +31 -0
  94. package/src/components/molecules/registration-form/RegistrationForm.stories.js +24 -0
  95. package/src/components/molecules/reset-confirmation-form/ResetConfirmationForm.stories.js +11 -0
  96. package/src/components/molecules/reset-password-form/ResetPasswordForm.stories.js +24 -0
  97. package/src/components/molecules/reset-password-success/ResetPasswordSuccess.stories.js +11 -0
  98. package/src/components/molecules/tab-sidebar/TabSidebar.js +2 -1
  99. package/src/components/molecules/tab-sidebar/TabSidebar.stories.js +59 -0
  100. package/src/components/molecules/terms-and-conditions/TermsAndConditions.stories.js +24 -0
  101. package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.stories.js +31 -0
  102. package/src/components/molecules/workflow-tile/WorkflowTile.stories.js +25 -0
@@ -0,0 +1,38 @@
1
+ import React from "react";
2
+ import { text, select } from "@storybook/addon-knobs";
3
+ import Placeholder from "./Placeholder";
4
+ import page from "../../../../.storybook/page";
5
+
6
+ const variantsLabel = "variant";
7
+ const variants = {
8
+ default: "default",
9
+ large: "large"
10
+ };
11
+ const defaultValue = "default";
12
+ const groupId = "props";
13
+
14
+ const icons = {
15
+ accounts: "accounts",
16
+ properties: "properties"
17
+ };
18
+
19
+ const iconLabel = "largeIcon";
20
+
21
+ const defaultIcon = "accounts";
22
+
23
+ export const placeholder = () => (
24
+ <Placeholder
25
+ variant={select(variantsLabel, variants, defaultValue, groupId)}
26
+ isLink
27
+ destination={text("destination", "add-account", "props")}
28
+ text={text("text", "Add an Account", "props")}
29
+ largeIcon={select(iconLabel, icons, defaultIcon, groupId)}
30
+ key="placeholder"
31
+ />
32
+ );
33
+
34
+ const story = page({
35
+ title: "Components|Atoms/Placeholder",
36
+ Component: Placeholder
37
+ });
38
+ export default story;
@@ -0,0 +1,28 @@
1
+ import React from "react";
2
+ import { text, select, boolean } from "@storybook/addon-knobs";
3
+ import ProcessingFee from "./ProcessingFee";
4
+ import page from "../../../../.storybook/page";
5
+
6
+ const feeTypes = {
7
+ flat: "FLAT",
8
+ percentage: "PERCENTAGE",
9
+ None: undefined
10
+ };
11
+ const defaultValue = "FLAT";
12
+ const groupId = "props";
13
+
14
+ export const processingFee = () => (
15
+ <ProcessingFee
16
+ feeValue={text("feeValue", "0", groupId)}
17
+ feeName={text("feeName", "Credit Card", groupId)}
18
+ feeType={select("feeTypes", feeTypes, defaultValue, groupId)}
19
+ feeMinimum={text("feeMinimum", "0", groupId)}
20
+ hide={boolean("hide", false, groupId)}
21
+ />
22
+ );
23
+
24
+ const story = page({
25
+ title: "Components|Atoms/ProcessingFee",
26
+ Component: ProcessingFee
27
+ });
28
+ export default story;
@@ -0,0 +1,69 @@
1
+ import React, { useState } from "react";
2
+ import { withKnobs, text, radios } from "@storybook/addon-knobs";
3
+ import RadioButton from "./RadioButton";
4
+ import { Box, Cover, Center } from "../layouts";
5
+ import { ThemeProvider } from "styled-components";
6
+
7
+ const fakeTheme = {
8
+ RadioButton: {
9
+ activeColor: "#15749D",
10
+ inactiveColor: "#959CA8"
11
+ }
12
+ };
13
+
14
+ export default {
15
+ title: "Radio Button",
16
+ component: RadioButton,
17
+ decorators: [
18
+ withKnobs,
19
+ storyFn => (
20
+ <ThemeProvider
21
+ theme={{
22
+ name: text("Theme Name", "default"),
23
+ values: fakeTheme
24
+ }}
25
+ >
26
+ <Cover>
27
+ <div />
28
+ <Center>{storyFn()}</Center>
29
+ <div />
30
+ </Cover>
31
+ </ThemeProvider>
32
+ )
33
+ ]
34
+ };
35
+
36
+ export const radioButtonsDefault = () => {
37
+ const buttons = 3;
38
+
39
+ const [selected, setSelected] = useState(null);
40
+ const [focused, setFocused] = useState(null);
41
+
42
+ return [...Array(buttons).keys()].map(i => {
43
+ const name = `radio-button-${i}`;
44
+ return (
45
+ <Box
46
+ key={name}
47
+ onFocus={() => setFocused(name)}
48
+ onBlur={() => setFocused(null)}
49
+ extraStyles="outline: none;"
50
+ tabIndex="0"
51
+ >
52
+ <RadioButton
53
+ name={name}
54
+ radioOn={selected === name}
55
+ radioFocused={focused === name}
56
+ toggleRadio={() => setSelected(name)}
57
+ disabled={
58
+ radios(
59
+ "Disable Radio Buttons",
60
+ { Enabled: "enabled", Disabled: "disabled" },
61
+ "enabled",
62
+ "RADIO-GROUP-1"
63
+ ) === "disabled"
64
+ }
65
+ />
66
+ </Box>
67
+ );
68
+ });
69
+ };
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import SolidDivider from "./SolidDivider";
3
+ import page from "../../../../.storybook/page";
4
+
5
+ export const solidDivider = () => <SolidDivider />;
6
+
7
+ const story = page({
8
+ title: "Components|Atoms/SolidDivider",
9
+ Component: SolidDivider
10
+ });
11
+ export default story;
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import { text } from "@storybook/addon-knobs";
3
+ import Spinner from "./Spinner";
4
+ import { Box } from "../layouts";
5
+ import page from "../../../../.storybook/page";
6
+
7
+ export const spinner = () => (
8
+ <Box>
9
+ <Spinner size={text("size", "100", "props")} />
10
+ </Box>
11
+ );
12
+
13
+ const story = page({
14
+ title: "Components|Atoms/Spinner",
15
+ Component: Spinner
16
+ });
17
+ export default story;
@@ -0,0 +1,52 @@
1
+ import React from "react";
2
+ import { connect } from "react-redux";
3
+ import { text, boolean } from "@storybook/addon-knobs";
4
+ import { createFormState, required } from "redux-freeform";
5
+
6
+ import StateProvinceDropDown from ".";
7
+ import page from "../../../../.storybook/page";
8
+
9
+ const { mapStateToProps, mapDispatchToProps, reducer } = createFormState({
10
+ state: {
11
+ validators: [required()]
12
+ }
13
+ });
14
+ const errorMessages = {
15
+ [required.error]: "State is required"
16
+ };
17
+
18
+ const story = page({
19
+ title: "Components|Atoms/StateProvinceDropDown",
20
+ Component: StateProvinceDropDown,
21
+ reducer,
22
+ mapStateToProps,
23
+ mapDispatchToProps,
24
+ height: "500px"
25
+ });
26
+
27
+ const FormWrapper = ({
28
+ fields,
29
+ actions,
30
+ countryCode,
31
+ labelTextWhenNoError,
32
+ showErrors
33
+ }) => (
34
+ <StateProvinceDropDown
35
+ errorMessages={errorMessages}
36
+ field={fields.state}
37
+ fieldActions={actions.fields.state}
38
+ countryCode={countryCode}
39
+ labelTextWhenNoError={labelTextWhenNoError}
40
+ showErrors={showErrors}
41
+ />
42
+ );
43
+
44
+ export default story;
45
+ const ConnectedForm = connect(mapStateToProps, mapDispatchToProps)(FormWrapper);
46
+ export const stateProvinceDropDown = () => (
47
+ <ConnectedForm
48
+ labelTextWhenNoError={text("State/Province", "", "props")}
49
+ countryCode={text("countryCode", "US", "props")}
50
+ showErrors={boolean("showErrors", false, "props")}
51
+ />
52
+ );
@@ -0,0 +1,34 @@
1
+ import React from "react";
2
+ import { text as storybookText, number, select } from "@storybook/addon-knobs";
3
+
4
+ import Text from "./Text";
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
+ export const text = () => (
19
+ <Text
20
+ extraStyles={storybookText("extraStyles", "text-align: center;", "props")}
21
+ margin={number("margin", 0, { min: 0, max: 99 }, "props")}
22
+ weight={select("weight", fontWeights, 400, "props")}
23
+ color={select("activeColor", colors, "black", "props")}
24
+ hoverStyles={storybookText("hoverStyles", "color: blue;", "props")}
25
+ >
26
+ {storybookText("children", "Lorem Ipsum", "props")}
27
+ </Text>
28
+ );
29
+
30
+ const story = page({
31
+ title: "Components|Atoms/Text",
32
+ Component: Text
33
+ });
34
+ export default story;
@@ -1,6 +1,10 @@
1
1
  const fontFamily = {
2
- primary: "Public Sans",
3
- secondary: "Open Sans"
2
+ p: "Public Sans",
3
+ pL: "Public Sans",
4
+ pS: "Public Sans",
5
+ pXS: "Public Sans",
6
+ pXXS: "Public Sans",
7
+ pXL: "Public Sans"
4
8
  };
5
9
 
6
10
  // Text uses the same variants as paragraph
@@ -7,6 +7,7 @@ import Heading from "../heading";
7
7
  import { Box, Center, Cover, Cluster } from "../layouts";
8
8
  import { FONT_WEIGHT_SEMIBOLD } from "../../../constants/style_constants";
9
9
  import { CHARADE_GREY } from "../../../constants/colors";
10
+ import { noop } from "../../../util/general";
10
11
 
11
12
  const HiddenToggleSwitchBox = styled.input`
12
13
  opacity: 0;
@@ -159,7 +160,6 @@ const ToggleSwitch = ({
159
160
  extraStyles={
160
161
  labelLeft ? themeValues.leftLabelStyles : themeValues.rightLabelStyles
161
162
  }
162
- hoverStyles={`outline: ${themeValues.onBackground} auto 5px`}
163
163
  >
164
164
  <Center>
165
165
  <Cluster justify="stretch" align="center">
@@ -0,0 +1,70 @@
1
+ import React, { useState, Fragment } from "react";
2
+ import { withKnobs, text, radios } from "@storybook/addon-knobs";
3
+ import ToggleSwitch from "./ToggleSwitch";
4
+ import { Cover, Center, Stack } from "../layouts";
5
+ import { ThemeProvider } from "styled-components";
6
+
7
+ const fakeTheme = {
8
+ ToggleSwitch: {
9
+ onBackground: "#15749D",
10
+ disabledBackground: "#D5D8DC",
11
+ white: "white",
12
+ offBackground: "#959EA7",
13
+ rightLabelStyles: `display: flex;
14
+ justify-content: flex-start;
15
+ align-items: center;
16
+ flex-direction: row;`,
17
+ leftLabelStyles: `display: flex;
18
+ justify-content: flex-start;
19
+ align-items: center;
20
+ flex-direction: row-reverse;`
21
+ }
22
+ };
23
+
24
+ export default {
25
+ title: "Toggle Switch",
26
+ component: ToggleSwitch,
27
+ decorators: [
28
+ withKnobs,
29
+ storyFn => (
30
+ <ThemeProvider
31
+ theme={{
32
+ name: text("Theme Name", "default"),
33
+ values: fakeTheme
34
+ }}
35
+ >
36
+ <Cover>
37
+ <div />
38
+ <Center>
39
+ <Stack>{storyFn()}</Stack>
40
+ </Center>
41
+ <div />
42
+ </Cover>
43
+ </ThemeProvider>
44
+ )
45
+ ]
46
+ };
47
+
48
+ export const toggleSwitchDefault = () => {
49
+ const [isOn, onToggle] = useState(false);
50
+
51
+ const disabled =
52
+ radios(
53
+ "Disable Toggle Switch",
54
+ { Enabled: "enabled", Disabled: "disabled" },
55
+ "enabled",
56
+ "RADIO-GROUP-1"
57
+ ) === "disabled";
58
+
59
+ return (
60
+ <Fragment>
61
+ <ToggleSwitch
62
+ name="toggle-switch"
63
+ label="Toggle Switch Label"
64
+ isOn={isOn}
65
+ onToggle={() => onToggle(!isOn)}
66
+ disabled={disabled}
67
+ />
68
+ </Fragment>
69
+ );
70
+ };
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ import { connect } from "react-redux";
3
+
4
+ import AddressForm from "./AddressForm";
5
+ import page from "../../../../.storybook/page";
6
+ import * as AddressFormState from "./AddressForm.state";
7
+
8
+ const story = page({
9
+ title: "Components|Molecules/AddressForm",
10
+ Component: AddressForm,
11
+ reducer: AddressFormState.reducer,
12
+ mapStateToProps: AddressFormState.mapStateToProps,
13
+ mapDispatchToProps: AddressFormState.mapDispatchToProps
14
+ });
15
+ export default story;
16
+
17
+ const ConnectedForm = connect(
18
+ AddressFormState.mapStateToProps,
19
+ AddressFormState.mapDispatchToProps
20
+ )(AddressForm);
21
+ export const addressForm = () => <ConnectedForm />;
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ import { connect } from "react-redux";
3
+ import { boolean } from "@storybook/addon-knobs";
4
+
5
+ import ChangePasswordForm from "./ChangePasswordForm";
6
+ import page from "../../../../.storybook/page";
7
+ import * as ChangePasswordFormState from "./ChangePasswordForm.state";
8
+
9
+ const story = page({
10
+ title: "Components|Molecules/ChangePasswordForm",
11
+ Component: ChangePasswordForm,
12
+ reducer: ChangePasswordFormState.reducer
13
+ });
14
+ export default story;
15
+
16
+ const ConnectedForm = connect(
17
+ ChangePasswordFormState.mapStateToProps,
18
+ ChangePasswordFormState.mapDispatchToProps
19
+ )(ChangePasswordForm);
20
+ export const changePasswordForm = () => (
21
+ <ConnectedForm showErrors={boolean("showErrors", false, "props")} />
22
+ );
@@ -15,6 +15,7 @@ const CollapsibleSection = ({
15
15
  isMobile,
16
16
  supportsTouch,
17
17
  title,
18
+ customPadding,
18
19
  initiallyOpen = true,
19
20
  openHeight = "auto",
20
21
  children,
@@ -69,7 +70,7 @@ const CollapsibleSection = ({
69
70
  >
70
71
  <Stack childGap={isOpen ? "0.5rem" : "0rem"}>
71
72
  <Box
72
- padding="0"
73
+ padding={customPadding ? customPadding : "0"}
73
74
  background={themeValues.headingBackgroundColor}
74
75
  onClick={isMobile && supportsTouch ? noop : toggleSection}
75
76
  onTouchEnd={isMobile && supportsTouch ? toggleSection : noop}
@@ -0,0 +1,68 @@
1
+ import React, { useState } from "react";
2
+ import { text, boolean } from "@storybook/addon-knobs";
3
+ import CollapsibleSection from "./CollapsibleSection";
4
+ import DisplayCard from "../../atoms/display-card";
5
+ import { Stack, Motion } from "../../atoms/layouts";
6
+ import page from "../../../../.storybook/page";
7
+
8
+ const content = {
9
+ open: {
10
+ x: "0",
11
+ opacity: 1
12
+ },
13
+ closed: {
14
+ x: "-7.5%",
15
+ opacity: 0
16
+ }
17
+ };
18
+ export const collapsibleSection = () => {
19
+ const [open, setOpen] = useState(false);
20
+ return (
21
+ <CollapsibleSection
22
+ title={text("title", "Collapsible Section Storybook", "props")}
23
+ toggleSection={() => setOpen(!open)}
24
+ initiallyOpen={boolean("initiallyOpen", false, "props")}
25
+ isOpen={open}
26
+ key="security-section"
27
+ >
28
+ <Stack childGap="16px">
29
+ <Motion
30
+ padding="0"
31
+ variants={content}
32
+ transition={{ duration: 0.3 }}
33
+ positionTransition
34
+ extraStyles={`transform-origin: 100% 0;`}
35
+ >
36
+ <DisplayCard
37
+ title="Password"
38
+ item="•••••••••••••"
39
+ buttonText="Change Password"
40
+ link
41
+ url=""
42
+ />
43
+ </Motion>
44
+ <Motion
45
+ padding="0"
46
+ variants={content}
47
+ transition={{ duration: 0.3 }}
48
+ positionTransition
49
+ extraStyles={`transform-origin: 100% 0;`}
50
+ >
51
+ <DisplayCard
52
+ title="Name"
53
+ item="Hello Citybase"
54
+ buttonText="Edit Name"
55
+ link
56
+ url=""
57
+ />
58
+ </Motion>
59
+ </Stack>
60
+ </CollapsibleSection>
61
+ );
62
+ };
63
+ const story = page({
64
+ title: "Components|Molecules/CollapsibleSection",
65
+ Component: CollapsibleSection
66
+ });
67
+
68
+ export default story;
@@ -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 EditNameForm from "./EditNameForm";
6
+ import page from "../../../../.storybook/page";
7
+ import * as EditNameFormState from "./EditNameForm.state";
8
+
9
+ const story = page({
10
+ title: "Components|Molecules/EditNameForm",
11
+ Component: EditNameForm,
12
+ reducer: EditNameFormState.reducer,
13
+ mapStateToProps: EditNameFormState.mapStateToProps,
14
+ mapDispatchToProps: EditNameFormState.mapDispatchToProps
15
+ });
16
+ export default story;
17
+
18
+ const ConnectedForm = connect(
19
+ EditNameFormState.mapStateToProps,
20
+ EditNameFormState.mapDispatchToProps
21
+ )(EditNameForm);
22
+ export const editNameForm = () => (
23
+ <ConnectedForm showErrors={boolean("showErrors", false, "props")} />
24
+ );
@@ -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 EmailForm from "./EmailForm";
6
+ import page from "../../../../.storybook/page";
7
+ import * as EmailFormState from "./EmailForm.state";
8
+
9
+ const story = page({
10
+ title: "Components|Molecules/EmailForm",
11
+ Component: EmailForm,
12
+ reducer: EmailFormState.reducer,
13
+ mapStateToProps: EmailFormState.mapStateToProps,
14
+ mapDispatchToProps: EmailFormState.mapDispatchToProps
15
+ });
16
+ export default story;
17
+
18
+ const ConnectedForm = connect(
19
+ EmailFormState.mapStateToProps,
20
+ EmailFormState.mapDispatchToProps
21
+ )(EmailForm);
22
+ export const emailForm = () => (
23
+ <ConnectedForm showErrors={boolean("showErrors", false, "props")} />
24
+ );
@@ -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 ForgotPasswordForm from "./ForgotPasswordForm";
6
+ import page from "../../../../.storybook/page";
7
+ import * as ForgotPasswordFormState from "./ForgotPasswordForm.state";
8
+
9
+ const story = page({
10
+ title: "Components|Molecules/ForgotPasswordForm",
11
+ Component: ForgotPasswordForm,
12
+ reducer: ForgotPasswordFormState.reducer,
13
+ mapStateToProps: ForgotPasswordFormState.mapStateToProps,
14
+ mapDispatchToProps: ForgotPasswordFormState.mapDispatchToProps
15
+ });
16
+ export default story;
17
+
18
+ const ConnectedForm = connect(
19
+ ForgotPasswordFormState.mapStateToProps,
20
+ ForgotPasswordFormState.mapDispatchToProps
21
+ )(ForgotPasswordForm);
22
+ export const forgotPasswordForm = () => (
23
+ <ConnectedForm showErrors={boolean("showErrors", false, "props")} />
24
+ );
@@ -1,10 +1,13 @@
1
- import React from "react";
2
-
1
+ import React, { memo } from "react";
3
2
  import { repeat } from "ramda";
3
+
4
+ import { fallbackValues } from "./HighlightTabRow.theme";
5
+ import { themeComponent } from "../../../util/themeUtils";
4
6
  import { Reel, Box } from "../../atoms/layouts";
5
7
  import Text from "../../atoms/text";
6
8
  import { FONT_WEIGHT_SEMIBOLD } from "../../../constants/style_constants";
7
9
 
10
+ // this component needs some fix'n
8
11
  const HighlightTabRow = ({ tabs, highlightIndex, themeValues, isMobile }) => {
9
12
  const itemsAfterIndex = tabs.slice(highlightIndex).length - 1;
10
13
  const itemsBeforeIndex = tabs.slice(0, highlightIndex).length;
@@ -59,4 +62,6 @@ const HighlightTabRow = ({ tabs, highlightIndex, themeValues, isMobile }) => {
59
62
  );
60
63
  };
61
64
 
62
- export default HighlightTabRow;
65
+ export default memo(
66
+ themeComponent(HighlightTabRow, "HighlightTabRow", fallbackValues)
67
+ );
@@ -0,0 +1,30 @@
1
+ import React from "react";
2
+ import { text, boolean, object } from "@storybook/addon-knobs";
3
+ import HighlightTabRow from "./HighlightTabRow";
4
+ import page from "../../../../.storybook/page";
5
+
6
+ const groupId = "props";
7
+
8
+ export const highlightTabRow = () => (
9
+ <HighlightTabRow
10
+ tabs={object(
11
+ "tabs",
12
+ [
13
+ "Payment Amount",
14
+ "Payment Method",
15
+ "Customer Information",
16
+ "Payment Confirmation"
17
+ ],
18
+ groupId
19
+ )}
20
+ highlightIndex={text("highlightIndex", "0", groupId)}
21
+ isMobile={boolean("isMobile", false, groupId)}
22
+ />
23
+ );
24
+
25
+ const story = page({
26
+ title: "Components|Molecules/HighlightTabRow",
27
+ Component: HighlightTabRow,
28
+ containerMax: "80rem"
29
+ });
30
+ export default story;
@@ -1,8 +1,3 @@
1
- import { memo } from "react";
2
1
  import HighlightTabRow from "./HighlightTabRow";
3
- import { themeComponent } from "../../../util/themeUtils";
4
- import { fallbackValues } from "./HighlightTabRow.theme";
5
2
 
6
- export default memo(
7
- themeComponent(HighlightTabRow, "HighlightTabRow", fallbackValues)
8
- );
3
+ export default HighlightTabRow;
@@ -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 LoginForm from "./LoginForm";
6
+ import page from "../../../../.storybook/page";
7
+ import * as LoginFormState from "./LoginForm.state";
8
+
9
+ const story = page({
10
+ title: "Components|Molecules/LoginForm",
11
+ Component: LoginForm,
12
+ reducer: LoginFormState.reducer,
13
+ mapStateToProps: LoginFormState.mapStateToProps,
14
+ mapDispatchToProps: LoginFormState.mapDispatchToProps
15
+ });
16
+ export default story;
17
+
18
+ const ConnectedForm = connect(
19
+ LoginFormState.mapStateToProps,
20
+ LoginFormState.mapDispatchToProps
21
+ )(LoginForm);
22
+ export const loginForm = () => (
23
+ <ConnectedForm showErrors={boolean("showErrors", false, "props")} />
24
+ );