@thecb/components 9.5.2-beta.0 → 9.5.2
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/dist/index.cjs.js +3254 -3110
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.esm.js +3254 -3111
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/icons/MultiCartIcon.d.ts +1 -0
- package/src/components/atoms/icons/MultiCartIcon.js +26 -0
- package/src/components/atoms/icons/icons.stories.js +3 -1
- package/src/components/atoms/icons/index.d.ts +1 -0
- package/src/components/atoms/icons/index.js +3 -1
- package/src/components/atoms/jumbo/Jumbo.js +7 -1
- package/src/components/atoms/labeled-amount/LabeledAmount.js +7 -32
- package/src/components/atoms/labeled-amount/LabeledAmount.stories.js +13 -0
- package/src/components/atoms/labeled-amount/LabeledAmount.theme.js +7 -1
- package/src/components/atoms/labeled-amount/LabeledAmountV1.js +37 -0
- package/src/components/atoms/labeled-amount/LabeledAmountV2.js +34 -0
- package/src/components/atoms/line-item/LineItem.js +21 -35
- package/src/components/atoms/line-item/LineItem.theme.js +2 -2
- package/src/components/atoms/searchable-select/SearchableSelect.js +15 -7
- package/src/components/atoms/searchable-select/SearchableSelect.stories.js +5 -4
- package/src/components/molecules/modal/Modal.js +3 -3
- package/src/components/molecules/partial-amount-form/PartialAmountForm.js +8 -2
- package/src/components/molecules/payment-details/PaymentDetails.js +14 -13
- package/src/components/molecules/payment-details/PaymentDetails.stories.js +36 -0
- package/src/components/molecules/payment-details/PaymentDetails.theme.js +2 -2
- package/src/components/molecules/radio-section/InnerRadioSection.js +210 -0
- package/src/components/molecules/radio-section/RadioSection.js +87 -210
- package/src/components/molecules/radio-section/RadioSection.stories.js +92 -15
- package/src/components/molecules/radio-section/RadioSection.theme.js +2 -2
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const MultiCartIcon: JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
const MultiCartIcon = ({ iconFill = "#3B5BDB", isMobile = true }) => {
|
|
4
|
+
const iconWidth = isMobile ? "20" : "25";
|
|
5
|
+
const iconHeight = isMobile ? "17" : "23";
|
|
6
|
+
return (
|
|
7
|
+
<svg
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
width={iconWidth}
|
|
10
|
+
height={iconHeight}
|
|
11
|
+
viewBox={`0 0 ${iconWidth} ${iconHeight}`}
|
|
12
|
+
fill="none"
|
|
13
|
+
>
|
|
14
|
+
<path
|
|
15
|
+
d={
|
|
16
|
+
isMobile
|
|
17
|
+
? "M17.5312 9.99414C17.4648 10.1934 17.3652 10.3594 17.2324 10.459C17.0996 10.5918 16.9336 10.625 16.7676 10.625H7.03906L7.23828 11.6875H16.1699C16.4023 11.6875 16.6016 11.7871 16.7676 11.9863C16.9004 12.1855 16.9668 12.418 16.9336 12.6504L16.7344 13.4805C17.0664 13.6465 17.2988 13.8789 17.498 14.1777C17.6973 14.4766 17.7969 14.8086 17.7969 15.1406C17.7969 15.6719 17.5977 16.1035 17.2324 16.4688C16.8672 16.834 16.4355 17 15.9375 17C15.4062 17 14.9746 16.834 14.6094 16.4688C14.2441 16.1035 14.0781 15.6719 14.0781 15.1406C14.0781 14.6094 14.2441 14.1777 14.6426 13.8125H7.66992C8.03516 14.1777 8.23438 14.6094 8.23438 15.1406C8.23438 15.6719 8.03516 16.1035 7.66992 16.4688C7.30469 16.834 6.87305 17 6.375 17C5.84375 17 5.41211 16.834 5.04688 16.4688C4.68164 16.1035 4.51562 15.6719 4.51562 15.1406C4.51562 14.8086 4.58203 14.5098 4.74805 14.2109C4.91406 13.9453 5.14648 13.7129 5.44531 13.5137L3.12109 2.125H0.796875C0.564453 2.125 0.365234 2.05859 0.232422 1.89258C0.0664062 1.75977 0 1.56055 0 1.32812V0.796875C0 0.597656 0.0664062 0.398438 0.232422 0.232422C0.365234 0.0996094 0.564453 0 0.796875 0H4.2168C4.38281 0 4.54883 0.0664062 4.68164 0.199219C4.81445 0.332031 4.91406 0.464844 4.98047 0.630859L5.2793 2.125H18.3281C18.5938 2.125 18.793 2.22461 18.959 2.42383C19.0918 2.62305 19.1582 2.85547 19.0918 3.08789L17.5312 9.99414Z"
|
|
18
|
+
: "M22.6875 13.4336C22.6016 13.6914 22.4727 13.9062 22.3008 14.0352C22.1289 14.207 21.9141 14.25 21.6992 14.25H9.10938L9.36719 15.625H20.9258C21.2266 15.625 21.4844 15.7539 21.6992 16.0117C21.8711 16.2695 21.957 16.5703 21.9141 16.8711L21.6562 17.9453C22.0859 18.1602 22.3867 18.4609 22.6445 18.8477C22.9023 19.2344 23.0312 19.6641 23.0312 20.0938C23.0312 20.7812 22.7734 21.3398 22.3008 21.8125C21.8281 22.2852 21.2695 22.5 20.625 22.5C19.9375 22.5 19.3789 22.2852 18.9062 21.8125C18.4336 21.3398 18.2188 20.7812 18.2188 20.0938C18.2188 19.4062 18.4336 18.8477 18.9492 18.375H9.92578C10.3984 18.8477 10.6562 19.4062 10.6562 20.0938C10.6562 20.7812 10.3984 21.3398 9.92578 21.8125C9.45312 22.2852 8.89453 22.5 8.25 22.5C7.5625 22.5 7.00391 22.2852 6.53125 21.8125C6.05859 21.3398 5.84375 20.7812 5.84375 20.0938C5.84375 19.6641 5.92969 19.2773 6.14453 18.8906C6.35938 18.5469 6.66016 18.2461 7.04688 17.9883L4.03906 3.25H1.03125C0.730469 3.25 0.472656 3.16406 0.300781 2.94922C0.0859375 2.77734 0 2.51953 0 2.21875V1.53125C0 1.27344 0.0859375 1.01562 0.300781 0.800781C0.472656 0.628906 0.730469 0.5 1.03125 0.5H5.45703C5.67188 0.5 5.88672 0.585938 6.05859 0.757812C6.23047 0.929688 6.35938 1.10156 6.44531 1.31641L6.83203 3.25H23.7188C24.0625 3.25 24.3203 3.37891 24.5352 3.63672C24.707 3.89453 24.793 4.19531 24.707 4.49609L22.6875 13.4336Z"
|
|
19
|
+
}
|
|
20
|
+
fill={iconFill}
|
|
21
|
+
/>
|
|
22
|
+
</svg>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default MultiCartIcon;
|
|
@@ -39,7 +39,8 @@ import {
|
|
|
39
39
|
VoidedIcon,
|
|
40
40
|
StatusUnknownIcon,
|
|
41
41
|
AutopayIcon,
|
|
42
|
-
KebabMenuIcon
|
|
42
|
+
KebabMenuIcon,
|
|
43
|
+
MultiCartIcon
|
|
43
44
|
} from "./index";
|
|
44
45
|
|
|
45
46
|
const story = page({
|
|
@@ -86,3 +87,4 @@ export const voidedIcon = () => <VoidedIcon />;
|
|
|
86
87
|
export const statusUnknownIcon = () => <StatusUnknownIcon />;
|
|
87
88
|
export const autopayIcon = () => <AutopayIcon />;
|
|
88
89
|
export const kebabMenuIcon = () => <KebabMenuIcon />;
|
|
90
|
+
export const multiCartIcon = () => <MultiCartIcon />;
|
|
@@ -87,6 +87,7 @@ import ChargebackIconMedium from "./ChargebackIconMedium";
|
|
|
87
87
|
import ChargebackReversalIconMedium from "./ChargebackReversalIconMedium";
|
|
88
88
|
import PlusCircleIcon from "./PlusCircleIcon";
|
|
89
89
|
import KebabMenuIcon from "./KebabMenuIcon";
|
|
90
|
+
import MultiCartIcon from "./MultiCartIcon";
|
|
90
91
|
|
|
91
92
|
export {
|
|
92
93
|
AccountsIcon,
|
|
@@ -177,5 +178,6 @@ export {
|
|
|
177
178
|
ChargebackIconMedium,
|
|
178
179
|
ChargebackReversalIconMedium,
|
|
179
180
|
PlusCircleIcon,
|
|
180
|
-
KebabMenuIcon
|
|
181
|
+
KebabMenuIcon,
|
|
182
|
+
MultiCartIcon
|
|
181
183
|
};
|
|
@@ -20,7 +20,10 @@ const Jumbo = ({
|
|
|
20
20
|
total,
|
|
21
21
|
itemsCount,
|
|
22
22
|
showCartStatus = false,
|
|
23
|
-
openCartSlider
|
|
23
|
+
openCartSlider,
|
|
24
|
+
extraStyles,
|
|
25
|
+
cartStatusExtraStyles,
|
|
26
|
+
cartStatusThemeValues
|
|
24
27
|
}) => {
|
|
25
28
|
const { isMobile } = useContext(ThemeContext);
|
|
26
29
|
return (
|
|
@@ -29,6 +32,7 @@ const Jumbo = ({
|
|
|
29
32
|
minHeight="65px"
|
|
30
33
|
id={`heroImage-${slug}`}
|
|
31
34
|
className="themeJumboBackground"
|
|
35
|
+
extraStyles={extraStyles}
|
|
32
36
|
>
|
|
33
37
|
<Center maxWidth="76.5rem">
|
|
34
38
|
<Cover singleChild minHeight="65px">
|
|
@@ -49,6 +53,7 @@ const Jumbo = ({
|
|
|
49
53
|
}
|
|
50
54
|
align="center"
|
|
51
55
|
nowrap={showCartStatus}
|
|
56
|
+
extraStyles={cartStatusExtraStyles}
|
|
52
57
|
>
|
|
53
58
|
<Title
|
|
54
59
|
variant={isMobile ? "small" : "large"}
|
|
@@ -78,6 +83,7 @@ const Jumbo = ({
|
|
|
78
83
|
)}
|
|
79
84
|
{showCartStatus && (
|
|
80
85
|
<CartStatus
|
|
86
|
+
themeValues={cartStatusThemeValues}
|
|
81
87
|
total={total}
|
|
82
88
|
itemsCount={itemsCount}
|
|
83
89
|
openCart={openCartSlider}
|
|
@@ -1,39 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { fallbackValues } from "./LabeledAmount.theme";
|
|
3
3
|
import { themeComponent } from "../../../util/themeUtils";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import Paragraph from "../paragraph";
|
|
4
|
+
import LabeledAmountV1 from "./LabeledAmountV1";
|
|
5
|
+
import LabeledAmountV2 from "./LabeledAmountV2";
|
|
7
6
|
|
|
8
|
-
const LabeledAmount = ({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
as,
|
|
14
|
-
extraStyles
|
|
15
|
-
}) => {
|
|
16
|
-
const LabeledAmountText = variant === "h6" ? Heading : Paragraph;
|
|
17
|
-
return (
|
|
18
|
-
<Stack direction="row">
|
|
19
|
-
<LabeledAmountText
|
|
20
|
-
variant={variant}
|
|
21
|
-
as={as}
|
|
22
|
-
weight={themeValues.fontWeight}
|
|
23
|
-
extraStyles={`${extraStyles}; text-align: start; flex: 3;`}
|
|
24
|
-
>
|
|
25
|
-
{label}:
|
|
26
|
-
</LabeledAmountText>
|
|
27
|
-
<LabeledAmountText
|
|
28
|
-
variant={variant}
|
|
29
|
-
as={as}
|
|
30
|
-
weight={themeValues.fontWeight}
|
|
31
|
-
extraStyles={`${extraStyles}; text-align: end; flex: 1;`}
|
|
32
|
-
>
|
|
33
|
-
{amount}
|
|
34
|
-
</LabeledAmountText>
|
|
35
|
-
</Stack>
|
|
36
|
-
);
|
|
7
|
+
const LabeledAmount = ({ version = "v1", ...rest }) => {
|
|
8
|
+
const LabeledAmountComponent =
|
|
9
|
+
version === "v1" ? LabeledAmountV1 : LabeledAmountV2;
|
|
10
|
+
|
|
11
|
+
return <LabeledAmountComponent {...rest} />;
|
|
37
12
|
};
|
|
38
13
|
|
|
39
14
|
export default themeComponent(
|
|
@@ -9,16 +9,29 @@ const variants = {
|
|
|
9
9
|
p: "p",
|
|
10
10
|
pL: "pL",
|
|
11
11
|
h6: "h6",
|
|
12
|
+
small: "small",
|
|
13
|
+
regular: "regular",
|
|
14
|
+
large: "large",
|
|
12
15
|
None: undefined
|
|
13
16
|
};
|
|
14
17
|
const defaultValue = "default";
|
|
18
|
+
|
|
19
|
+
const versionsLabel = "version";
|
|
20
|
+
const versions = {
|
|
21
|
+
v1: "v1",
|
|
22
|
+
v2: "v2"
|
|
23
|
+
};
|
|
24
|
+
const defaultVersion = "v1";
|
|
25
|
+
|
|
15
26
|
const groupId = "props";
|
|
16
27
|
|
|
17
28
|
export const labeledAmount = () => (
|
|
18
29
|
<LabeledAmount
|
|
19
30
|
variant={select(variantsLabel, variants, defaultValue, groupId)}
|
|
31
|
+
as={text("as", "p", groupId)}
|
|
20
32
|
label={text("label", "Amount", groupId)}
|
|
21
33
|
amount={text("amount", "$1.23", groupId)}
|
|
34
|
+
version={select(versionsLabel, versions, defaultVersion, groupId)}
|
|
22
35
|
/>
|
|
23
36
|
);
|
|
24
37
|
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
const fontWeight = {
|
|
2
|
+
// v1 variants
|
|
2
3
|
default: "600",
|
|
3
4
|
pS: "600",
|
|
4
5
|
p: "600",
|
|
5
6
|
pL: "600",
|
|
6
|
-
h6: "700"
|
|
7
|
+
h6: "700",
|
|
8
|
+
// v2 variants
|
|
9
|
+
regular: "600", // fontsize Detail large
|
|
10
|
+
extraSmall: "600", //fontsize Detail small
|
|
11
|
+
small: "600", // fontsize Detail regular
|
|
12
|
+
large: "700" // fontsize Title small
|
|
7
13
|
};
|
|
8
14
|
|
|
9
15
|
export const fallbackValues = {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Stack } from "../layouts";
|
|
3
|
+
import Heading from "../heading";
|
|
4
|
+
import Paragraph from "../paragraph";
|
|
5
|
+
|
|
6
|
+
const LabeledAmountV1 = ({
|
|
7
|
+
variant = "pL",
|
|
8
|
+
label,
|
|
9
|
+
amount,
|
|
10
|
+
themeValues,
|
|
11
|
+
as,
|
|
12
|
+
extraStyles
|
|
13
|
+
}) => {
|
|
14
|
+
const LabeledAmountText = variant === "h6" ? Heading : Paragraph;
|
|
15
|
+
return (
|
|
16
|
+
<Stack direction="row">
|
|
17
|
+
<LabeledAmountText
|
|
18
|
+
variant={variant}
|
|
19
|
+
as={as}
|
|
20
|
+
weight={themeValues.fontWeight}
|
|
21
|
+
extraStyles={`${extraStyles}; text-align: start; flex: 3;`}
|
|
22
|
+
>
|
|
23
|
+
{label}:
|
|
24
|
+
</LabeledAmountText>
|
|
25
|
+
<LabeledAmountText
|
|
26
|
+
variant={variant}
|
|
27
|
+
as={as}
|
|
28
|
+
weight={themeValues.fontWeight}
|
|
29
|
+
extraStyles={`${extraStyles}; text-align: end; flex: 1;`}
|
|
30
|
+
>
|
|
31
|
+
{amount}
|
|
32
|
+
</LabeledAmountText>
|
|
33
|
+
</Stack>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default LabeledAmountV1;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Detail from "../detail";
|
|
3
|
+
import Title from "../title";
|
|
4
|
+
|
|
5
|
+
const LabeledAmountV2 = ({
|
|
6
|
+
variant = "regular",
|
|
7
|
+
label,
|
|
8
|
+
amount,
|
|
9
|
+
themeValues,
|
|
10
|
+
as,
|
|
11
|
+
extraStyles
|
|
12
|
+
}) => {
|
|
13
|
+
const mappedDetailVariants = {
|
|
14
|
+
regular: "large",
|
|
15
|
+
small: "regular",
|
|
16
|
+
extraSmall: "small"
|
|
17
|
+
};
|
|
18
|
+
const LabeledAmountContainer = variant === "large" ? Title : Detail;
|
|
19
|
+
const containerVariant =
|
|
20
|
+
variant === "large" ? "small" : mappedDetailVariants[variant];
|
|
21
|
+
return (
|
|
22
|
+
<LabeledAmountContainer
|
|
23
|
+
variant={containerVariant}
|
|
24
|
+
as={as}
|
|
25
|
+
weight={themeValues.fontWeight}
|
|
26
|
+
extraStyles={`display: flex; justify-content: space-between; ${extraStyles}`}
|
|
27
|
+
>
|
|
28
|
+
<span>{label}</span>
|
|
29
|
+
<span>{amount}</span>
|
|
30
|
+
</LabeledAmountContainer>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default LabeledAmountV2;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import { Stack } from "../layouts";
|
|
3
|
+
import Detail from "../detail";
|
|
4
4
|
import { themeComponent } from "../../../util/themeUtils";
|
|
5
5
|
import { fallbackValues } from "./LineItem.theme";
|
|
6
6
|
import { STORM_GREY } from "../../../constants/colors";
|
|
@@ -28,43 +28,29 @@ const LineItem = ({
|
|
|
28
28
|
attr => visibleFields?.includes(attr.key) && attr.key !== "description"
|
|
29
29
|
)
|
|
30
30
|
?.map(attr => (
|
|
31
|
-
<
|
|
31
|
+
<Detail variant="small" weight="400" key={attr.key} color={STORM_GREY}>
|
|
32
32
|
{`${formatAttrKeys(attr.key)}: ${attr.value}`}
|
|
33
|
-
</
|
|
33
|
+
</Detail>
|
|
34
34
|
));
|
|
35
|
-
|
|
36
35
|
return (
|
|
37
|
-
<
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
{description}
|
|
44
|
-
</Paragraph>
|
|
45
|
-
<Paragraph variant={themeValues.paragraphVariant} weight="400">
|
|
46
|
-
{subDescription}
|
|
47
|
-
</Paragraph>
|
|
48
|
-
{visibleCustomAttrs && (
|
|
49
|
-
<Stack childGap="0.25rem">{visibleCustomAttrs}</Stack>
|
|
50
|
-
)}
|
|
51
|
-
</Stack>
|
|
52
|
-
{!!displayQuantity && (
|
|
53
|
-
<Paragraph
|
|
54
|
-
variant={themeValues.paragraphVariant}
|
|
55
|
-
weight={themeValues.weightTitle}
|
|
56
|
-
>
|
|
57
|
-
{`x${displayQuantity}`}
|
|
58
|
-
</Paragraph>
|
|
59
|
-
)}
|
|
60
|
-
<Paragraph
|
|
61
|
-
variant={themeValues.paragraphVariant}
|
|
62
|
-
weight="600"
|
|
63
|
-
extraStyles="margin: 0; text-align: end; min-width: fit-content; padding-left: 32px;"
|
|
36
|
+
<Stack childGap="0px">
|
|
37
|
+
<Detail
|
|
38
|
+
as="h3"
|
|
39
|
+
variant={themeValues.detailVariant}
|
|
40
|
+
weight={themeValues.weightTitle}
|
|
41
|
+
extraStyles={`display: flex; justify-content: space-between;`}
|
|
64
42
|
>
|
|
65
|
-
{
|
|
66
|
-
|
|
67
|
-
|
|
43
|
+
<span>{description}</span>
|
|
44
|
+
<span>{!!displayQuantity && `x${displayQuantity}`}</span>
|
|
45
|
+
<span>{amount}</span>
|
|
46
|
+
</Detail>
|
|
47
|
+
<Detail as="p" variant={themeValues.detailVariant} weight="400">
|
|
48
|
+
{subDescription}
|
|
49
|
+
</Detail>
|
|
50
|
+
{visibleCustomAttrs && (
|
|
51
|
+
<Stack childGap="0.25rem">{visibleCustomAttrs}</Stack>
|
|
52
|
+
)}
|
|
53
|
+
</Stack>
|
|
68
54
|
);
|
|
69
55
|
};
|
|
70
56
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const weightTitle = { default: "600", small: "400" };
|
|
2
|
-
const
|
|
2
|
+
const detailVariant = { default: "large", small: "small" };
|
|
3
3
|
|
|
4
4
|
export const fallbackValues = {
|
|
5
5
|
weightTitle,
|
|
6
|
-
|
|
6
|
+
detailVariant
|
|
7
7
|
};
|
|
@@ -5,7 +5,7 @@ import { Box, Stack } from "../layouts";
|
|
|
5
5
|
import { FormInput } from "../form-layouts";
|
|
6
6
|
import Checkbox from "../checkbox";
|
|
7
7
|
|
|
8
|
-
const SELECT_ALL = "Select All";
|
|
8
|
+
export const SELECT_ALL = "Select All";
|
|
9
9
|
|
|
10
10
|
const SearchableSelect = ({
|
|
11
11
|
autocompleteValue,
|
|
@@ -21,6 +21,13 @@ const SearchableSelect = ({
|
|
|
21
21
|
placeholder = "Search agencies"
|
|
22
22
|
}) => {
|
|
23
23
|
const [itemList, setItemList] = useState([]);
|
|
24
|
+
const completeOptionsList = itemList.sort((a, b) =>
|
|
25
|
+
a.name == SELECT_ALL
|
|
26
|
+
? -1
|
|
27
|
+
: b.name === SELECT_ALL
|
|
28
|
+
? 1
|
|
29
|
+
: a.name.toLowerCase().localeCompare(b.name.toLowerCase())
|
|
30
|
+
);
|
|
24
31
|
useEffect(() => setItemList(items), [items, selectedItems]);
|
|
25
32
|
useEffect(() => {
|
|
26
33
|
const filteredItems = items.filter(item =>
|
|
@@ -38,6 +45,7 @@ const SearchableSelect = ({
|
|
|
38
45
|
selectItem(value);
|
|
39
46
|
}
|
|
40
47
|
};
|
|
48
|
+
|
|
41
49
|
return (
|
|
42
50
|
<Box
|
|
43
51
|
padding="1rem"
|
|
@@ -60,15 +68,15 @@ const SearchableSelect = ({
|
|
|
60
68
|
extraStyles={`overflow-y: scroll; max-height: 250px;`}
|
|
61
69
|
>
|
|
62
70
|
<Stack>
|
|
63
|
-
{
|
|
71
|
+
{completeOptionsList.map(option => (
|
|
64
72
|
<Checkbox
|
|
65
|
-
key={
|
|
66
|
-
title={
|
|
67
|
-
name={
|
|
73
|
+
key={option.name}
|
|
74
|
+
title={option.name}
|
|
75
|
+
name={option.name}
|
|
68
76
|
checked={
|
|
69
|
-
selectedItems?.find(item => item?.name ===
|
|
77
|
+
!!selectedItems?.find(item => item?.name === option?.name)
|
|
70
78
|
}
|
|
71
|
-
onChange={() => handleSelect(
|
|
79
|
+
onChange={() => handleSelect(option)}
|
|
72
80
|
textExtraStyles={`margin: 0;`}
|
|
73
81
|
disabled={disabled}
|
|
74
82
|
extraStyles={`margin: 0.5rem;`}
|
|
@@ -3,7 +3,7 @@ import { connect } from "react-redux";
|
|
|
3
3
|
import { text } from "@storybook/addon-knobs";
|
|
4
4
|
import { createFormState } from "redux-freeform";
|
|
5
5
|
|
|
6
|
-
import SearchableSelect from "./SearchableSelect";
|
|
6
|
+
import SearchableSelect, { SELECT_ALL } from "./SearchableSelect";
|
|
7
7
|
import page from "../../../../.storybook/page";
|
|
8
8
|
|
|
9
9
|
const { mapStateToProps, mapDispatchToProps, reducer } = createFormState({
|
|
@@ -14,8 +14,9 @@ const { mapStateToProps, mapDispatchToProps, reducer } = createFormState({
|
|
|
14
14
|
|
|
15
15
|
const items = [
|
|
16
16
|
{ name: "Foo", value: "foo-value" },
|
|
17
|
-
{ name: "
|
|
18
|
-
{ name:
|
|
17
|
+
{ name: "Baz", value: "baz-value" },
|
|
18
|
+
{ name: SELECT_ALL, value: SELECT_ALL },
|
|
19
|
+
{ name: "Bar", value: "bar-value" }
|
|
19
20
|
];
|
|
20
21
|
|
|
21
22
|
const FormWrapper = props => {
|
|
@@ -41,7 +42,7 @@ const FormWrapper = props => {
|
|
|
41
42
|
fields={props.fields}
|
|
42
43
|
actions={props.actions}
|
|
43
44
|
selectedItems={selectedItems}
|
|
44
|
-
selectItem={selectItem}
|
|
45
|
+
selectItem={item => selectItem(item)}
|
|
45
46
|
/>
|
|
46
47
|
);
|
|
47
48
|
};
|
|
@@ -4,7 +4,7 @@ import AriaModal from "react-aria-modal";
|
|
|
4
4
|
import { WHITE, ATHENS_GREY, SILVER_GREY } from "../../../constants/colors";
|
|
5
5
|
import { FONT_WEIGHT_SEMIBOLD } from "../../../constants/style_constants";
|
|
6
6
|
import Paragraph from "../../atoms/paragraph";
|
|
7
|
-
import
|
|
7
|
+
import Title from "../../atoms/title";
|
|
8
8
|
import ButtonWithAction from "../../atoms/button-with-action";
|
|
9
9
|
import { Box, Stack, Cluster } from "../../atoms/layouts";
|
|
10
10
|
|
|
@@ -84,9 +84,9 @@ const Modal = ({
|
|
|
84
84
|
>
|
|
85
85
|
<Box background={modalHeaderBg} padding="1.5rem">
|
|
86
86
|
<Cluster justify="flex-start" align="center">
|
|
87
|
-
<
|
|
87
|
+
<Title as="h2" weight={FONT_WEIGHT_SEMIBOLD} fontSize="1.25rem">
|
|
88
88
|
{modalHeaderText}
|
|
89
|
-
</
|
|
89
|
+
</Title>
|
|
90
90
|
</Cluster>
|
|
91
91
|
</Box>
|
|
92
92
|
<Box background={modalBodyBg} padding="1.5rem">
|
|
@@ -22,7 +22,8 @@ const PartialAmountForm = ({
|
|
|
22
22
|
clearOnDismount,
|
|
23
23
|
fields,
|
|
24
24
|
actions,
|
|
25
|
-
showErrors = false
|
|
25
|
+
showErrors = false,
|
|
26
|
+
dataQa
|
|
26
27
|
}) => {
|
|
27
28
|
if (clearOnDismount) {
|
|
28
29
|
useEffect(() => () => actions.form.clear(), []);
|
|
@@ -54,7 +55,12 @@ const PartialAmountForm = ({
|
|
|
54
55
|
|
|
55
56
|
const lineItemsNew = Array.isArray(lineItems) ? lineItems : [];
|
|
56
57
|
return (
|
|
57
|
-
<FormContainer
|
|
58
|
+
<FormContainer
|
|
59
|
+
variant={variant}
|
|
60
|
+
role="form"
|
|
61
|
+
aria-label="Other amount"
|
|
62
|
+
data-qa={dataQa}
|
|
63
|
+
>
|
|
58
64
|
<Text variant="p">
|
|
59
65
|
Pay a different amount. The total balance will still be due on the same
|
|
60
66
|
due date.
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import React, { useState, Fragment } from "react";
|
|
2
|
-
import {
|
|
3
|
-
Stack,
|
|
4
|
-
Cluster,
|
|
5
|
-
Box,
|
|
6
|
-
Motion,
|
|
7
|
-
Cover,
|
|
8
|
-
Center
|
|
9
|
-
} from "../../atoms/layouts";
|
|
2
|
+
import { Stack, Cluster, Box, Motion } from "../../atoms/layouts";
|
|
10
3
|
import { fallbackValues } from "./PaymentDetails.theme";
|
|
11
4
|
|
|
12
5
|
import { displayCurrency } from "../../../util/general";
|
|
@@ -22,7 +15,7 @@ import {
|
|
|
22
15
|
FONT_WEIGHT_BOLD,
|
|
23
16
|
FONT_WEIGHT_REGULAR
|
|
24
17
|
} from "../../../constants/style_constants";
|
|
25
|
-
import { ATHENS_GREY
|
|
18
|
+
import { ATHENS_GREY } from "../../../constants/colors";
|
|
26
19
|
import ButtonWithAction from "../../atoms/button-with-action";
|
|
27
20
|
import Text from "../../atoms/text";
|
|
28
21
|
import Alert from "../../atoms/alert";
|
|
@@ -84,6 +77,9 @@ const PaymentDetailsContent = ({
|
|
|
84
77
|
<SolidDivider />
|
|
85
78
|
</Box>
|
|
86
79
|
<LabeledAmount
|
|
80
|
+
version="v2"
|
|
81
|
+
as="h3"
|
|
82
|
+
variant="small"
|
|
87
83
|
extraStyles={`font-weight: ${FONT_WEIGHT_REGULAR}; font-size: 14px;`}
|
|
88
84
|
label="Amount paid"
|
|
89
85
|
amount={displayCurrency(voidableAmountPaid)}
|
|
@@ -97,9 +93,11 @@ const PaymentDetailsContent = ({
|
|
|
97
93
|
<>
|
|
98
94
|
<Box padding="0.5rem 0">
|
|
99
95
|
<LabeledAmount
|
|
96
|
+
version="v2"
|
|
100
97
|
variant={themeValues.labeledAmountSubtotal}
|
|
101
98
|
label="Subtotal"
|
|
102
99
|
amount={displayCurrency(subtotal)}
|
|
100
|
+
as="h3"
|
|
103
101
|
/>
|
|
104
102
|
{feeElems}
|
|
105
103
|
</Box>
|
|
@@ -109,13 +107,14 @@ const PaymentDetailsContent = ({
|
|
|
109
107
|
<></>
|
|
110
108
|
)}
|
|
111
109
|
<LabeledAmount
|
|
112
|
-
|
|
110
|
+
version="v2"
|
|
111
|
+
as="h3"
|
|
113
112
|
variant={themeValues.labeledAmountTotal}
|
|
114
113
|
label={hasVoidablePaymentsSection ? "Remaining amount due" : "Total"}
|
|
115
114
|
amount={displayCurrency(
|
|
116
115
|
typeof remainingBalance === "number" ? remainingBalance : total
|
|
117
116
|
)}
|
|
118
|
-
extraStyles={
|
|
117
|
+
extraStyles={`margin-top: 1rem;`}
|
|
119
118
|
/>
|
|
120
119
|
</Stack>
|
|
121
120
|
);
|
|
@@ -277,6 +276,8 @@ const PaymentDetails = ({
|
|
|
277
276
|
<Fragment key={fee.label}>
|
|
278
277
|
<Box padding="4px 0" />
|
|
279
278
|
<LabeledAmount
|
|
279
|
+
version="v2"
|
|
280
|
+
as="h3"
|
|
280
281
|
key={fee.label}
|
|
281
282
|
variant={themeValues.labeledAmountSubtotal}
|
|
282
283
|
{...fee}
|
|
@@ -328,7 +329,7 @@ const PaymentDetails = ({
|
|
|
328
329
|
<Cluster justify="space-between" align="center">
|
|
329
330
|
<Title
|
|
330
331
|
weight={FONT_WEIGHT_BOLD}
|
|
331
|
-
as="
|
|
332
|
+
as="h2"
|
|
332
333
|
extraStyles={`font-size: 1.375rem;`}
|
|
333
334
|
id="payment-details-title"
|
|
334
335
|
>
|
|
@@ -345,7 +346,7 @@ const PaymentDetails = ({
|
|
|
345
346
|
</Box>
|
|
346
347
|
) : (
|
|
347
348
|
<Title
|
|
348
|
-
as="
|
|
349
|
+
as="h2"
|
|
349
350
|
weight={FONT_WEIGHT_BOLD}
|
|
350
351
|
margin="1rem 0 0 0"
|
|
351
352
|
extraStyles={`font-size: 1.75rem;`}
|
|
@@ -46,6 +46,42 @@ const payment = {
|
|
|
46
46
|
description: "0034 Bednar Mission Unit: 79",
|
|
47
47
|
quantity: 1,
|
|
48
48
|
subDescription: "PIN: 71-83-630-216-0724"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
amount: 42042,
|
|
52
|
+
customAttributes: [
|
|
53
|
+
{
|
|
54
|
+
key: "parcel_id",
|
|
55
|
+
value: "71-83-630-216-0724"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
key: "property_city",
|
|
59
|
+
value: "North Breana"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
key: "property_class",
|
|
63
|
+
value: "7-91"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
key: "property_secondary_address",
|
|
67
|
+
value: "79"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
key: "property_street_address",
|
|
71
|
+
value: "0034 Bednar Mission"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
key: "property_zip_code",
|
|
75
|
+
value: "80326-6917"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
key: "tax_rate",
|
|
79
|
+
value: "7.076"
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
description: "42 Bednar Mission Unit: 42",
|
|
83
|
+
quantity: 1,
|
|
84
|
+
subDescription: "PIN: 71-83-630-216-0724"
|
|
49
85
|
}
|
|
50
86
|
],
|
|
51
87
|
subtotal: 77294,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const backgroundColor = { default: "transparent", small: "transparent" };
|
|
2
2
|
const lineItem = { default: "default", small: "small" };
|
|
3
|
-
const labeledAmountSubtotal = { default: "
|
|
4
|
-
const labeledAmountTotal = { default: "
|
|
3
|
+
const labeledAmountSubtotal = { default: "regular", small: "small" };
|
|
4
|
+
const labeledAmountTotal = { default: "large", small: "small" };
|
|
5
5
|
|
|
6
6
|
export const fallbackValues = {
|
|
7
7
|
backgroundColor,
|