@thecb/components 11.1.13-beta.0 → 11.1.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/dist/index.cjs.js +65 -37
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +65 -37
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/form-layouts/FormInput.js +29 -20
- package/src/components/molecules/partial-amount-form/PartialAmountField.js +33 -4
- package/src/components/molecules/partial-amount-form/PartialAmountField.theme.js +7 -0
package/package.json
CHANGED
|
@@ -99,6 +99,7 @@ const FormattedInputField = styled(({ showErrors, themeValues, ...props }) => (
|
|
|
99
99
|
|
|
100
100
|
const FormInput = ({
|
|
101
101
|
type = "text",
|
|
102
|
+
labelDisplayOverride = null,
|
|
102
103
|
labelTextWhenNoError = "",
|
|
103
104
|
errorMessages,
|
|
104
105
|
isNum = false,
|
|
@@ -147,39 +148,47 @@ const FormInput = ({
|
|
|
147
148
|
<Box padding="0">
|
|
148
149
|
{helperModal ? (
|
|
149
150
|
<Cluster justify="space-between" align="center">
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
151
|
+
{labelDisplayOverride ? (
|
|
152
|
+
labelDisplayOverride
|
|
153
|
+
) : (
|
|
154
|
+
<Text
|
|
155
|
+
as="label"
|
|
156
|
+
color={themeValues.labelColor}
|
|
157
|
+
variant={labelTextVariant}
|
|
158
|
+
weight={themeValues.fontWeight}
|
|
159
|
+
extraStyles={`word-break: break-word;
|
|
156
160
|
font-family: Public Sans;
|
|
157
161
|
&::first-letter {
|
|
158
162
|
text-transform: uppercase;
|
|
159
163
|
}`}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
+
id={createIdFromString(labelTextWhenNoError)}
|
|
165
|
+
>
|
|
166
|
+
{labelTextWhenNoError}
|
|
167
|
+
</Text>
|
|
168
|
+
)}
|
|
164
169
|
{helperModal()}
|
|
165
170
|
</Cluster>
|
|
166
171
|
) : (
|
|
167
172
|
<Box padding="0" minWidth="100%">
|
|
168
173
|
<Cluster justify="space-between" align="center">
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
174
|
+
{labelDisplayOverride ? (
|
|
175
|
+
labelDisplayOverride
|
|
176
|
+
) : (
|
|
177
|
+
<Text
|
|
178
|
+
as="label"
|
|
179
|
+
color={themeValues.labelColor}
|
|
180
|
+
variant={labelTextVariant}
|
|
181
|
+
fontWeight={themeValues.fontWeight}
|
|
182
|
+
extraStyles={`word-break: break-word;
|
|
175
183
|
font-family: Public Sans;
|
|
176
184
|
&::first-letter {
|
|
177
185
|
text-transform: uppercase;
|
|
178
186
|
}`}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
187
|
+
id={createIdFromString(labelTextWhenNoError)}
|
|
188
|
+
>
|
|
189
|
+
{labelTextWhenNoError}
|
|
190
|
+
</Text>
|
|
191
|
+
)}
|
|
183
192
|
{type === "password" && (
|
|
184
193
|
<Text
|
|
185
194
|
variant={labelTextVariant}
|
|
@@ -2,18 +2,39 @@ import React from "react";
|
|
|
2
2
|
import { equals } from "ramda";
|
|
3
3
|
import { FormInput } from "../../atoms/form-layouts";
|
|
4
4
|
import { displayCurrency } from "../../../util/general";
|
|
5
|
-
import Text from "../../atoms
|
|
6
|
-
|
|
5
|
+
import { Stack, Detail, Text } from "../../atoms";
|
|
6
|
+
import { themeComponent } from "../../../util/themeUtils";
|
|
7
|
+
import { fallbackValues } from "./PartialAmountField.theme";
|
|
7
8
|
const PartialAmountField = ({
|
|
8
9
|
lineItem,
|
|
9
10
|
field,
|
|
10
11
|
showErrors,
|
|
11
12
|
errorMessages,
|
|
12
13
|
moneyFormat,
|
|
13
|
-
fieldActions
|
|
14
|
+
fieldActions,
|
|
15
|
+
themeValues
|
|
14
16
|
}) => (
|
|
15
17
|
<FormInput
|
|
16
18
|
labelTextWhenNoError={lineItem.description}
|
|
19
|
+
labelDisplayOverride={
|
|
20
|
+
<Stack childGap="0px">
|
|
21
|
+
<Detail
|
|
22
|
+
as="h3"
|
|
23
|
+
variant={themeValues.detailVariant}
|
|
24
|
+
weight={themeValues.weightTitle}
|
|
25
|
+
>
|
|
26
|
+
<span>{lineItem.description}</span>
|
|
27
|
+
</Detail>
|
|
28
|
+
<Detail
|
|
29
|
+
id={lineItem.subDescription}
|
|
30
|
+
as="p"
|
|
31
|
+
variant={themeValues.detailVariant}
|
|
32
|
+
weight="400"
|
|
33
|
+
>
|
|
34
|
+
{lineItem.subDescription}
|
|
35
|
+
</Detail>
|
|
36
|
+
</Stack>
|
|
37
|
+
}
|
|
17
38
|
key={lineItem.id}
|
|
18
39
|
field={field}
|
|
19
40
|
fieldActions={fieldActions}
|
|
@@ -46,4 +67,12 @@ function arePropsEqual(prevProps, nextProps) {
|
|
|
46
67
|
);
|
|
47
68
|
}
|
|
48
69
|
|
|
49
|
-
export default React.memo(
|
|
70
|
+
export default React.memo(
|
|
71
|
+
themeComponent(
|
|
72
|
+
PartialAmountField,
|
|
73
|
+
"PartialAmountField",
|
|
74
|
+
fallbackValues,
|
|
75
|
+
"default"
|
|
76
|
+
),
|
|
77
|
+
arePropsEqual
|
|
78
|
+
);
|