@thecb/components 10.7.0-beta.1 → 10.7.1-beta.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.
- package/dist/index.cjs.js +432 -163
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +432 -163
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/{molecules/obligation → atoms}/.DS_Store +0 -0
- package/src/components/atoms/icons/.DS_Store +0 -0
- package/src/components/molecules/obligation/Obligation.js +2 -7
- package/src/components/molecules/obligation/modules/AmountModule.js +1 -1
- package/src/components/molecules/obligation/modules/AutopayModalModule.js +11 -11
- package/src/components/molecules/obligation/modules/AutopayModalModule.theme.js +20 -0
- package/src/components/molecules/obligation/modules/IconModule.js +7 -3
- package/src/components/molecules/obligation/modules/InactiveControlsModule.js +1 -1
- package/src/components/molecules/obligation/modules/PaymentDetailsActions.js +7 -3
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/molecules/.DS_Store +0 -0
- package/src/components/molecules/obligation/Obligation.theme.js +0 -7
- package/src/stories/Button.stories.ts +0 -53
- package/src/stories/Button.tsx +0 -48
- package/src/stories/Configure.mdx +0 -364
- package/src/stories/Header.stories.ts +0 -33
- package/src/stories/Header.tsx +0 -56
- package/src/stories/Page.stories.ts +0 -32
- package/src/stories/Page.tsx +0 -73
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +0 -5
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +0 -15
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +0 -3
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +0 -12
- package/src/stories/assets/youtube.svg +0 -4
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- package/src/stories/page.css +0 -69
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -15,8 +15,6 @@ import {
|
|
|
15
15
|
InactiveControlsModule,
|
|
16
16
|
InactiveTitleModule
|
|
17
17
|
} from "./modules";
|
|
18
|
-
import { themeComponent } from "../../../util/themeUtils";
|
|
19
|
-
import { fallbackValues } from "./Obligation.theme";
|
|
20
18
|
|
|
21
19
|
const Obligation = ({
|
|
22
20
|
config,
|
|
@@ -39,8 +37,7 @@ const Obligation = ({
|
|
|
39
37
|
inactiveLookupTitle = "",
|
|
40
38
|
inactiveLookupInput = "Account",
|
|
41
39
|
inactiveLookupValue = "",
|
|
42
|
-
isInCustomerManagement = false
|
|
43
|
-
themeValues
|
|
40
|
+
isInCustomerManagement = false
|
|
44
41
|
}) => {
|
|
45
42
|
/*
|
|
46
43
|
The value of obligations is always an array. It can contain:
|
|
@@ -91,7 +88,6 @@ const Obligation = ({
|
|
|
91
88
|
configIconMap={config.iconMap}
|
|
92
89
|
iconValue={config.iconValue}
|
|
93
90
|
customAttributes={customAttributes}
|
|
94
|
-
iconColor={themeValues.iconColor}
|
|
95
91
|
/>
|
|
96
92
|
)}
|
|
97
93
|
<TitleModule
|
|
@@ -198,7 +194,6 @@ const Obligation = ({
|
|
|
198
194
|
configIconMap={config.iconMap}
|
|
199
195
|
iconValue={config.iconValue}
|
|
200
196
|
customAttributes={customAttributes}
|
|
201
|
-
iconColor={themeValues.iconColor}
|
|
202
197
|
/>
|
|
203
198
|
<InactiveTitleModule
|
|
204
199
|
title={inactiveLookupTitle}
|
|
@@ -261,4 +256,4 @@ const Obligation = ({
|
|
|
261
256
|
return inactive ? inactiveObligation : activeObligation;
|
|
262
257
|
};
|
|
263
258
|
|
|
264
|
-
export default
|
|
259
|
+
export default Obligation;
|
|
@@ -4,7 +4,7 @@ import { Box, Stack } from "../../../atoms/layouts";
|
|
|
4
4
|
import Text from "../../../atoms/text";
|
|
5
5
|
import { FONT_WEIGHT_SEMIBOLD } from "../../../../constants/style_constants";
|
|
6
6
|
import { displayCurrency, noop } from "../../../../util/general";
|
|
7
|
-
import AutopayModalModule from "./AutopayModalModule";
|
|
7
|
+
import { AutopayModalModule } from "./AutopayModalModule";
|
|
8
8
|
|
|
9
9
|
const AmountModule = ({
|
|
10
10
|
totalAmountDue,
|
|
@@ -6,10 +6,11 @@ import { AutopayOnIcon } from "../../../atoms/icons";
|
|
|
6
6
|
import { Box, Cluster } from "../../../atoms/layouts";
|
|
7
7
|
import { SEA_GREEN } from "../../../../constants/colors";
|
|
8
8
|
import { ACH_METHOD, CC_METHOD } from "../../../../constants/general";
|
|
9
|
+
import { fallbackValues } from "./AutopayModalModule.theme";
|
|
10
|
+
import { themeComponent } from "../../../../util/themeUtils";
|
|
9
11
|
import { titleCaseString, noop } from "../../../../util/general";
|
|
10
|
-
import { FONT_WEIGHT_REGULAR } from "../../../../constants/style_constants";
|
|
11
12
|
|
|
12
|
-
const
|
|
13
|
+
const AutopayModal = ({
|
|
13
14
|
autoPayActive,
|
|
14
15
|
autoPaySchedule,
|
|
15
16
|
paymentPlanSchedule,
|
|
@@ -19,6 +20,7 @@ const AutopayModalModule = ({
|
|
|
19
20
|
navigateToSettings,
|
|
20
21
|
controlType = "tertiary",
|
|
21
22
|
isMobile,
|
|
23
|
+
themeValues,
|
|
22
24
|
isPaymentPlan,
|
|
23
25
|
nextAutopayDate,
|
|
24
26
|
dueDate,
|
|
@@ -73,12 +75,6 @@ const AutopayModalModule = ({
|
|
|
73
75
|
}
|
|
74
76
|
: navigateToSettings
|
|
75
77
|
};
|
|
76
|
-
const modalLinkHoverFocus = `
|
|
77
|
-
outline: none;
|
|
78
|
-
cursor: pointer;
|
|
79
|
-
text-decoration: underline;
|
|
80
|
-
text-decoration-color: #317D4F;
|
|
81
|
-
`;
|
|
82
78
|
|
|
83
79
|
const hoverStyles = "text-decoration: underline;";
|
|
84
80
|
const activeStyles = "text-decoration: underline;";
|
|
@@ -146,8 +142,8 @@ const AutopayModalModule = ({
|
|
|
146
142
|
tabIndex="0"
|
|
147
143
|
dataQa={`${shortPlan} On`}
|
|
148
144
|
color={SEA_GREEN}
|
|
149
|
-
weight={
|
|
150
|
-
hoverStyles={modalLinkHoverFocus}
|
|
145
|
+
weight={themeValues.fontWeight}
|
|
146
|
+
hoverStyles={themeValues.modalLinkHoverFocus}
|
|
151
147
|
extraStyles={`padding-left: 0.25rem;`}
|
|
152
148
|
disabled={disableActions}
|
|
153
149
|
>
|
|
@@ -171,4 +167,8 @@ const AutopayModalModule = ({
|
|
|
171
167
|
);
|
|
172
168
|
};
|
|
173
169
|
|
|
174
|
-
export
|
|
170
|
+
export const AutopayModalModule = themeComponent(
|
|
171
|
+
AutopayModal,
|
|
172
|
+
"AutopayModal",
|
|
173
|
+
fallbackValues
|
|
174
|
+
);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FONT_WEIGHT_REGULAR } from "../../../../constants/style_constants";
|
|
2
|
+
|
|
3
|
+
const color = "#15749D";
|
|
4
|
+
const hoverColor = "#116285";
|
|
5
|
+
const activeColor = "#0E506D";
|
|
6
|
+
const linkColor = "#3176AA";
|
|
7
|
+
const fontWeight = FONT_WEIGHT_REGULAR;
|
|
8
|
+
const modalLinkHoverFocus = `outline: none;
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
text-decoration: underline;
|
|
11
|
+
text-decoration-color: #317D4F;`;
|
|
12
|
+
|
|
13
|
+
export const fallbackValues = {
|
|
14
|
+
color,
|
|
15
|
+
hoverColor,
|
|
16
|
+
activeColor,
|
|
17
|
+
linkColor,
|
|
18
|
+
fontWeight,
|
|
19
|
+
modalLinkHoverFocus
|
|
20
|
+
};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { iconsMap } from "../icons";
|
|
3
3
|
import { Box, Cluster } from "../../../atoms/layouts";
|
|
4
|
+
import { themeComponent } from "../../../../util/themeUtils";
|
|
5
|
+
import { fallbackValues } from "../../../atoms/icons/Icons.theme";
|
|
6
|
+
|
|
7
|
+
// Uses the theme values (singleIconColor) for the other icons, located in /atoms/icons
|
|
4
8
|
|
|
5
9
|
const IconsModule = ({
|
|
6
10
|
icon,
|
|
@@ -8,7 +12,7 @@ const IconsModule = ({
|
|
|
8
12
|
configIconMap,
|
|
9
13
|
iconValue,
|
|
10
14
|
customAttributes,
|
|
11
|
-
|
|
15
|
+
themeValues
|
|
12
16
|
}) => {
|
|
13
17
|
let Icon;
|
|
14
18
|
if (typeof icon === "object") {
|
|
@@ -21,10 +25,10 @@ const IconsModule = ({
|
|
|
21
25
|
return (
|
|
22
26
|
<Box padding="0 1rem 0 0">
|
|
23
27
|
<Cluster justify="center" align="center">
|
|
24
|
-
<Icon color={
|
|
28
|
+
<Icon color={themeValues.singleIconColor} />
|
|
25
29
|
</Cluster>
|
|
26
30
|
</Box>
|
|
27
31
|
);
|
|
28
32
|
};
|
|
29
33
|
|
|
30
|
-
export default IconsModule;
|
|
34
|
+
export default themeComponent(IconsModule, "Icon", fallbackValues, "primary");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
2
|
import { GHOST_GREY } from "../../../../constants/colors";
|
|
3
3
|
import { Box, Cluster } from "../../../atoms/layouts";
|
|
4
|
-
import AutopayModalModule from "./AutopayModalModule";
|
|
4
|
+
import { AutopayModalModule } from "./AutopayModalModule";
|
|
5
5
|
import RemoveAccountModalModule from "./RemoveAccountModalModule";
|
|
6
6
|
import { noop } from "../../../../util/general";
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
2
|
import { Box, Cluster } from "../../../atoms/layouts";
|
|
3
3
|
import ButtonWithAction from "../../../atoms/button-with-action";
|
|
4
|
-
import AutopayModalModule from "./AutopayModalModule";
|
|
4
|
+
import { AutopayModalModule } from "./AutopayModalModule";
|
|
5
5
|
import { GHOST_GREY } from "../../../../constants/colors";
|
|
6
6
|
import AmountModule from "./AmountModule";
|
|
7
7
|
import { noop } from "../../../../util/general";
|
|
@@ -48,6 +48,10 @@ const PaymentDetailsActions = ({
|
|
|
48
48
|
setDetailedObligation(obligations, config, obligationAssocID);
|
|
49
49
|
navigateToDetailedObligation(detailsSlug);
|
|
50
50
|
};
|
|
51
|
+
const handlePayNowClick = disableActions
|
|
52
|
+
? noop
|
|
53
|
+
: () => handleClick(obligations);
|
|
54
|
+
|
|
51
55
|
return (
|
|
52
56
|
<Box
|
|
53
57
|
padding={isMobile ? "0" : "16px 0 0"}
|
|
@@ -149,7 +153,7 @@ const PaymentDetailsActions = ({
|
|
|
149
153
|
<Box padding={"0"}>
|
|
150
154
|
<ButtonWithAction
|
|
151
155
|
isLoading={isLoading}
|
|
152
|
-
action={
|
|
156
|
+
action={handlePayNowClick}
|
|
153
157
|
text="Pay Now"
|
|
154
158
|
variant={isMobile ? "smallSecondary" : "secondary"}
|
|
155
159
|
dataQa="Pay Now"
|
|
@@ -162,7 +166,7 @@ const PaymentDetailsActions = ({
|
|
|
162
166
|
<Box padding="8px 0 0" width="100%">
|
|
163
167
|
<ButtonWithAction
|
|
164
168
|
isLoading={isLoading}
|
|
165
|
-
action={
|
|
169
|
+
action={handlePayNowClick}
|
|
166
170
|
text="Pay Now"
|
|
167
171
|
variant={isMobile ? "smallSecondary" : "secondary"}
|
|
168
172
|
dataQa="Pay Now"
|
package/src/.DS_Store
DELETED
|
Binary file
|
package/src/components/.DS_Store
DELETED
|
Binary file
|
|
Binary file
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { fn } from '@storybook/test';
|
|
3
|
-
|
|
4
|
-
import { Button } from './Button';
|
|
5
|
-
|
|
6
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
7
|
-
const meta: Meta<typeof Button> = {
|
|
8
|
-
title: 'Example/Button',
|
|
9
|
-
component: Button,
|
|
10
|
-
parameters: {
|
|
11
|
-
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
12
|
-
layout: 'centered',
|
|
13
|
-
},
|
|
14
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
15
|
-
tags: ['autodocs'],
|
|
16
|
-
// More on argTypes: https://storybook.js.org/docs/api/argtypes
|
|
17
|
-
argTypes: {
|
|
18
|
-
backgroundColor: { control: 'color' },
|
|
19
|
-
},
|
|
20
|
-
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
|
|
21
|
-
args: { onClick: fn() },
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default meta;
|
|
25
|
-
type Story = StoryObj<typeof Button>;
|
|
26
|
-
|
|
27
|
-
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
28
|
-
export const Primary: Story = {
|
|
29
|
-
args: {
|
|
30
|
-
primary: true,
|
|
31
|
-
label: 'Button',
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export const Secondary: Story = {
|
|
36
|
-
args: {
|
|
37
|
-
label: 'Button',
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export const Large: Story = {
|
|
42
|
-
args: {
|
|
43
|
-
size: 'large',
|
|
44
|
-
label: 'Button',
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export const Small: Story = {
|
|
49
|
-
args: {
|
|
50
|
-
size: 'small',
|
|
51
|
-
label: 'Button',
|
|
52
|
-
},
|
|
53
|
-
};
|
package/src/stories/Button.tsx
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './button.css';
|
|
3
|
-
|
|
4
|
-
interface ButtonProps {
|
|
5
|
-
/**
|
|
6
|
-
* Is this the principal call to action on the page?
|
|
7
|
-
*/
|
|
8
|
-
primary?: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* What background color to use
|
|
11
|
-
*/
|
|
12
|
-
backgroundColor?: string;
|
|
13
|
-
/**
|
|
14
|
-
* How large should the button be?
|
|
15
|
-
*/
|
|
16
|
-
size?: 'small' | 'medium' | 'large';
|
|
17
|
-
/**
|
|
18
|
-
* Button contents
|
|
19
|
-
*/
|
|
20
|
-
label: string;
|
|
21
|
-
/**
|
|
22
|
-
* Optional click handler
|
|
23
|
-
*/
|
|
24
|
-
onClick?: () => void;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Primary UI component for user interaction
|
|
29
|
-
*/
|
|
30
|
-
export const Button = ({
|
|
31
|
-
primary = false,
|
|
32
|
-
size = 'medium',
|
|
33
|
-
backgroundColor,
|
|
34
|
-
label,
|
|
35
|
-
...props
|
|
36
|
-
}: ButtonProps) => {
|
|
37
|
-
const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
|
|
38
|
-
return (
|
|
39
|
-
<button
|
|
40
|
-
type="button"
|
|
41
|
-
className={['storybook-button', `storybook-button--${size}`, mode].join(' ')}
|
|
42
|
-
style={{ backgroundColor }}
|
|
43
|
-
{...props}
|
|
44
|
-
>
|
|
45
|
-
{label}
|
|
46
|
-
</button>
|
|
47
|
-
);
|
|
48
|
-
};
|