@telia/teddy 0.4.3 → 0.4.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.
|
@@ -8,24 +8,26 @@ const components_flex_flex = require("../flex/flex.cjs");
|
|
|
8
8
|
const components_text_text = require("../text/text.cjs");
|
|
9
9
|
const tokens_color_variables = require("../../tokens/color/variables.cjs");
|
|
10
10
|
const Price = React.forwardRef(
|
|
11
|
-
({ className, pricePrefix, priceText, variant = "default", textAbovePrice, textBelowPrice }, forwardRef) => {
|
|
11
|
+
({ className, pricePrefix, priceSuffix, priceText, variant = "default", textAbovePrice, textBelowPrice }, forwardRef) => {
|
|
12
12
|
const rootColorDotsClass = `${components_card_card.rootClassName}__price`;
|
|
13
13
|
const classes = clsx([components_card_card.styles[rootColorDotsClass]], className);
|
|
14
14
|
return /* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { flexGrow: "1", mt: "auto", mb: "100", ref: forwardRef, className: classes, direction: "column", gap: "10", children: [
|
|
15
15
|
textAbovePrice ? /* @__PURE__ */ jsxRuntime.jsx(components_text_text.Text, { variant: "additional-100", as: "p", faded: true, children: textAbovePrice }) : null,
|
|
16
16
|
/* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { direction: "row", align: "baseline", flexGrow: "1", wrap: "nowrap", children: [
|
|
17
|
-
/* @__PURE__ */ jsxRuntime.jsx(components_text_text.Text, { variant: "paragraph-200", as: "p", faded: true, children: pricePrefix
|
|
17
|
+
pricePrefix && /* @__PURE__ */ jsxRuntime.jsx(components_text_text.Text, { variant: "paragraph-200", as: "p", faded: true, children: pricePrefix }),
|
|
18
18
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
19
19
|
components_text_text.Text,
|
|
20
20
|
{
|
|
21
21
|
variant: "paragraph-100-bold",
|
|
22
22
|
as: "span",
|
|
23
23
|
ml: "100",
|
|
24
|
+
mr: "100",
|
|
24
25
|
color: variant === "purple" ? tokens_color_variables.teddyColorBrandCorePurple : void 0,
|
|
25
26
|
className: components_card_card.styles[`${rootColorDotsClass}--big`],
|
|
26
27
|
children: priceText
|
|
27
28
|
}
|
|
28
|
-
)
|
|
29
|
+
),
|
|
30
|
+
priceSuffix && /* @__PURE__ */ jsxRuntime.jsx(components_text_text.Text, { variant: "paragraph-200", as: "p", faded: true, children: priceSuffix })
|
|
29
31
|
] }),
|
|
30
32
|
textBelowPrice ? /* @__PURE__ */ jsxRuntime.jsx(components_text_text.Text, { variant: "additional-100", as: "p", faded: true, children: textBelowPrice }) : null
|
|
31
33
|
] });
|
|
@@ -6,24 +6,26 @@ import { Flex } from "../flex/flex.js";
|
|
|
6
6
|
import { Text } from "../text/text.js";
|
|
7
7
|
import { teddyColorBrandCorePurple } from "../../tokens/color/variables.js";
|
|
8
8
|
const Price = React__default.forwardRef(
|
|
9
|
-
({ className, pricePrefix, priceText, variant = "default", textAbovePrice, textBelowPrice }, forwardRef) => {
|
|
9
|
+
({ className, pricePrefix, priceSuffix, priceText, variant = "default", textAbovePrice, textBelowPrice }, forwardRef) => {
|
|
10
10
|
const rootColorDotsClass = `${rootClassName}__price`;
|
|
11
11
|
const classes = clsx([styles[rootColorDotsClass]], className);
|
|
12
12
|
return /* @__PURE__ */ jsxs(Flex, { flexGrow: "1", mt: "auto", mb: "100", ref: forwardRef, className: classes, direction: "column", gap: "10", children: [
|
|
13
13
|
textAbovePrice ? /* @__PURE__ */ jsx(Text, { variant: "additional-100", as: "p", faded: true, children: textAbovePrice }) : null,
|
|
14
14
|
/* @__PURE__ */ jsxs(Flex, { direction: "row", align: "baseline", flexGrow: "1", wrap: "nowrap", children: [
|
|
15
|
-
/* @__PURE__ */ jsx(Text, { variant: "paragraph-200", as: "p", faded: true, children: pricePrefix
|
|
15
|
+
pricePrefix && /* @__PURE__ */ jsx(Text, { variant: "paragraph-200", as: "p", faded: true, children: pricePrefix }),
|
|
16
16
|
/* @__PURE__ */ jsx(
|
|
17
17
|
Text,
|
|
18
18
|
{
|
|
19
19
|
variant: "paragraph-100-bold",
|
|
20
20
|
as: "span",
|
|
21
21
|
ml: "100",
|
|
22
|
+
mr: "100",
|
|
22
23
|
color: variant === "purple" ? teddyColorBrandCorePurple : void 0,
|
|
23
24
|
className: styles[`${rootColorDotsClass}--big`],
|
|
24
25
|
children: priceText
|
|
25
26
|
}
|
|
26
|
-
)
|
|
27
|
+
),
|
|
28
|
+
priceSuffix && /* @__PURE__ */ jsx(Text, { variant: "paragraph-200", as: "p", faded: true, children: priceSuffix })
|
|
27
29
|
] }),
|
|
28
30
|
textBelowPrice ? /* @__PURE__ */ jsx(Text, { variant: "additional-100", as: "p", faded: true, children: textBelowPrice }) : null
|
|
29
31
|
] });
|