@thecb/components 11.1.15-beta.2 → 11.1.15-beta.4
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 +19 -11
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +19 -11
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/form-layouts/FormInput.js +11 -2
- package/src/components/molecules/partial-amount-form/PartialAmountField.js +53 -43
package/package.json
CHANGED
|
@@ -98,6 +98,7 @@ const FormattedInputField = styled(({ showErrors, themeValues, ...props }) => (
|
|
|
98
98
|
`;
|
|
99
99
|
|
|
100
100
|
const FormInput = ({
|
|
101
|
+
ariaLabelledBy = undefined,
|
|
101
102
|
type = "text",
|
|
102
103
|
labelDisplayOverride = null,
|
|
103
104
|
labelTextWhenNoError = "",
|
|
@@ -217,7 +218,11 @@ const FormInput = ({
|
|
|
217
218
|
<Box padding="0">
|
|
218
219
|
{formatter ? (
|
|
219
220
|
<FormattedInputField
|
|
220
|
-
aria-labelledby={
|
|
221
|
+
aria-labelledby={
|
|
222
|
+
ariaLabelledBy === undefined
|
|
223
|
+
? createIdFromString(labelTextWhenNoError)
|
|
224
|
+
: ariaLabelledBy
|
|
225
|
+
}
|
|
221
226
|
aria-describedby={createIdFromString(
|
|
222
227
|
labelTextWhenNoError,
|
|
223
228
|
"error message"
|
|
@@ -254,7 +259,11 @@ const FormInput = ({
|
|
|
254
259
|
/>
|
|
255
260
|
) : (
|
|
256
261
|
<InputField
|
|
257
|
-
aria-labelledby={
|
|
262
|
+
aria-labelledby={
|
|
263
|
+
ariaLabelledBy === undefined
|
|
264
|
+
? createIdFromString(labelTextWhenNoError)
|
|
265
|
+
: ariaLabelledBy
|
|
266
|
+
}
|
|
258
267
|
aria-describedby={createIdFromString(
|
|
259
268
|
labelTextWhenNoError,
|
|
260
269
|
"error message"
|
|
@@ -13,49 +13,59 @@ const PartialAmountField = ({
|
|
|
13
13
|
moneyFormat,
|
|
14
14
|
fieldActions,
|
|
15
15
|
themeValues
|
|
16
|
-
}) =>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
16
|
+
}) => {
|
|
17
|
+
const id = createIdFromString(
|
|
18
|
+
`${lineItem.description}-${lineItem.subDescription}`
|
|
19
|
+
);
|
|
20
|
+
return (
|
|
21
|
+
<FormInput
|
|
22
|
+
ariaLabelledBy={null}
|
|
23
|
+
id={id}
|
|
24
|
+
labelTextWhenNoError={id}
|
|
25
|
+
labelDisplayOverride={
|
|
26
|
+
<Stack childGap="0px">
|
|
27
|
+
<Box as="label" for={id} padding="0">
|
|
28
|
+
<Detail
|
|
29
|
+
as="span"
|
|
30
|
+
extraStyles="display: block;"
|
|
31
|
+
variant={themeValues.detailVariant}
|
|
32
|
+
weight={themeValues.weightTitle}
|
|
33
|
+
>
|
|
34
|
+
{lineItem.description}
|
|
35
|
+
</Detail>
|
|
36
|
+
<Detail
|
|
37
|
+
as="span"
|
|
38
|
+
extraStyles="display: block;"
|
|
39
|
+
variant={themeValues.detailVariant}
|
|
40
|
+
weight="400"
|
|
41
|
+
>
|
|
42
|
+
{lineItem.subDescription}
|
|
43
|
+
</Detail>
|
|
44
|
+
</Box>
|
|
45
|
+
</Stack>
|
|
46
|
+
}
|
|
47
|
+
key={lineItem.id}
|
|
48
|
+
field={field}
|
|
49
|
+
fieldActions={fieldActions}
|
|
50
|
+
showErrors={showErrors}
|
|
51
|
+
errorMessages={errorMessages}
|
|
52
|
+
style={{ textAlign: "right" }}
|
|
53
|
+
placeholder="$0.00"
|
|
54
|
+
formatter={moneyFormat}
|
|
55
|
+
isNum
|
|
56
|
+
decorator={
|
|
57
|
+
<Text variant="p">
|
|
58
|
+
Amount owed:{" "}
|
|
59
|
+
{
|
|
60
|
+
<Text variant="p" weight="600">
|
|
61
|
+
{displayCurrency(lineItem.amount)}
|
|
62
|
+
</Text>
|
|
63
|
+
}
|
|
64
|
+
</Text>
|
|
65
|
+
}
|
|
66
|
+
/>
|
|
67
|
+
);
|
|
68
|
+
};
|
|
59
69
|
|
|
60
70
|
function arePropsEqual(prevProps, nextProps) {
|
|
61
71
|
return (
|