@thecb/components 3.5.12-beta.0 → 3.5.13
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/package.json
CHANGED
|
@@ -8,21 +8,19 @@ import { themeComponent } from "../../../util/themeUtils";
|
|
|
8
8
|
const Alert = ({
|
|
9
9
|
heading,
|
|
10
10
|
text,
|
|
11
|
-
textOverride,
|
|
12
11
|
variant,
|
|
13
12
|
children,
|
|
14
13
|
height,
|
|
15
14
|
onLinkClick,
|
|
16
|
-
padding = "0.5rem",
|
|
17
15
|
showQuitLink = true,
|
|
18
16
|
themeValues
|
|
19
17
|
}) => {
|
|
20
18
|
const Icon = AlertIcons[variant];
|
|
21
19
|
return (
|
|
22
20
|
<Box
|
|
23
|
-
padding=
|
|
21
|
+
padding="0.5rem"
|
|
24
22
|
width="100%"
|
|
25
|
-
minHeight=
|
|
23
|
+
minHeight="100px"
|
|
26
24
|
height={height ? height : "auto"}
|
|
27
25
|
background={themeValues.background}
|
|
28
26
|
borderRadius="4px"
|
|
@@ -39,21 +37,17 @@ const Alert = ({
|
|
|
39
37
|
</Box>
|
|
40
38
|
<Box padding="0">
|
|
41
39
|
<Sidebar onRight width="24px" childGap="0rem">
|
|
42
|
-
<Box padding=
|
|
40
|
+
<Box padding="1rem">
|
|
43
41
|
<Cluster justify="flex-start" align="center">
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
</Text>
|
|
54
|
-
{children}
|
|
55
|
-
</Stack>
|
|
56
|
-
)}
|
|
42
|
+
<Stack fullHeight childGap="0.25rem">
|
|
43
|
+
<Text variant="p" color={themeValues.text} weight="600">
|
|
44
|
+
{heading}
|
|
45
|
+
</Text>
|
|
46
|
+
<Text variant="pS" color={themeValues.text}>
|
|
47
|
+
{text}
|
|
48
|
+
</Text>
|
|
49
|
+
{children}
|
|
50
|
+
</Stack>
|
|
57
51
|
</Cluster>
|
|
58
52
|
</Box>
|
|
59
53
|
<Cluster justify="flex-end" align="flex-start">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useContext } from "react";
|
|
2
|
-
import styled, { ThemeContext } from "styled-components";
|
|
2
|
+
import styled, { ThemeContext, css } from "styled-components";
|
|
3
3
|
import { FormattedInput } from "formatted-input";
|
|
4
4
|
import { fallbackValues } from "./FormLayouts.theme.js";
|
|
5
5
|
import { themeComponent } from "../../../util/themeUtils";
|
|
@@ -15,7 +15,7 @@ const InputField = styled.input`
|
|
|
15
15
|
? ERROR_COLOR
|
|
16
16
|
: themeValues.borderColor};
|
|
17
17
|
border-radius: 2px;
|
|
18
|
-
height: 48px;
|
|
18
|
+
height: ${({ customHeight }) => (customHeight ? customHeight : "48px")};
|
|
19
19
|
width: 100%;
|
|
20
20
|
padding: 1rem;
|
|
21
21
|
min-width: 100px;
|
|
@@ -38,6 +38,11 @@ const InputField = styled.input`
|
|
|
38
38
|
&:focus {
|
|
39
39
|
border: 1px solid ${MATISSE_BLUE};
|
|
40
40
|
}
|
|
41
|
+
|
|
42
|
+
${({ extraStyles }) =>
|
|
43
|
+
css`
|
|
44
|
+
${extraStyles}
|
|
45
|
+
`}
|
|
41
46
|
`;
|
|
42
47
|
|
|
43
48
|
// eslint-disable-next-line no-unused-vars
|
|
@@ -50,7 +55,7 @@ const FormattedInputField = styled(({ showErrors, ...props }) => (
|
|
|
50
55
|
? ERROR_COLOR
|
|
51
56
|
: themeValues.borderColor};
|
|
52
57
|
border-radius: 2px;
|
|
53
|
-
height: 48px;
|
|
58
|
+
height: ${({ customHeight }) => (customHeight ? customHeight : "48px")};
|
|
54
59
|
width: 100%;
|
|
55
60
|
padding: 1rem;
|
|
56
61
|
min-width: 100px;
|
|
@@ -68,6 +73,11 @@ const FormattedInputField = styled(({ showErrors, ...props }) => (
|
|
|
68
73
|
&:focus {
|
|
69
74
|
border: 1px solid ${MATISSE_BLUE};
|
|
70
75
|
}
|
|
76
|
+
|
|
77
|
+
${({ extraStyles }) =>
|
|
78
|
+
css`
|
|
79
|
+
${extraStyles}
|
|
80
|
+
`}
|
|
71
81
|
`;
|
|
72
82
|
|
|
73
83
|
const FormInput = ({
|
|
@@ -83,6 +93,8 @@ const FormInput = ({
|
|
|
83
93
|
decorator,
|
|
84
94
|
themeValues,
|
|
85
95
|
background,
|
|
96
|
+
customHeight,
|
|
97
|
+
extraStyles,
|
|
86
98
|
...props
|
|
87
99
|
}) => {
|
|
88
100
|
const [showPassword, setShowPassword] = useState(false);
|
|
@@ -168,6 +180,8 @@ const FormInput = ({
|
|
|
168
180
|
showErrors={showErrors}
|
|
169
181
|
data-qa={labelTextWhenNoError}
|
|
170
182
|
themeValues={themeValues}
|
|
183
|
+
customHeight={customHeight}
|
|
184
|
+
extraStyles={extraStyles}
|
|
171
185
|
{...props}
|
|
172
186
|
/>
|
|
173
187
|
) : (
|
|
@@ -183,6 +197,8 @@ const FormInput = ({
|
|
|
183
197
|
data-qa={labelTextWhenNoError}
|
|
184
198
|
themeValues={themeValues}
|
|
185
199
|
background={background}
|
|
200
|
+
customHeight={customHeight}
|
|
201
|
+
extraStyles={extraStyles}
|
|
186
202
|
{...props}
|
|
187
203
|
/>
|
|
188
204
|
)}
|
|
@@ -122,12 +122,12 @@ const RadioSection = ({
|
|
|
122
122
|
: themeValues.headingBackgroundColor
|
|
123
123
|
}
|
|
124
124
|
onClick={
|
|
125
|
-
isMobile && supportsTouch
|
|
125
|
+
(isMobile && supportsTouch) || section.disabled
|
|
126
126
|
? noop
|
|
127
127
|
: () => toggleOpenSection(section.id)
|
|
128
128
|
}
|
|
129
129
|
onTouchEnd={
|
|
130
|
-
isMobile && supportsTouch
|
|
130
|
+
(isMobile && supportsTouch) || !section.disabled
|
|
131
131
|
? () => toggleOpenSection(section.id)
|
|
132
132
|
: noop
|
|
133
133
|
}
|
|
@@ -155,7 +155,11 @@ const RadioSection = ({
|
|
|
155
155
|
name={section.id}
|
|
156
156
|
radioOn={openSection === section.id}
|
|
157
157
|
radioFocused={focused === section.id}
|
|
158
|
-
toggleRadio={
|
|
158
|
+
toggleRadio={
|
|
159
|
+
section.disabled
|
|
160
|
+
? noop
|
|
161
|
+
: () => toggleOpenSection(section.id)
|
|
162
|
+
}
|
|
159
163
|
tabIndex="-1"
|
|
160
164
|
/>
|
|
161
165
|
</Box>
|