@thecb/components 10.4.6-beta.6 → 10.4.7-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 +226 -303
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +227 -303
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/index.js +0 -1
- package/src/components/atoms/toggle-switch/ToggleSwitch.js +34 -61
- package/src/components/atoms/toggle-switch/ToggleSwitch.stories.js +3 -3
- package/src/components/atoms/toggle-switch/ToggleSwitch.theme.js +5 -5
- package/src/components/molecules/account-and-routing-modal/AccountAndRoutingModal.js +50 -50
- package/dist/src/apps/checkout/pages/payment/sub-pages/payment-amount/PaymentAmount_old.js +0 -49322
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/atoms/icons/.DS_Store +0 -0
- package/src/components/atoms/wallet-name/WalletName.js +0 -74
- package/src/components/atoms/wallet-name/WalletName.stories.js +0 -20
- package/src/components/atoms/wallet-name/WalletName.theme.js +0 -9
- package/src/components/atoms/wallet-name/index.js +0 -3
package/package.json
CHANGED
|
@@ -48,5 +48,4 @@ export { default as TypeaheadInput } from "./typeahead-input";
|
|
|
48
48
|
export { default as Card } from "./card";
|
|
49
49
|
export { default as NavTabs } from "./nav-tabs";
|
|
50
50
|
export { default as LoadingLine } from "./loading-line";
|
|
51
|
-
export { default as WalletName } from "./wallet-name";
|
|
52
51
|
export * from "./table";
|
|
@@ -20,9 +20,9 @@ const HiddenToggleSwitchBox = styled.input`
|
|
|
20
20
|
`;
|
|
21
21
|
|
|
22
22
|
const VisibleSwitchComponent = styled.label`
|
|
23
|
-
width:
|
|
23
|
+
width: 44px;
|
|
24
24
|
height: 24px;
|
|
25
|
-
border-radius:
|
|
25
|
+
border-radius: 12px;
|
|
26
26
|
border: none;
|
|
27
27
|
position: relative;
|
|
28
28
|
box-sizing: border-box;
|
|
@@ -41,27 +41,15 @@ const VisibleSwitchComponent = styled.label`
|
|
|
41
41
|
${({ isMobile }) => (isMobile ? `transform: scale(0.75)` : ``)}
|
|
42
42
|
`;
|
|
43
43
|
|
|
44
|
-
const
|
|
44
|
+
const ToggleSwitchRingComponent = styled.div`
|
|
45
45
|
position: absolute;
|
|
46
|
-
width:
|
|
47
|
-
height:
|
|
46
|
+
width: 16px;
|
|
47
|
+
height: 16px;
|
|
48
48
|
border: none;
|
|
49
49
|
border-radius: 50%;
|
|
50
50
|
box-sizing: border-box;
|
|
51
51
|
`;
|
|
52
52
|
|
|
53
|
-
const ToggleSwitchInnerRingComponent = styled.div`
|
|
54
|
-
position: absolute;
|
|
55
|
-
width: 14px;
|
|
56
|
-
height: 14px;
|
|
57
|
-
top: 3px;
|
|
58
|
-
left: 3px;
|
|
59
|
-
right: 3px;
|
|
60
|
-
bottom: 3px;
|
|
61
|
-
border-radius: 50%;
|
|
62
|
-
box-sizing: border-box;
|
|
63
|
-
`;
|
|
64
|
-
|
|
65
53
|
const ToggleSwitch = ({
|
|
66
54
|
isOn = false,
|
|
67
55
|
onToggle = noop,
|
|
@@ -73,54 +61,32 @@ const ToggleSwitch = ({
|
|
|
73
61
|
isMobile,
|
|
74
62
|
dataQa
|
|
75
63
|
}) => {
|
|
76
|
-
const
|
|
77
|
-
off: {
|
|
78
|
-
backgroundColor: themeValues.offBackground,
|
|
79
|
-
transition: {
|
|
80
|
-
ease: "easeOut"
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
on: {
|
|
84
|
-
backgroundColor: themeValues.onBackground,
|
|
85
|
-
transition: {
|
|
86
|
-
ease: "easeIn"
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
disabled: {
|
|
90
|
-
backgroundColor: themeValues.disabledBackground
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
const ToggleSwitchMiddleRing = posed(ToggleSwitchMiddleRingComponent)({
|
|
64
|
+
const ToggleSwitchRing = posed(ToggleSwitchRingComponent)({
|
|
95
65
|
off: {
|
|
96
|
-
backgroundColor:
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
66
|
+
backgroundColor: disabled
|
|
67
|
+
? themeValues.disabledBackground
|
|
68
|
+
: themeValues.onBackground,
|
|
69
|
+
left: "4px",
|
|
70
|
+
top: "3px",
|
|
71
|
+
bottom: "3px",
|
|
72
|
+
right: "20px",
|
|
101
73
|
transition: {
|
|
102
74
|
ease: "backIn"
|
|
103
75
|
}
|
|
104
76
|
},
|
|
105
77
|
on: {
|
|
106
78
|
backgroundColor: themeValues.white,
|
|
107
|
-
right: "
|
|
108
|
-
top: "
|
|
109
|
-
bottom: "
|
|
110
|
-
left: "
|
|
79
|
+
right: "8px",
|
|
80
|
+
top: "3px",
|
|
81
|
+
bottom: "4px",
|
|
82
|
+
left: "23px",
|
|
111
83
|
transition: {
|
|
112
84
|
ease: "backIn"
|
|
113
85
|
}
|
|
114
|
-
},
|
|
115
|
-
disabled: {
|
|
116
|
-
backgroundColor: themeValues.white,
|
|
117
|
-
left: "2px",
|
|
118
|
-
top: "2px",
|
|
119
|
-
bottom: "2px",
|
|
120
|
-
right: "24px"
|
|
121
86
|
}
|
|
122
87
|
});
|
|
123
88
|
|
|
89
|
+
// to do: for disabled, background color should not be white (should be lighter disabled background)
|
|
124
90
|
const VisibleSwitch = posed(VisibleSwitchComponent)({
|
|
125
91
|
focusable: true,
|
|
126
92
|
hoverable: true,
|
|
@@ -133,19 +99,28 @@ const ToggleSwitch = ({
|
|
|
133
99
|
boxShadow: "0px 2px 5px 0px rgba(0,0,0,0.5)"
|
|
134
100
|
},
|
|
135
101
|
off: {
|
|
136
|
-
|
|
102
|
+
border: "1px solid",
|
|
103
|
+
backgroundColor: disabled
|
|
104
|
+
? themeValues.disabledBackgroundLight
|
|
105
|
+
: themeValues.white,
|
|
106
|
+
borderColor: disabled
|
|
107
|
+
? themeValues.disabledBackground
|
|
108
|
+
: themeValues.onBackground,
|
|
137
109
|
transition: {
|
|
138
110
|
ease: "easeOut"
|
|
139
111
|
}
|
|
140
112
|
},
|
|
141
113
|
on: {
|
|
142
|
-
|
|
114
|
+
border: "1px solid",
|
|
115
|
+
backgroundColor: disabled
|
|
116
|
+
? themeValues.disabledBackground
|
|
117
|
+
: themeValues.onBackground,
|
|
118
|
+
borderColor: disabled
|
|
119
|
+
? themeValues.disabledBackground
|
|
120
|
+
: themeValues.onBackground,
|
|
143
121
|
transition: {
|
|
144
122
|
ease: "easeIn"
|
|
145
123
|
}
|
|
146
|
-
},
|
|
147
|
-
disabled: {
|
|
148
|
-
backgroundColor: themeValues.disabledBackground
|
|
149
124
|
}
|
|
150
125
|
});
|
|
151
126
|
|
|
@@ -184,14 +159,12 @@ const ToggleSwitch = ({
|
|
|
184
159
|
htmlFor={`#toggle-${name}`}
|
|
185
160
|
onClick={disabled ? noop : onToggle}
|
|
186
161
|
onKeyDown={disabled ? noop : handleKeyDown}
|
|
187
|
-
pose={
|
|
162
|
+
pose={isOn ? "on" : "off"}
|
|
188
163
|
tabIndex={disabled ? -1 : 0}
|
|
189
164
|
disabled={disabled}
|
|
190
165
|
isMobile={isMobile}
|
|
191
166
|
>
|
|
192
|
-
<
|
|
193
|
-
<ToggleSwitchInnerRing />
|
|
194
|
-
</ToggleSwitchMiddleRing>
|
|
167
|
+
<ToggleSwitchRing />
|
|
195
168
|
</VisibleSwitch>
|
|
196
169
|
</Box>
|
|
197
170
|
</Cover>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, Fragment } from "react";
|
|
2
|
-
import { boolean } from "@storybook/addon-knobs";
|
|
2
|
+
import { boolean, text } from "@storybook/addon-knobs";
|
|
3
3
|
import ToggleSwitch from "./ToggleSwitch";
|
|
4
4
|
import page from "../../../../.storybook/page";
|
|
5
5
|
|
|
@@ -7,12 +7,12 @@ export const toggleSwitchDefault = () => {
|
|
|
7
7
|
const [isOn, onToggle] = useState(false);
|
|
8
8
|
|
|
9
9
|
const disabled = boolean("disabled", false, "props");
|
|
10
|
-
|
|
10
|
+
const label = text(label, "Toggle Switch Label", "props");
|
|
11
11
|
return (
|
|
12
12
|
<Fragment>
|
|
13
13
|
<ToggleSwitch
|
|
14
14
|
name="toggle-switch"
|
|
15
|
-
label=
|
|
15
|
+
label={label}
|
|
16
16
|
isOn={isOn}
|
|
17
17
|
onToggle={() => onToggle(!isOn)}
|
|
18
18
|
disabled={disabled}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WHITE,
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
ATHENS_GREY,
|
|
4
|
+
MANATEE_GREY,
|
|
5
5
|
MATISSE_BLUE
|
|
6
6
|
} from "../../../constants/colors";
|
|
7
7
|
|
|
8
8
|
const onBackground = `${MATISSE_BLUE}`;
|
|
9
|
-
const disabledBackground = `${
|
|
9
|
+
const disabledBackground = `${MANATEE_GREY}`;
|
|
10
|
+
const disabledBackgroundLight = `${ATHENS_GREY}`;
|
|
10
11
|
const white = `${WHITE}`;
|
|
11
|
-
const offBackground = `${REGENT_GREY}`;
|
|
12
12
|
|
|
13
13
|
const labelStyles = `
|
|
14
14
|
display: flex;
|
|
@@ -29,8 +29,8 @@ const leftLabelStyles = `
|
|
|
29
29
|
export const fallbackValues = {
|
|
30
30
|
onBackground,
|
|
31
31
|
disabledBackground,
|
|
32
|
+
disabledBackgroundLight,
|
|
32
33
|
white,
|
|
33
|
-
offBackground,
|
|
34
34
|
rightLabelStyles,
|
|
35
35
|
leftLabelStyles
|
|
36
36
|
};
|
|
@@ -3,6 +3,7 @@ import Modal from "../modal";
|
|
|
3
3
|
import Text from "../../atoms/text";
|
|
4
4
|
import Paragraph from "../../atoms/paragraph";
|
|
5
5
|
import { Box, Stack, Center } from "../../atoms/layouts";
|
|
6
|
+
import ButtonWithAction from "../../atoms/button-with-action/ButtonWithAction";
|
|
6
7
|
import { fallbackValues } from "./AccountAndRoutingModal.theme";
|
|
7
8
|
import { themeComponent } from "../../../util/themeUtils";
|
|
8
9
|
import { AccountNumberImage, RoutingNumberImage } from "../../atoms/icons";
|
|
@@ -18,57 +19,56 @@ const AccountAndRoutingModal = ({
|
|
|
18
19
|
imageType,
|
|
19
20
|
themeValues,
|
|
20
21
|
dataQa = null
|
|
21
|
-
}) =>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<Text
|
|
56
|
-
variant="pS"
|
|
57
|
-
onClick={() => toggleOpen(true)}
|
|
58
|
-
onKeyPress={e => e.key === "Enter" && toggleOpen(true)}
|
|
59
|
-
tabIndex="0"
|
|
60
|
-
color={themeValues.linkColor}
|
|
61
|
-
weight={themeValues.fontWeight}
|
|
62
|
-
hoverStyles={themeValues.modalLinkHoverFocus}
|
|
63
|
-
textDecoration={themeValues.linkTextDecoration}
|
|
64
|
-
extraStyles={`cursor: pointer;`}
|
|
65
|
-
role="button"
|
|
66
|
-
className="modal-trigger"
|
|
22
|
+
}) => {
|
|
23
|
+
return (
|
|
24
|
+
<Modal
|
|
25
|
+
modalOpen={isOpen}
|
|
26
|
+
hideModal={() => toggleOpen(false)}
|
|
27
|
+
showModal={() => toggleOpen(true)}
|
|
28
|
+
modalHeaderText={title}
|
|
29
|
+
dataQa={dataQa}
|
|
30
|
+
modalBodyText={
|
|
31
|
+
<Box extraStyles="overflow: scroll; max-height: 20rem;">
|
|
32
|
+
<Stack>
|
|
33
|
+
<Paragraph variant="p">{content}</Paragraph>
|
|
34
|
+
{imageType === "Account" ? (
|
|
35
|
+
<Center intrinsic>
|
|
36
|
+
<AccountNumberImage />
|
|
37
|
+
</Center>
|
|
38
|
+
) : imageType === "Routing" ? (
|
|
39
|
+
<Center intrinsic>
|
|
40
|
+
<RoutingNumberImage />
|
|
41
|
+
</Center>
|
|
42
|
+
) : (
|
|
43
|
+
<Fragment />
|
|
44
|
+
)}
|
|
45
|
+
</Stack>
|
|
46
|
+
</Box>
|
|
47
|
+
}
|
|
48
|
+
defaultWrapper={false}
|
|
49
|
+
onlyCloseButton={!acceptText}
|
|
50
|
+
continueButtonText={acceptText}
|
|
51
|
+
continueAction={() => {
|
|
52
|
+
toggleAccepted(true);
|
|
53
|
+
toggleOpen(false);
|
|
54
|
+
}}
|
|
55
|
+
initialFocusSelector={"[name='Close']"}
|
|
67
56
|
>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
)
|
|
57
|
+
<ButtonWithAction
|
|
58
|
+
variant="ghost"
|
|
59
|
+
tabIndex="0"
|
|
60
|
+
onClick={() => toggleOpen(true)}
|
|
61
|
+
onKeyPress={e => e.key === "Enter" && toggleOpen(true)}
|
|
62
|
+
extraStyles="min-width: 0; min-height: 0;margin: 0; padding: 0; text-transform: none;"
|
|
63
|
+
text={
|
|
64
|
+
<Text variant="pS" color="inherit">
|
|
65
|
+
{link}
|
|
66
|
+
</Text>
|
|
67
|
+
}
|
|
68
|
+
/>
|
|
69
|
+
</Modal>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
72
|
|
|
73
73
|
export default themeComponent(
|
|
74
74
|
AccountAndRoutingModal,
|