@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.
Files changed (76) hide show
  1. package/.storybook/page.js +5 -4
  2. package/README.md +9 -8
  3. package/dist/index.cjs.js +118 -110
  4. package/package.json +5 -5
  5. package/src/components/atoms/alert/Alert.stories.js +28 -0
  6. package/src/components/atoms/amount-callout/AmountCallout.stories.js +41 -0
  7. package/src/components/atoms/amount-callout/AmountCallout.theme.js +4 -4
  8. package/src/components/atoms/breadcrumb/Breadcrumb.stories.js +38 -0
  9. package/src/components/atoms/button-with-link/ButtonWithLink.js +2 -1
  10. package/src/components/atoms/button-with-link/ButtonWithLink.stories.js +32 -0
  11. package/src/components/atoms/checkbox/Checkbox.stories.js +29 -0
  12. package/src/components/atoms/checkbox-list/CheckboxList.stories.js +50 -0
  13. package/src/components/atoms/country-dropdown/CountryDropdown.stories.js +42 -0
  14. package/src/components/atoms/display-box/DisplayBox.stories.js +25 -0
  15. package/src/components/atoms/display-card/DisplayCard.js +2 -0
  16. package/src/components/atoms/display-card/DisplayCard.stories.js +24 -0
  17. package/src/components/atoms/form-layouts/FormLayouts.stories.js +72 -0
  18. package/src/components/atoms/form-select/FormSelect.stories.js +44 -0
  19. package/src/components/atoms/formatted-address/FormattedAddress.js +1 -3
  20. package/src/components/atoms/formatted-address/FormattedAddress.stories.js +32 -0
  21. package/src/components/atoms/hamburger-button/HamburgerButton.js +7 -1
  22. package/src/components/atoms/hamburger-button/HamburgerButton.stories.js +21 -0
  23. package/src/components/atoms/heading/Heading.stories.js +20 -0
  24. package/src/components/atoms/icons/icons.stories.js +50 -0
  25. package/src/components/atoms/labeled-amount/LabeledAmount.js +1 -1
  26. package/src/components/atoms/labeled-amount/LabeledAmount.stories.js +29 -0
  27. package/src/components/atoms/layouts/Cluster.js +2 -0
  28. package/src/components/atoms/layouts/Cluster.styled.js +1 -1
  29. package/src/components/atoms/layouts/examples/ResizingContainer.js +3 -1
  30. package/src/components/atoms/layouts/examples/ResizingContainer.styled.js +1 -1
  31. package/src/components/atoms/layouts/examples/box-example/BoxExample.stories.js +58 -0
  32. package/src/components/atoms/layouts/examples/center-example/CenterExample.stories.js +28 -0
  33. package/src/components/atoms/layouts/examples/cover-example/CoverExample.stories.js +53 -0
  34. package/src/components/atoms/layouts/examples/frame-example/FrameExample.stories.js +22 -0
  35. package/src/components/atoms/layouts/examples/imposter-example/ImposterExample.stories.js +35 -0
  36. package/src/components/atoms/layouts/examples/motion-example/MotionExample.stories.js +62 -0
  37. package/src/components/atoms/layouts/examples/reel-example/ReelExample.stories.js +57 -0
  38. package/src/components/atoms/line-item/LineItem.js +2 -2
  39. package/src/components/atoms/line-item/LineItem.stories.js +19 -0
  40. package/src/components/atoms/link/ExternalLink.js +1 -3
  41. package/src/components/atoms/link/InternalLink.styled.js +0 -2
  42. package/src/components/atoms/link/Link.stories.js +57 -0
  43. package/src/components/atoms/link/Link.theme.js +3 -2
  44. package/src/components/atoms/nav-footer/NavFooter.stories.js +31 -0
  45. package/src/components/atoms/nav-header/NavHeader.stories.js +29 -0
  46. package/src/components/atoms/paragraph/Paragraph.stories.js +34 -0
  47. package/src/components/atoms/paragraph/Paragraph.theme.js +6 -2
  48. package/src/components/atoms/password-requirements/PasswordRequirements.stories.js +75 -0
  49. package/src/components/atoms/placeholder/Placeholder.js +16 -16
  50. package/src/components/atoms/placeholder/Placeholder.stories.js +38 -0
  51. package/src/components/atoms/processing-fee/ProcessingFee.stories.js +28 -0
  52. package/src/components/atoms/solid-divider/SolidDivider.stories.js +11 -0
  53. package/src/components/atoms/spinner/Spinner.stories.js +17 -0
  54. package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.stories.js +52 -0
  55. package/src/components/atoms/text/Text.stories.js +34 -0
  56. package/src/components/atoms/text/Text.theme.js +6 -2
  57. package/src/components/molecules/collapsible-section/CollapsibleSection.js +2 -1
  58. package/src/components/molecules/collapsible-section/CollapsibleSection.stories.js +68 -0
  59. package/src/components/molecules/highlight-tab-row/HighlightTabRow.js +8 -3
  60. package/src/components/molecules/highlight-tab-row/HighlightTabRow.stories.js +30 -0
  61. package/src/components/molecules/highlight-tab-row/index.js +1 -6
  62. package/src/components/molecules/modal/Modal.stories.js +44 -0
  63. package/src/components/molecules/module/Module.js +6 -2
  64. package/src/components/molecules/module/Module.stories.js +31 -0
  65. package/src/components/molecules/module/index.js +1 -6
  66. package/src/components/molecules/obligation/Obligation.js +1 -1
  67. package/src/components/molecules/obligation/modules/AmountModule.js +6 -2
  68. package/src/components/molecules/payment-button-bar/PaymentButtonBar.stories.js +20 -0
  69. package/src/components/molecules/payment-details/PaymentDetails.stories.js +71 -0
  70. package/src/components/molecules/payment-form-card/PaymentFormCard.js +0 -16
  71. package/src/components/molecules/radio-section/RadioSection.stories.js +31 -0
  72. package/src/components/molecules/tab-sidebar/TabSidebar.stories.js +59 -0
  73. package/src/components/molecules/terms-and-conditions/TermsAndConditions.stories.js +24 -0
  74. package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.stories.js +31 -0
  75. package/src/components/molecules/workflow-tile/WorkflowTile.stories.js +25 -0
  76. package/.tool-versions +0 -1
@@ -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,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,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;
@@ -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;
package/.tool-versions DELETED
@@ -1 +0,0 @@
1
- nodejs 10.13.0