@thecb/components 11.1.15-beta.1 → 11.1.15-beta.3

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "11.1.15-beta.1",
3
+ "version": "11.1.15-beta.3",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import { equals } from "ramda";
3
3
  import { FormInput } from "../../atoms/form-layouts";
4
4
  import { createIdFromString, displayCurrency } from "../../../util/general";
5
- import { Stack, Detail, Text } from "../../atoms";
5
+ import { Stack, Detail, Text, Box } from "../../atoms";
6
6
  import { themeComponent } from "../../../util/themeUtils";
7
7
  import { fallbackValues } from "./PartialAmountField.theme";
8
8
  const PartialAmountField = ({
@@ -13,56 +13,51 @@ const PartialAmountField = ({
13
13
  moneyFormat,
14
14
  fieldActions,
15
15
  themeValues
16
- }) => (
17
- <FormInput
18
- labelTextWhenNoError={createIdFromString(
19
- `${lineItem.description}-${lineItem.subDescription}`
20
- )}
21
- labelDisplayOverride={
22
- <Stack childGap="0px">
23
- <Detail
24
- as="label"
25
- for={createIdFromString(
26
- `${lineItem.description}-${lineItem.subDescription}`
27
- )}
28
- variant={themeValues.detailVariant}
29
- weight={themeValues.weightTitle}
30
- >
31
- <span>{lineItem.description}</span>
32
- </Detail>
33
- <Detail
34
- as="label"
35
- for={createIdFromString(
36
- `${lineItem.description}-${lineItem.subDescription}`
37
- )}
38
- variant={themeValues.detailVariant}
39
- weight="400"
40
- >
41
- {lineItem.subDescription}
42
- </Detail>
43
- </Stack>
44
- }
45
- key={lineItem.id}
46
- field={field}
47
- fieldActions={fieldActions}
48
- showErrors={showErrors}
49
- errorMessages={errorMessages}
50
- style={{ textAlign: "right" }}
51
- placeholder="$0.00"
52
- formatter={moneyFormat}
53
- isNum
54
- decorator={
55
- <Text variant="p">
56
- Amount owed:{" "}
57
- {
58
- <Text variant="p" weight="600">
59
- {displayCurrency(lineItem.amount)}
60
- </Text>
61
- }
62
- </Text>
63
- }
64
- />
65
- );
16
+ }) => {
17
+ const id = createIdFromString(
18
+ `${lineItem.description}-${lineItem.subDescription}`
19
+ );
20
+ return (
21
+ <FormInput
22
+ id={id}
23
+ labelTextWhenNoError={id}
24
+ labelDisplayOverride={
25
+ <Stack childGap="0px">
26
+ <Box padding="0">{lineItem.description}</Box>
27
+ <Detail
28
+ as="label"
29
+ for={id}
30
+ variant={themeValues.detailVariant}
31
+ weight={themeValues.weightTitle}
32
+ >
33
+ <Detail as="span" variant={themeValues.detailVariant} weight="400">
34
+ {lineItem.subDescription}
35
+ </Detail>
36
+ </Detail>
37
+ </Stack>
38
+ }
39
+ key={lineItem.id}
40
+ field={field}
41
+ fieldActions={fieldActions}
42
+ showErrors={showErrors}
43
+ errorMessages={errorMessages}
44
+ style={{ textAlign: "right" }}
45
+ placeholder="$0.00"
46
+ formatter={moneyFormat}
47
+ isNum
48
+ decorator={
49
+ <Text variant="p">
50
+ Amount owed:{" "}
51
+ {
52
+ <Text variant="p" weight="600">
53
+ {displayCurrency(lineItem.amount)}
54
+ </Text>
55
+ }
56
+ </Text>
57
+ }
58
+ />
59
+ )
60
+ };
66
61
 
67
62
  function arePropsEqual(prevProps, nextProps) {
68
63
  return (