@thecb/components 7.8.4 → 7.9.0-beta.1

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": "7.8.4",
3
+ "version": "7.9.0-beta.1",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -4,7 +4,13 @@ import Paragraph from "../paragraph";
4
4
  import { themeComponent } from "../../../util/themeUtils";
5
5
  import { fallbackValues } from "./LineItem.theme";
6
6
 
7
- const LineItem = ({ description, subDescription, amount, themeValues }) => (
7
+ const LineItem = ({
8
+ description,
9
+ subDescription,
10
+ amount,
11
+ themeValues,
12
+ quantity = null
13
+ }) => (
8
14
  <Cluster nowrap justify="space-between" align="start">
9
15
  <Stack childGap="0px">
10
16
  <Paragraph
@@ -17,6 +23,14 @@ const LineItem = ({ description, subDescription, amount, themeValues }) => (
17
23
  {subDescription}
18
24
  </Paragraph>
19
25
  </Stack>
26
+ {!!quantity && (
27
+ <Paragraph
28
+ variant={themeValues.paragraphVariant}
29
+ weight={themeValues.weightTitle}
30
+ >
31
+ {`x${quantity}`}
32
+ </Paragraph>
33
+ )}
20
34
  <Paragraph
21
35
  variant={themeValues.paragraphVariant}
22
36
  weight="600"
@@ -17,3 +17,12 @@ export const lineItem = () => (
17
17
  amount={text("amount", "$4.00", "props")}
18
18
  />
19
19
  );
20
+
21
+ export const lineItemWithQuantity = () => (
22
+ <LineItem
23
+ description={text("description", "Foo", "props")}
24
+ subDescription={text("subDescription", "Bar", "props")}
25
+ amount={text("amount", "$4.00", "props")}
26
+ quantity={2}
27
+ />
28
+ );