@thecb/components 9.6.0-beta.2 → 10.0.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.
Files changed (33) hide show
  1. package/dist/index.cjs.js +3259 -3116
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.d.ts +3 -1
  4. package/dist/index.esm.js +3259 -3117
  5. package/dist/index.esm.js.map +1 -1
  6. package/package.json +1 -1
  7. package/src/components/atoms/button-with-action/ButtonWithAction.js +2 -4
  8. package/src/components/atoms/icons/MultiCartIcon.d.ts +1 -0
  9. package/src/components/atoms/icons/MultiCartIcon.js +26 -0
  10. package/src/components/atoms/icons/icons.stories.js +3 -1
  11. package/src/components/atoms/icons/index.d.ts +1 -0
  12. package/src/components/atoms/icons/index.js +3 -1
  13. package/src/components/atoms/jumbo/Jumbo.js +7 -1
  14. package/src/components/atoms/labeled-amount/LabeledAmount.js +7 -32
  15. package/src/components/atoms/labeled-amount/LabeledAmount.stories.js +13 -0
  16. package/src/components/atoms/labeled-amount/LabeledAmount.theme.js +7 -1
  17. package/src/components/atoms/labeled-amount/LabeledAmountV1.js +37 -0
  18. package/src/components/atoms/labeled-amount/LabeledAmountV2.js +34 -0
  19. package/src/components/atoms/line-item/LineItem.js +21 -35
  20. package/src/components/atoms/line-item/LineItem.theme.js +2 -2
  21. package/src/components/atoms/searchable-select/SearchableSelect.js +15 -7
  22. package/src/components/atoms/searchable-select/SearchableSelect.stories.js +5 -4
  23. package/src/components/molecules/editable-list/EditableList.js +3 -1
  24. package/src/components/molecules/editable-list/EditableList.stories.js +31 -0
  25. package/src/components/molecules/modal/Modal.js +3 -3
  26. package/src/components/molecules/partial-amount-form/PartialAmountForm.js +8 -2
  27. package/src/components/molecules/payment-details/PaymentDetails.js +14 -13
  28. package/src/components/molecules/payment-details/PaymentDetails.stories.js +36 -0
  29. package/src/components/molecules/payment-details/PaymentDetails.theme.js +2 -2
  30. package/src/components/molecules/radio-section/InnerRadioSection.js +210 -0
  31. package/src/components/molecules/radio-section/RadioSection.js +87 -210
  32. package/src/components/molecules/radio-section/RadioSection.stories.js +92 -15
  33. package/src/components/molecules/radio-section/RadioSection.theme.js +2 -2
@@ -1,8 +1,9 @@
1
1
  import React, { useState } from "react";
2
- import { text, boolean } from "@storybook/addon-knobs";
2
+ import { boolean } from "@storybook/addon-knobs";
3
3
 
4
4
  import RadioSection from "./RadioSection";
5
5
  import page from "../../../../.storybook/page";
6
+ import { Box } from "../../atoms/layouts";
6
7
 
7
8
  const story = page({
8
9
  title: "Components|Molecules/RadioSection",
@@ -43,30 +44,106 @@ const cardIconsLabel = `Accepting ${cardIcons
43
44
  ? ` and ${cardIcon.altText}.`
44
45
  : ` ` + cardIcon.altText
45
46
  )}`;
47
+ const groupedSections = [
48
+ [
49
+ {
50
+ id: "new-card-section",
51
+ title: "Group 1: New Card",
52
+ content: <p>The form to add a credit card would go here.</p>,
53
+ rightIconsLabel: cardIconsLabel,
54
+ rightIcons: cardIcons,
55
+ required: true,
56
+ dataQa: "New Card"
57
+ },
58
+ {
59
+ id: "new-bank-section",
60
+ title: "Group 1: New Bank Account",
61
+ content: <p>The form to add a credit card would go here.</p>,
62
+ required: true
63
+ },
64
+
65
+ {
66
+ id: "bar4",
67
+ title: "Group 1: Another One",
68
+ content: <div>Content for another section</div>,
69
+ required: true
70
+ }
71
+ ],
72
+ [
73
+ {
74
+ id: "bar",
75
+ title: "Group 2: Bar",
76
+ content: <div>Content 1</div>,
77
+ required: true
78
+ }
79
+ ],
80
+ [
81
+ {
82
+ id: "bar2",
83
+ title: "Group 3: Bar",
84
+ content: <div>Content 1</div>,
85
+ required: true
86
+ },
87
+ {
88
+ id: "baz",
89
+ title: "Group 3: Baz",
90
+ content: <div>Content 1</div>,
91
+ required: true
92
+ }
93
+ ]
94
+ ];
46
95
  const sections = [
47
96
  {
48
- id: "new-card-section",
49
- title: "New Card",
50
- content: <p>The form to add a credit card would go here.</p>,
97
+ id: "new-card-section-2",
98
+ title: "Section 1: New Card",
99
+ content: <Box>The form to add a credit card would go here.</Box>,
51
100
  rightIconsLabel: cardIconsLabel,
52
101
  rightIcons: cardIcons,
53
102
  required: true
54
103
  },
55
- { id: "bar", title: "Bar", content: <div>Content 1</div>, required: true },
56
- { id: "baz", title: "Baz", content: <div>Content 2</div> }
104
+ {
105
+ id: "bar3",
106
+ title: "Section 1: Bar",
107
+ content: <div>Content 1</div>,
108
+ required: true
109
+ },
110
+ { id: "baz2", title: "Section 1: Baz", content: <div>Content 2</div> }
57
111
  ];
58
112
 
59
113
  export const radioSection = () => {
60
114
  const [openSection, setOpenSection] = useState("");
115
+ const [openGroupedSection, setOpenGroupedSection] = useState("");
61
116
  return (
62
- <RadioSection
63
- isMobile={boolean("isMobile", false, "props")}
64
- supportsTouch={boolean("isMobile", false, "props")}
65
- toggleOpenSection={setOpenSection}
66
- openSection={openSection}
67
- staggeredAnimation={boolean("staggeredAnimation", false, "props")}
68
- sections={sections}
69
- isSectionRequired={true}
70
- />
117
+ <>
118
+ <Box padding="0 1rem" extraStyles="text-align: center;">
119
+ <p>
120
+ Using <b>sections</b>
121
+ </p>
122
+ </Box>
123
+ <RadioSection
124
+ isMobile={boolean("isMobile", false, "props")}
125
+ supportsTouch={boolean("isMobile", false, "props")}
126
+ toggleOpenSection={setOpenSection}
127
+ openSection={openSection}
128
+ staggeredAnimation={boolean("staggeredAnimation", false, "props")}
129
+ sections={sections}
130
+ isSectionRequired={true}
131
+ />
132
+ <Box />
133
+ <Box padding="0 1rem" extraStyles="text-align: center;">
134
+ <p>
135
+ Using <b>groupedSections</b>
136
+ </p>
137
+ </Box>
138
+ <RadioSection
139
+ isMobile={boolean("isMobile", false, "props")}
140
+ supportsTouch={boolean("isMobile", false, "props")}
141
+ toggleOpenSection={setOpenGroupedSection}
142
+ openSection={openGroupedSection}
143
+ staggeredAnimation={boolean("staggeredAnimation", false, "props")}
144
+ groupedSections={groupedSections}
145
+ isSectionRequired={true}
146
+ />
147
+ </>
71
148
  );
72
149
  };
@@ -1,9 +1,9 @@
1
- import { WHITE, GREY_CHATEAU, ATHENS_GREY } from "../../../constants/colors";
1
+ import { WHITE, GHOST_GREY, ATHENS_GREY } from "../../../constants/colors";
2
2
 
3
3
  const headingBackgroundColor = `${WHITE}`;
4
4
  const headingDisabledColor = `${ATHENS_GREY}`;
5
5
  const bodyBackgroundColor = "#eeeeee";
6
- const borderColor = `${GREY_CHATEAU}`;
6
+ const borderColor = `${GHOST_GREY}`;
7
7
  const focusStyles = `outline: none;`;
8
8
 
9
9
  export const fallbackValues = {