linkedunion-design-kit 1.2.9 → 1.3.0
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.
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const ensureValue: (value: string | undefined, fallbackValue: (() => void | string) | string) => string | (() => void | string);
|
|
2
|
+
export declare const getColor: (color: string | undefined, fallbackColor: (() => void | string) | string) => string | (() => void | string);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export var ensureValue = function (value, fallbackValue) {
|
|
2
|
+
if (value === null || value === undefined || value === '') {
|
|
3
|
+
return fallbackValue;
|
|
4
|
+
}
|
|
5
|
+
else {
|
|
6
|
+
return value;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
export var getColor = function (color, fallbackColor) {
|
|
10
|
+
return ensureValue(color, fallbackColor);
|
|
11
|
+
};
|
|
@@ -2,6 +2,7 @@ import { cardLayoutEnum, contentTypeEnum } from "../../utils/enum";
|
|
|
2
2
|
import { LuImage } from "../Images/LuImage";
|
|
3
3
|
import { Button } from "../Button/Button";
|
|
4
4
|
import Link from "next/link";
|
|
5
|
+
import { getColor } from "../../app/scripts";
|
|
5
6
|
export var PostByCategory = function (props) {
|
|
6
7
|
return (<>
|
|
7
8
|
{(props === null || props === void 0 ? void 0 : props.layout) === cardLayoutEnum.horizontal ?
|
|
@@ -25,7 +26,7 @@ export var PostByCategory = function (props) {
|
|
|
25
26
|
<LuImage image={props.image} width={240} height={240} className="lu-width-100 lu-height-100 object-cover" orientation={props.mediaPosition}/>
|
|
26
27
|
</div>
|
|
27
28
|
<div className={"flex flex-col items-center flex-grow lu-m-250 text-center h-[100px]"}>
|
|
28
|
-
<div className={"
|
|
29
|
+
<div className={"card_title_color_".concat(props === null || props === void 0 ? void 0 : props.id, " lu-font-size-2x-large lu-font-weight-semibold vertical_card_heading")}>{props.heading}</div>
|
|
29
30
|
<p className="lu-base-font-size lu-font-weight-extra-light lu-text-caption vertical_body_text">{props.body}</p>
|
|
30
31
|
</div>
|
|
31
32
|
<Link href={props.href || ''} className="lu-width-100">
|
|
@@ -34,7 +35,7 @@ export var PostByCategory = function (props) {
|
|
|
34
35
|
</div>
|
|
35
36
|
</>)}
|
|
36
37
|
<style jsx global>
|
|
37
|
-
{"\n .card_title_color_".concat(props === null || props === void 0 ? void 0 : props.id, " {\n color: ").concat(props.card_title_color, ";\n }\n ")}
|
|
38
|
+
{"\n .card_title_color_".concat(props === null || props === void 0 ? void 0 : props.id, " {\n color: ").concat(getColor(props === null || props === void 0 ? void 0 : props.card_title_color, 'lu-text-default'), ";\n }\n ")}
|
|
38
39
|
</style>
|
|
39
40
|
</>);
|
|
40
41
|
};
|